Skip to Content
0
Former Member
Aug 06, 2012 at 04:17 AM

Question about character data lost when writing external oracle database by Native SQL

34 Views

When I update constans data to external oracle database, data in specified table will update correctly, But when I update variables to the same table, character data will lost. Below is the code.

Code with constans:

EXEC SQL.

INSERT INTO TRAVEL_01 VALUES( 'ABCDEFG'

'123ABC')

ENDEXEC.

data will insert into table sucessfully.

Code with varables:

data l_var1 type char20 value 'ABCDEFG'.

data l_var2 type char10 value '123ABC'.

EXEC SQL.

INSERT INTO TRAVEL_01 VALUES(:l_var1,

:l_var2 )

ENDEXEC.

result in database is as below:

Col1(char20) Col2(char10) AB 123

I don't know how solve this problem, please give me some suggestion.

Thanks

Ivan