Hi
EXEC SQL SELECT * FROM :tablename WHERE :attribute_name=:value;
You cannot do that in any language be it pl/sql ,pro *C VB etc.
The table name and the atribute name has to be known before hand
what you need to do is first prepare the sql statment in your case
SELECT * FROM :tablename WHERE :attribute_name=:value;
as a string
something like
Code:
char *sql = "select * from " ;
char *tabname=" tablename "; /* can be a param that is passed */
char *predicate=" where " ;
char *column_name ="attribute_name";
/*now you need to concat the strings */
strcat(sql,tabname);
strcat(sql,predicate);
strcat(sql,column_name);
now having constructed the string you need to prepare it and execute it
EXEC SQL EXECUTE IMMEDIATE :sql using :value
regards
Hrishy
Bookmarks