ProC

From: Anuj Lal <alal1_at_PROBLEM_WITH_INEWS_GATEWAY_FILE>
Date: 23 Mar 1995 15:15:28 GMT
Message-ID: <3ks3ag$7r4_at_eccdb1.pms.ford.com>


>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

EXEC SQL BEGIN DECLARE SECTION
VARCHAR name_of_table[15];
VARCHAR name_of_attribute[15];
EXEC SQL END DECLARE SECTION; /* get table name and atrribute name & then strcpy it */

strcpy(name_of_table.arr,arraywhereyoustoredtable); strcpy(name_of_attribute.arr,arraywhereyoustoredattribute); name_of_table.len = strlen(name_of_table.arr); name_of_attribute = strlen(name_of_attribute.arr);

EXEC SQL SELECT *
FROM :name_of_table
where attributa = :name_of_attribute ; Received on Thu Mar 23 1995 - 16:15:28 CET

Original text of this message