urgent::dynamic sql in pro*C [message #71667] |
Fri, 13 December 2002 03:18 |
srivani
Messages: 3 Registered: December 2002
|
Junior Member |
|
|
can i give a name of the table as a variable in dynamic statement in a proc program;
like select * from :tname;
please tell me the answer ASAP
it will be really helpful to me
thanks and regards
vani
|
|
|
Re: urgent::dynamic sql in pro*C [message #71996 is a reply to message #71667] |
Mon, 17 February 2003 18:43 |
locs
Messages: 1 Registered: February 2003
|
Junior Member |
|
|
you may try the following sample codes:
char *tablename = "sample";
EXEC SQL BEGIN DECLARE SECTION;
VARCHAR sqlstatement [[30]];
EXEC SQL END DECLARE SECTION;
sqlstatement.len = sprintf ((char *) sqlstatement.arr, "select * from %s", tablename);
EXEC SQL EXECUTE IMMEDIATE :sqlstatement;
|
|
|