| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> column name passed as a variable
I am new to Oracle application programming. We are using Oracle Pro C/C++ and
and Oracle 7 database. I am trying to pass a column name into a SQL EXEC statement.
If I explicitly name the column, the query returns the expected results. However,
if I try to pass variable, the returned value is the column name.
Can someone tell me what I am doing wrong?
Thanks,
EXEC SQL BEGIN DECLARE SECTION;
char in_FieldName[40];
char in_SubsystemId[15];
char fieldValue[5];
static short nullind;
EXEC SQL END DECLARE SECTION;
strcpy(fieldValue,'\0');
EXEC SQL
SELECT :in_FieldName
INTO :fieldValue :nullind
FROM LND
WHERE LND.SubsystemId = :in_SubsystemId;
Received on Wed Feb 19 2003 - 14:49:21 CST
![]() |
![]() |