------=_Part_19761_1619648.1209057916539
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
A user enters a name into a textfield and clicks on a "Find" button.
Depending on which text field the user entered the data, the appropriate
column name in the table is used for fieldName and the entered text is
passName. However, the fieldName doesn't return anything. But if I
replace
fieldName with the column name ("WHERE first_name='"), the program returns
values. Can't we use variables for column names or do I have to just put
it
all in an if/else statement?
Here is my code:
result = fe.executeQuery("SELECT first_name, last_name,
emp_nbr, emp_type_code, emp_status_code, emp_work_center " +
"FROM employee " +
"WHERE
'"+fieldName+"'='"+passName+"'");
------=_Part_19761_1619648.1209057916539
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
A user enters a name into a textfield and clicks on a "Find"
button. Depending on which text field the user entered the data, the
appropriate column name in the table is used for fieldName and the entered
text is passName. However, the fieldName doesn't return
anything. But if I replace fieldName with the column name
("WHERE first_name='"), the program returns values.
Can't we use variables for column names or do I have to just put it
all in an if/else statement?<br>
<br>Here is my
code:<br><br>
result = fe.executeQuery("SELECT first_name, last_name, emp_nbr,
emp_type_code, emp_status_code, emp_work_center "
+<br>
"FROM employee " +<br>
"WHERE
'"+fieldName+"'='"+passName+"'");<br>
------=_Part_19761_1619648.1209057916539--


|