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

SQL error "-2" occured when executing EXEC SQL

Former Member
0 Likes
778

Hi all,

An error occured when executing a shipment transaction.

There is a native SQL code written in a Z function module,where the dump occurs.

Runtime errors:DBIF_DSQL2_SQL_ERROR

Exception:CX_SY_NATIVE_SQL_ERROR.

The error points to a selection from a different database.

I have given the code below.

EXEC SQL PERFORMING CREATE_MESSAGE_TEXT.

SELECT CARRIER, SUM(FREIGHT_CHARGE) INTO :SCAC, :FREIGHT

FROM SHIPMENT_ID@URP_ITP ID, SHIP_CHARGE_DETL@URP_ITP DETL

WHERE ID.SHIP_ID_TYPE = 5

AND ID.EXTERNAL_SHIP_ID = :ITSHIPID

AND ID.SHIPMENT_HANDLE = DETL.SHIPMENT_HANDLE

GROUP BY CARRIER

ENDEXEC.

Kindly provide ur suggestion regarding this dump.

6 REPLIES 6
Read only

Former Member
0 Likes
738

Hi,

check whether entry exist in table DBCOn

for database.

Regards

amole

Read only

Former Member
0 Likes
738

hi,

This is because the maximum number of secondary database connections was exceeded.

check if OSS note 323151 helps you.

Regards,

Sailaja.

Message was edited by: Sailaja N.L.

Read only

0 Likes
738

Hi Could not able to find entries in table DBCON. We are not getting this problem always. But we are getting this problem very often.

Read only

0 Likes
738

Hi Sailaja,

What would be the solution to this error ?

How can we increase the number of secondary database connections?

Thanks

Vijay

Read only

Former Member
0 Likes
738

Hi,

the SQL error may have several reasons. 1st we need to know, which database you are using (e.g. Oracle) to find out the meaning of value "-2".

For MSSQL e.g. i have found a web information, that code 2 means timeout.

Regards,

Klaus

Edited by: Klaus Babl on Oct 12, 2011 7:51 AM

Read only

0 Likes
738

Klaus,

We are using ORACLE database.

Thanks

Vijay