‎2008 Aug 20 3:00 PM
Hi ,
I have to bring in data from a view created in FIDO into my ABAP program . The database is oracle. I am trying to use basic forms of native sql embedded in my code to retrieve the data , but I get a short dump stating that the table does not exist.
I am using the following code :
DATA: BEGIN OF wa,
field_id(32) type c,
field_common_name(100) TYPE c,"spfli-cityfrom,
END OF wa.
DATA c1(32) TYPE C VALUE 'LH'.
EXEC SQL PERFORMING loop_output.
SELECT field_id, field_common_name
INTO :wa
FROM v_field
WHERE field_id = :c1
ENDEXEC.
FORM loop_output.
WRITE: / wa-field_id, wa-field_common_name.
ENDFORM.
‎2008 Aug 20 3:12 PM
Because "V_FIELD" is not a valid table
EXEC SQL PERFORMING loop_output.
SELECT field_id, field_common_name
INTO :wa
FROM v_field " <<<< -----
WHERE field_id = :c1
ENDEXEC.
a®
‎2008 Aug 20 3:12 PM
Because "V_FIELD" is not a valid table
EXEC SQL PERFORMING loop_output.
SELECT field_id, field_common_name
INTO :wa
FROM v_field " <<<< -----
WHERE field_id = :c1
ENDEXEC.
a®
‎2008 Aug 20 9:46 PM
I checked and the table exists , is it because I have to connect to the external database first. I do not know how to connect to an external database. Is that some code segment I have to add to my abap program .
thanks
‎2008 Aug 20 10:07 PM
Hi.
First of all you have to define a database connection to the external database you want to use. Database connections are stored in table DBCON. Use transaction DBCO or DBACOCKPIT to maintain them. The latter offers much more help and a test if all parameters are set correctly. Search SDN for details.
Then you have to open the connection you want to use before you do your EXEC SQL.
EXEC SQL.
CONNECT TO <con_name> AS <alias_name>
ENDEXEC.
Please search the forums for further details. Or browse the online docu / F1 help. You will find a lot of further information.
Best regards,
Jan Stallkamp