Re: Dynamic table names in Pro*C

From: Ashok Upadhyay <aupadhya_at_earthlink.net>
Date: Fri, 20 Nov 1998 14:25:00 GMT
Message-ID: <36557AC0.BA29F4FA_at_earthlink.net>


Look in Pro*C manual dynamic method 3. You got to prepare the dynamic sql statement.A host varibale will contain the whole select statment (including table name - which can be stored in a host varibale and can be assigned values at runtime) then prepare it using EXEC SQL PREPARE FROM :variable. To use it you must use EXEC SQL EXECUTE :varibale.It is well described in manul if I am missing something. Ashok

Sandy wrote:

> Hi ,
> You can create a host variable in Pro*C to dynamically store the value
> of table name . While using it in a Dynamic statement , donot prefix it will
> colon.It works.
>
> regards
> Sandeep
>
> Mike Isaac wrote:
>
> > I've been trying to figure out how to create a sql statement in Pro*C with a
> > dynamic table name. All of the examples in the Pro*C programmers guide use
> > hard-coded table names. If anyone has done this before can you send me an
> > example.
> >
> > thanks.
Received on Fri Nov 20 1998 - 15:25:00 CET

Original text of this message