473,799 Members | 3,085 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trigger ISSUE

10 New Member
I have a problem that i cant seem to find out why i am getting this error when updating table I am get error saying cant in NULL in field name CreateByUser.
I am using a INSTEAD OF INSERT Trigger. This trigger is triggered from a store procedure with the information is transfer via a XML file. The insert of a new record is done without any problem. Can someone help Below is the update code

BEGIN
UPDATE Customer
SET CustomerCode=@C ustomerCode,Cus tomerIdentifica tionT ype=@CustomerId entificationTyp e ,
CustomerIdentif icationGroupCod e=@CustomerIden tific ationGroupCode, DocumentNumber= @DocumentNumber ,
FirstName=@Firs tName,LastName= @LastName,Middl eName =@MiddleName,
CustomerName=@C ustomerName,Con tactPerson=@Con tactP erson,ContactTi tle=@ContactTit le,
Country=@Countr y,ParishOrState =@ParishOrState ,Dist rictOrCity=@Dis trictOrCity,Com munityOrTownShi p=@Co mmunityOrTownSh ip,
Street=@Street, TelephoneNumber s=@TelephoneNum bers, CellPhoneNumber s=@CellPhoneNum bers,
EmailAddress=@E mailAddress,Pho to=@Photo,Custo merCa tegory=@Custome rCategory,
CustomerIdentif icationIssuingI nstitution=@Cus tomer IdentificationI ssuingInstituti on,
CustomerIdentif icationIssuingC ountry=@Custome rIden tificationIssui ngCountry,Custo merIdentificati onExp irationDate=@Cu stomerIdentific ationExpiration Date,
CustomerIdentif icationCategory =@CustomerIdent ifica tionCategory,Co mments=@Comment s,Occupation=@O ccupa tion,DateofBirt h=@DateofBirth,
TaxRegistration Number=@TaxRegi strationNumber, LastT radeDate=@LastT radeDate,LastTr adeValue=@LastT radeV alue,
LastTradeType=@ LastTradeType,T raderAssignedTo Accou nt=@TraderAssig nedToAccount,Di scountPuchaseTr ade=@ DiscountPuchase Trade,
DiscountSaleTra de=@DiscountSal eTrade,MinimumP uchas eTradeValueForD iscount=@Minimu mPuchaseTradeVa lueFo rDiscount,
MinimumSaleTrad eValueForDiscou nt=@MinimumSale Trade ValueForDiscoun t,Active=@Activ e,CompanyCode=@ Compa nyCode,Location Code=@LocationC ode,
BranchCode=@Bra nchCode,OwnerCo de=@OwnerCode,D ateTi meCreated=@Date TimeCreated,Dat eTimeModified=@ DateT imeModified,
CreatedByUser=@ CreatedByUser,M odifiedByUser=@ Modif iedByUser,Sourc eOfFunds=@Sourc eOfFunds
WHERE CustomerCode = @CustNum
END
IF @@ROWCOUNT <> 0
BEGIN
INSERT INTO
SysDatabase_Tra nsactions( Record_Id,Table Name,Operation, TransferDateTim e)
SELECT b.CustomerCode, 'Customer','U', Getdate()
FROM Inserted b
END
Feb 27 '08 #1
1 1110
ck9663
2,878 Recognized Expert Specialist
I think that means CreateByUser does not accept NULL value. That could happen on your INSERT. Since, the UPDATE is manipulating an existing row and CreateByUser is not on your UPDATE sql. I can only assume that would be on your INSERT. In it you specified certain columns and CreateByUser is not on it. Maybe you need to include it.

Happy Coding

-- CK
Feb 27 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2006
by: Matik | last post by:
Hello to all, I have a small question. I call the SP outer the DB. The procedure deletes some record in table T1. The table T1 has a trigger after delete. This is very importand for me, that the SP will be finished ASAP, that's why, I do not want, and I do not need to wait for a trigger.
18
5987
by: Bill Smith | last post by:
The initial row is inserted with the colPartNum column containing a valid LIKE pattern, such as (without the single quotes) 'AB%DE'. I want to update the column value with the results of a query against a different table (that uses the LIKE predicate) but cannot get around the SQL0132 error . I have tried the hex notation after the LIKE such as (without the quotes)... " where colNewPartNum like ( X'27' || nnn.colPartNum || X'27) " ,...
4
4698
by: Paul Reddin | last post by:
Hi, Having just tested our database on V8.2 we get the following apparent incompatibility. A Trigger conatains the following line CREATE TRIGGER JABS.AU_CHNG_ENQUIRYITM AFTER UPDATE OF ..
3
3421
by: Ricardo Corsi | last post by:
Hi, It is possible to call a trigger (inside a sql server..) with asp.net ? how can i do that ? thks!
2
24761
by: niradjoshi | last post by:
I made two SQL Server 2000 as linked server using same remote login These both server are running on different Domain Configuration Detail 1. Server A - MS SQL Server 2000 SP4, windows 2003 standard edition SP1 2. Server B - MS SQL Server 2000 SP3, windows 2003 standard edition I have Created same login in both the servers called test
9
2750
by: steven | last post by:
Does anyone know how to do the following. I'm trying to mimic replication with triggers. I have 2 databases, each have these 2 tables. 1. USERS ID int NAME varchar(20)
2
2398
by: dean.cochrane | last post by:
I have inherited a large application. I have a table which contains a hierarchy, like this CREATE TABLE sample_table( sample_id int NOT NULL parent_sample_id int NOT NULL ....lots of other cols...) DELETEs on all tables are handled by the front end code, which just
6
6848
by: wugon.net | last post by:
Hi , Anyone know how to monitor db2 trigger activity ? We suffer some trigger issue , and we try to monitor trigger's behavior use event monitor and db2audit, but both tools can not get trigger's sql statment and cost, have other tools can get trigger's executing sql statment and cost ? our test case as follow: Env:
1
1719
by: candide_sh | last post by:
hello, I googled around some time but I found no solution for this issue (SS2000). I have a table tblB which has to be filled whenever in another table tblA records are inserted, updated or deleted. So I created one trigger which works fine for inserts and updates and fills my tblB. tblB is filled with other fields which I get from a view vwC.
11
7883
by: tracy | last post by:
Hi, I really need help. I run this script and error message appeal as below: drop trigger log_errors_trig; drop trigger log_errors_trig ERROR at line 1: ORA04080: trigger 'LOG_ERRORS-TRIG' does not exist drop table log_errors_tab;
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10484
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10251
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10228
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9072
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.