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

Data to MS SQL

dmi
Participant
0 Likes
475

Hello

I send data from SAP (rel. 4.6C) to a SQL data base.

It works properly with Native SQL. But my problem is:

I send a dataset, some fields are empty. In SAP I use CLEAR to initialize this fields (type CHAR)

In the SQL data base this fields arrives with one space.

Its possible to send a CHAR-Field without any space - realy empty?

Many thanks for your help!

3 REPLIES 3
Read only

abdul_hakim
Active Contributor
0 Likes
445

hi

no you cannot since the default value of char type field is space.

Cheers,

Hakim

Read only

Former Member
0 Likes
445

Hi Daniel,

1. Instead of EXEC SQL, use the ADBC library. It offers proper error handling (it gives you the ORA-XXX error code). See sample program ADBC_DEMO.

2. Generate your NATIVE SQL dynamically and use <b>null</b> where applicable.

For example (not proper code- just the general idea):

 Insert into TABNAME values(Field1,Field2,null,null,null,null)...

Best Regards,

Ofer

Read only

dmi
Participant
0 Likes
445

solved by my self