Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic replacement of Column Name in a Procedure

Status
Not open for further replies.

maitrasuman

Programmer
Aug 2, 2001
6
IN
Pl. help me to resolve this problem :-

In a stored procedure I want to pass a parameter which will substitute the column_name of a particular table for query purpose, say as for example

SELECT EMPNAME FROM paymain A
WHERE A.v_colname = '08262755' -- here v_colname is the

parameter which I want to put. Is it possible to write a query like this or there are other way rounds. I do not want to hardcode the column name of the queried table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top