Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Passing null to CORP by Native SQL

Former Member
0 Likes
631

Hi All,

I want to send null value to a date field of CORP table by using Native sql. But while checking data in CORP, i am getting value of date field as '1900-01-01'. But i want to store null.

Also plz let me know the syntax to declare a variable in native sql so that i can assign null value to it and insert accordingly.

Can any body please help me regarding this.

Thanks

Nitesh

2 REPLIES 2
Read only

Former Member
0 Likes
415

Try the following:

TRY.

EXEC SQL.

INSERT INTO z_table

( ..., z_date )

VALUES

( ..., NULL )

ENDEXEC.

CATCH cx_sy_native_sql_error INTO lv_exc_ref.

lv_error_text = lv_exc_ref->get_text( ).

ENDTRY.

Read only

Former Member
0 Likes
415

Thanks a lot.