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

Native SQL - CONNECT TO command

Former Member
0 Likes
1,016

Hi Gurus,

I am trying to access a third party database with Native sql. Basis has set-up a DBConnect with this database. When I tried to coonect to this databse, statement(CONNECT TO) showing sy-subrc = 4. My connection testing program is given here.

REPORT zbw_sd_test.

PARAMETERS: con TYPE dbcon-con_name.

EXEC SQL.

connect to :con

ENDEXEC.

WRITE: 'Sy-subrc = ' .

WRITE: sy-subrc.

When I chose another databse connection name, it is showing sy-subrc = 0.

Is that the problem with improper DBConnect?

How can I identify the reason for 'sy-subrc = 4' in CONNECT TO statement?

Pls guide me..

Thanks..

Saj

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
781

Maybe:

PARAMETERS: con TYPE dbcon-con_name LOWER CASE.

Rob

4 REPLIES 4
Read only

Former Member
0 Likes
782

Maybe:

PARAMETERS: con TYPE dbcon-con_name LOWER CASE.

Rob

Read only

former_member156446
Active Contributor
0 Likes
781

Hope this helps: [EXEC SQL|http://help.sap.com/abapdocu/en/ABAPEXEC_CONNECTION.htm]

Read only

Former Member
0 Likes
781

It was a problem with DBConnect..Basis team has done it..

Read only

Former Member
0 Likes
781

Hi...

first write below mentioned code for connection.

EXEC SQL.

set connection 'CHANCRM'

ENDEXEC.

Salil..