2008 Jul 11 1:28 PM
Hello,
I try to get a description of the all the fields of an (external) oracle table but I'm no to happy yet.
"SELECT" to this oracle connection work but I can't use "DESC"-command successful.
The report looks like this:
.REPORT z_desc_ext_table.
DATA: wa(500) TYPE c.
DATA: dbcon_name(30) TYPE c VALUE 'PDMQ' . "Name in DBCO
START-OF-SELECTION.
EXEC SQL.
SET CONNECTION :dbcon_name
ENDEXEC.
EXEC SQL.
connect to :dbcon_name
ENDEXEC.
EXEC SQL.
open c for
desc table.in.oracle.
ENDEXEC.
DO.
EXEC SQL.
fetch next c into :wa
ENDEXEC.
IF sy-subrc <> 0.
EXIT.
ENDIF.
WRITE: / wa.
ENDDO.
EXEC SQL.
disconnect :dbcon_name
ENDEXEC..
When the report is executed the following dump is produced:
...
Database error text........: "ORA-00900: invalid SQL statement"
Triggering SQL statement...: "FETCH NEXT "
Internal call code.........: "[DBDS/NEW DSQL]"
...
000300 DO.
000310 EXEC SQL.
> fetch next c into :wa
000330 ENDEXEC.
000340 IF sy-subrc <> 0.
000350 EXIT.
000360 ENDIF.
...
Does anyone have an idea how to make this work?
Hello,
I try to get a description of the all the fields of an (external) oracle table but I'm no to happy yet.
"SELECT" to this oracle connection work but I can't use "DESC"-command successful.
The report looks like this:
.REPORT z_desc_ext_table.
DATA: wa(500) TYPE c.
DATA: dbcon_name(30) TYPE c VALUE 'PDMQ' . "Name in DBCO
START-OF-SELECTION.
EXEC SQL.
SET CONNECTION :dbcon_name
ENDEXEC.
EXEC SQL.
connect to :dbcon_name
ENDEXEC.
EXEC SQL.
open c for
desc table.in.oracle.
ENDEXEC.
DO.
EXEC SQL.
fetch next c into :wa
ENDEXEC.
IF sy-subrc <> 0.
EXIT.
ENDIF.
WRITE: / wa.
ENDDO.
EXEC SQL.
disconnect :dbcon_name
ENDEXEC..
When the report is executed the following dump is produced:
...
Database error text........: "ORA-00900: invalid SQL statement"
Triggering SQL statement...: "FETCH NEXT "
Internal call code.........: "[DBDS/NEW DSQL]"
...
000300 DO.
000310 EXEC SQL.
> fetch next c into :wa
000330 ENDEXEC.
000340 IF sy-subrc <> 0.
000350 EXIT.
000360 ENDIF.
...
Does anyone have an idea how to make this work?
2008 Jul 11 8:41 PM
Hello.
I would suggest asking this question in the 'SAP on Oracle' forum. What I would suggest anyway is to use ADBC instead of EXEC SQL. But that is my personal preference as it is object oriented and in my eyes easier to use.
Best regards,
Jan Stallkamp
2008 Jul 14 1:16 PM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |