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

runtime error when try to write in a external Oracle Database

Former Member
0 Likes
2,178

Hi Abapers,

We are tryng to make some updates to external oracle databases. We are in a new project and we are new in theses issues so we are asking for your help.

We have the following source code

....

   CONCATENATE 'insert into' c_tabname INTO teste1 SEPARATED BY space.

MOVE: 'VALUES' to teste2,

       '(6, 4, 5, 99, TO_DATE(20020102,YYYY.MM.DD), 3, 5)' to teste3.

CONCATENATE  teste1 teste2 teste3 INTO l_stmt SEPARATED BY space.

   l_prepstmt_ref = p_con_ref->prepare_statement( l_stmt ).

....

We get teh following error

con=2(10.0.99.136:1521/SFA): ORA-01036: illegal variable name/number

the table has, in the external database the following structure

"ACA_CODEMP"      "NUMBER(5,0)”

"ACA_CODDEL"      "NUMBER(5,0)”

"ACA_CODART"      "VARCHAR2(15 BYTE)"

"ACA_CODSEG"      "VARCHAR2(2 BYTE)”

"ACA_FECHAINI"    "DATE”

"ACA_PRECIO"      "NUMBER(8,4)”

"ACA_FECHFIN"     "DATE”

Can you give some information about what we are doing wrong?

Thank you and best regards

João Fernandes


8 REPLIES 8
Read only

arindam_m
Active Contributor
0 Likes
1,947

Hi,

First check the DB connection if that is defined in ST04. Check the demo program DEMO_ADBC_QUERY should give you a good idea on whats missing in the statement. The idea is the Query should be exactly same as per Oracle Syntax and supplied as string.

Cheers,

Arindam

Read only

Former Member
0 Likes
1,947

Hi,

Thank you Arindam for your response.

The program you suggest me is very helpful but is useful if i am querying the SAP database.

The question i report is trying update the remote Oracle database.

I receive the error from that not from SAP database.

Thank you and best regards

    João Fernandes

Read only

arindam_m
Active Contributor
0 Likes
1,947

Hi,

In ST04 configure a connection to the external DB that you want to probe. Then use that connection to connect to the DB execute the SQL and get back the results.

Cheers,

Arindam

Read only

Former Member
0 Likes
1,947

Hi Arindam,

Thank you for your answer. I can see now your point.

Can you give me some more information about st04 configuration?

I have the connection established successufully. Where can i test my SQL sentence?

     Thank You and Best regards

               João Fernandes

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,947

In ST04 configure a connection to the external DB that you want to probe.

Afaik the external DB connection parameters are maintained in the transaction DBCON. ST04 gives you the SAP database statistics.

- Suhas

Read only

arindam_m
Active Contributor
0 Likes
1,947

Hi Suhas,

The new ST04 gives a more integrated functions and leads to T-Code ORA_PERF that has the DB config option in it also.

Cheers,

Arindam

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,947

Thanks. I had never used it via ST04

Read only

arindam_m
Active Contributor
0 Likes
1,947

Welcome.. I think its available in the new releases.. the Old ST04 did not have it.

Cheers,

Arindam