ā2016 Sep 08 7:24 AM
Hi All,
i got one new requirement form customer , there is one report which will insert the some data into our custom (Z/Y table) table . while saving the data into custom table we need to update the same records into SQL table which is having the same fields . and i have tried with eith below Code to isert the data into SQL table .
EXEC SQL.
INSERT INTO CCEC_POD
(Material_dc_no,
service_dc_no,
plant_code,
DC_qty,
pod_qty,
pump_code,
pod_number,
pod_date,
customer_code,
project_code,
material_order_no,
dc_type,
created_on)
values ('111122121' , '124578965' , '1000' , '100','100' ).
ENDEXEC.
and after executing the abouve code it was giving dump in ST22 .
Runtime Errors DBIF_DSQL2_SQL_ERROR
Exception CX_SY_NATIVE_SQL_ERROR
Date and Time 08.09.2016 11:11:34
Short Text
An SQL error occurred when executing Native SQL.
What happened?
The error 947 occurred in the current database connection "DEFAULT".
kindly help on this . is there any connections need to check before executing the report .
Regards,
Raju.
ā2016 Sep 08 7:29 AM
Hi Raju
Have you defined a connection so that you're program knows which system it should be talking with?
Take a look at the coding example here...it is not specific to your issue but has a better flow which includes the Connection Definition.
cl_sql_statement code sample | SCN
Regards
Arden
ā2016 Sep 08 7:54 AM
Hi Arden,
Thanks for quick Replay .....
how to do that connection ? where to do that ? can you give the step by step process for the same . it will help for me.
Regards,
Appala Raju,
ā2016 Sep 08 2:09 PM
Hi Raju!
try this command:
INSERT INTO CCEC_POD
(Material_dc_no,
service_dc_no,
plant_code,
DC_qty,
pod_qty)
values ('111122121' , '124578965' , '1000' , '100','100')
or this:
INSERT INTO CCEC_POD
(Material_dc_no,
service_dc_no,
plant_code,
DC_qty,
pod_qty,
pump_code,
pod_number,
pod_date,
customer_code,
project_code,
material_order_no,
dc_type,
created_on)
values ('111122121' , '124578965' , '1000' , '100','100','','','','','','','','')
Regards,
JƔnos
ā2016 Sep 08 2:29 PM