on 05-19-2009 2:53 PM
Hi,
I am facing a big issue with my interface.
I need to insert a " NULL " when no data goes for a particular record, but it is not inserting null. It is inserting a blank space.
Since the field is a decimal field, i am not able to set a constant " NULL" also. I am using MS SQL Server 2005 for the Database.
We are actually inserting data through Stored Procedures.
The Null option in Communication channel works only in case of insert or update directly in . since we are using SP, we are using EXECUTE statement in the mapping. This doesnt works in case of Stored Procedures.
Kindly help us in this.
a
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the stored procedure, define a variable with value = NULL. Add a condition that when you find empty field in PI, pass that variable to INSERT statement.
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi..
Can you send the SQL query?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
This is the SQL query im using.
-- Creating Procedure USP_EMP --
ALTER PROCEDURE [dbo].[USP_EMP](
@EmpName varchar(15) ,
@EmpID varchar(10),
@Salary decimal(18, 3),
@DOB datetime,
@returncode int output)
AS
Declare @error int
Begin
Begin TRANSACTION
set @returncode=0
If Exists (select * from EMP
where EmpName = @EmpName and
EmpID = @EmpID )
Begin
UPDATE EMP
SET Salary = @Salary,
DOB = @DOB,
ZSTGPOPDATIME = getdate()
WHERE EmpName = @EmpName and
EmpID = @EmpID
End
Else
Begin
INSERT INTO EMP (
EmpName,
EmpID,
Salary,
DOB,
ZSTGPOPDATIME)
VALUES (
@EmpName,
@EmpID,
@Salary,
@DOB,
getdate())
set @error=@@ERROR
If (@error<>0)set @returncode=@error
End
commit
End
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.