Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: PRO*C++: calling STORED PROCEDURES on different database CONNECTIONS
A copy of this was sent to "Chris Franklin" <cfrankli_at_thewatercooler.com>
(if that email address didn't require changing)
On Tue, 12 Jan 1999 14:24:12 -0800, you wrote:
> My PRO*C++ application connects to 3 different Oracle databases to get
>data. I differentiate between the 3 in the embedded SQL by using the "AT"
>clause (because I leave the connections open until the end of the program).
>For example:
>
>// this works
>EXEC SQL AT :sql_db1
>SELECT order_count
>INTO :hvn_order_count
>FROM tbl_the_table
>WHERE col_id = :hvn_id;
>
> This works fine. However, I also need to call stored procedures on these
>3 databases but I'm not sure about what syntax I need to use that will tell
>the stored procedure what database connection I want it to use. I tried
>using the "AT" and "USING" clauses but it didn't work, for example:
>
>// this doesn't work
>EXEC SQL EXECUTE AT :sql_db1
> BEGIN
> sp_the_procedure(:hvn_order_id);
> END;
>END-EXEC;
>
The wire diagram for the EXECUTE statement shows:
EXEC SQL ---+---------------------------+- EXECUTE pl/sql block END-EXEC; | | +--- AT -+- db_name --------+ | | +- :host_variable -+
So, EXEC SQL EXECUTE AT :sql_db1 should be I think
EXEC SQL AT :sql_db1 EXECUTE ....
>
> I suspect I need to use some specific PL/SQL syntax...
>
>Thanks in advance,
>-Chris
>cfrankli_at_thewatercooler.com
>
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Service Industries
Reston, VA USA
--
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Wed Jan 13 1999 - 07:59:12 CST
![]() |
![]() |