cancel
Showing results for 
Search instead for 
Did you mean: 

Insert null values in to JDBC table using Stored Procedures

former_member393841
Participant
0 Kudos

Hi All,

Could any one let us know how to insert null value to the date filed of an JDBC table.

Thanks in advance.

harsha

Accepted Solutions (0)

Answers (1)

Answers (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Are you looking for sample insert SQL for inserting null values?  Something as below

INSERT INTO TEST (COL1, COL2) VALUES (1, NULL);

example: col2 is date.

You can also search online for passing insert values in SP.  The sample example as below

http://social.msdn.microsoft.com/forums/en-US/transactsql/thread/de253497-9795-4dfd-8985-83a2ec49f06...

former_member393841
Participant
0 Kudos

My scenario is proxy to Jdbc receiver using Stored procedures.

In this itried to insert a null value in to a date filed but ended with errors.(Used graphical mapping)

For then same scenario if i passed value to the date field its working fine.

Could any one let us know is there any way to insert null value in to the jdbc table using stored procedures.

Thanks in advance

harsha

Former Member
0 Kudos

Hi,

In the JDBC receiver channel there is an option for the same: "Interpretation of Empty String Values"

From SAP help:

Specify how empty text fields are to be handled.

  • NULL value

In the case of INSERT and UPDATE statements, empty fields are handled like NULL fields (do not exist) and are not inserted in the database.

  • Empty string

In the case of INSERT and UPDATE statements, empty texts are inserted in the columns.

Thanks

Amit Srivastava

former_member393841
Participant
0 Kudos

Thank you very much for your reply Amit Srivastava,

Could you please elaborate it please.

thanks

harsha

Former Member
0 Kudos

Hi,

If i am not wrong you want to insert Null value in the DB table if the date field is empty or does not exist. So, this option will insert "Null" value in the DB table.

So, use MapWithDefault in the mapping for the date field and check "Interpretation of empty string"  option in the JDBC channel and give a try.

Thanks

Amit Srivastava