View Full Version : passing column name to stored procedure
Can I pass in a column name to a stored procedure? That is, I want to have a procedure which will update the variable column name that I pass to it - rather than the procedure being hardcoded with the column name.
Fou-Lu
08-05-2008, 10:35 AM
I have very limited stored procedure experience, and limited to oracle. But I believe the answer is no. A big part of using stored procedures (aside from precompilation) is to prevent unprivileged users from altering or controlling data which they should not be. Allowing them to add their own columns would defeat this purpose.
Brandoe85
08-05-2008, 03:57 PM
I haven't ever did it with Oracle, but you can probably use dynamic sql and execute the statement. It's not recommended but it does have it uses. Google oracle dynamic sql.
Good luck.
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.