Re: Pro*C --- How to pass a value into a host variable !!

From: Greg Flannery <gflanner_at_mhs-tva.attmail.com>
Date: 1995/03/29
Message-ID: <3lc3a3$5sh_at_bones.knx.tva.gov>#1/1


In article <3kqvoc$6k0_at_portal.gmu.edu>, "Yih-feng Hwang (CS 688)" <yhwang> says:
>
>Hi there,
>
>I have a problem about how to pass a value (string) into a host variable
>( :name_of_table and :name_of_attribute) in a SQL (listed below)
>
> EXEC SQL SELECT *
> FROM :name_of_table
> WHERE :name_of_attribute;
>
>
>Any suggestions/comments will be very useful for myself !!
>
>Thanks in advanced,
>
>yhwang_at_fusion.site.gmu.edu
>

Yih-feng,
  In order to pass the name of the table or column to embeded SQL you must use Dynamic SQL method 4. If you look in the Programmer's Guide to the Oracle Precompilers and the Supplement to the Oracle Precompilers manual for the precompiler you're using (i.e. Pro*C, Pro*COBOL, etc.) it will give an example of how to do this. If you're using Pro*C look at sample9.pc in the proc/demo directory under ORACLE_HOME. Hope this helps.

Greg Flannery
Database Administration
Tennessee Valley Authority Received on Wed Mar 29 1995 - 00:00:00 CEST

Original text of this message