on 04-27-2009 5:43 AM
Hi,
Here R3 DB is MSSQL. Wen i use the sme sql commands like select,insert etc., its going to dump.
Then I tested with another R3 server whose DB is ORACLE, there the code is working 5n.
How to solve this problem, How can i use sql commands by using MSSQL DB.
kindly let me knw what i hav to config?
Regards,
Venkat
Hi Venkat,
could you show us a small piece of your code which doesn't work?
Gudmundur
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karlsson,
Here is the sample code i used,
DATA: BEGIN OF wa,
connid TYPE spfli-connid,
cityfrom TYPE spfli-cityfrom,
cityto TYPE spfli-cityto,
END OF wa.
DATA c1 TYPE spfli-carrid VALUE 'LH'.
EXEC SQL PERFORMING loop_output.
SELECT connid, cityfrom, cityto
INTO :wa
FROM spfli
WHERE carrid = :c1
ENDEXEC.
FORM loop_output.
WRITE: / wa-connid, wa-cityfrom, wa-cityto.
ENDFORM.
Regards,
Venkat
Hello Venkat,
EXEC SQL means "native" sql so the syntax has to conform to the underlying database system, so you have to be careful with portability. SQL Server SAP databases are always configured as case sensitive. The tables you are using have uppercase names (like all SAP tables), so you have to use uppercase names in EXEC SQL:
EXEC SQL PERFORMING loop_output.
SELECT CONNID,CITYFROM,CITYTO
INTO :wa
FROM SPFLI
WHERE CARRID = :c1
ENDEXEC.
Gudmundur
Hi Venkat,
if you change your coding to use uppercase field and table names like I showed, it will work on both oracle and sql server.
Of course EXEC SQL isn't necessary for tables like SPFLI which are in the data dictionary, you should use normal OPEN SQL for that, and there case doesn't matter for any database.
If your code still isn't working with the change to uppercase, then send us again an example which doesn't work.
Gudmundur
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.