2009 Dec 18 9:46 AM
Guys,
I want to query a database table which is in secondary database (ORACLE). I am on SAP 4.6 and unable to use CONNECTION parameter of FROM clause. I want to use OPEN SQL. Any suggestions on this?
Thanks.
Guys,
I want to query a database table which is in secondary database (ORACLE). I am on SAP 4.6 and unable to use CONNECTION parameter of FROM clause. I want to use OPEN SQL. Any suggestions on this?
Thanks.
2009 Dec 18 10:12 AM
Hi pramod,
1. for this u will also require help of basis team.
2. these are the steps.
a) make an entry in DBCON
b) make connection string
(on the physical application server,
so that it can connect to secondary database)
(this will be done by basis team,
in which, they will specify the
IP address of the secondary database server,
the DATABASE ID, and the port number)
c) then using open sql / native sql,
we can use the secondary database connection,
just like normal.
d) if we use open sql,
then there must be Y/Z table / view on
sap as well as secondary database,
and the field names , their type all should be identical.
regards,
amit m.
2009 Dec 18 10:21 AM
Thanks Amit.
The setting is in place and I am able to fetch data using Native SQL.
The problem is I want to fetch the data using Open SQL which is not happening. In case of Open SQL if I set the connection to secondary database and uses normal query, it returns me data which is available in primary database and not secondary. If I use CONNECTION parameter in FROM clause, it says wrong expression in from clause (I think this is bcoz I am on SAP 4.6). How to resolve this?
Regards,
PRAMOD
2009 Dec 18 10:26 AM
Hi again,
The connection parameter must be supplied immediately after the table name.
Also this will work with SELECT.... ENDSELECT only.
eg.
select * from t001
connection 'DBCON'
into itab
where bukrs = '1000'.
endselect.
regards,
amit m.
2009 Dec 18 10:33 AM
Hi Amit,
The query you posted is working on SAP 4.72 but not on SAP 4.6
Is there any way to use this query on 4.6C, like any patch or note?
Appreciated your response.
Thanks,
PRAMOD
2009 Dec 18 11:04 AM
Hi,
have you checked this?:
http://help.sap.com/saphelp_46c/helpdata/EN/fc/eb3b8b358411d1829f0000e829fbfe/content.htm
Best regards.
2009 Dec 21 6:25 AM
Guys,
Still waiting for the answer, your response will be appreciated.
2009 Dec 21 11:41 AM
Hi,
Can I upgrade SAP 4.6 kernel to SAP 4.72 to enable this query to work? I don't want to upgrade whole system but want to avail certain commands which are not in 4.6. What would be the impact of upgrading kernel level to the system? How much time will it take?
Helpful answers will be highly appreciated.
Regards,
PRAMOD
2009 Dec 18 10:18 AM
Hi,
there are several OSS Notes regarding this.
e.g.
https://service.sap.com/sap/support/notes/738371
This note proposes a test program:
REPORT ZTESTDBCON.
data: DBN(128).
EXEC SQL.
CONNECT TO 'TST'
ENDEXEC.
EXEC SQL.
SET CONNECTION 'TST'
ENDEXEC.
EXEC SQL.
SELECT db_name() INTO :DBN FROM SVERS
ENDEXEC.
WRITE: / 'current database name', DBN.
Have a look at them.
Best regards.
Edited by: Pablo Casamayor on Dec 18, 2009 11:29 AM
2009 Dec 18 10:23 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |