Home » SQL & PL/SQL » SQL & PL/SQL » PL/SQL - Using a Param both as Value and Key (Oracle, PL/SQL, Windows XP)
icon4.gif  PL/SQL - Using a Param both as Value and Key [message #377180] Sun, 21 December 2008 07:00 Go to next message
AlexD
Messages: 1
Registered: December 2008
Junior Member
Hello.

I am writing a trigger in PL/SQL that needs to use a parameter both as a value and as key.

Will try to elustrate what I mean:

Referencing NEW as new_row OLD as old_row
Declare
mParam varchar2(30);
mRow table1%rowtype;

mRow.FIELD_NAME := mParam; -- Using the value in mParam to assign a diff variable

mRow.NEW_VALUE := new_row.mParam -- Using the value inside mParam as the name of a column in new_row


The only way I can think thats close to completing it is using EXECUTE IMMEDIATE, but then my parameters are not recognizable in the executable block.

Would appreciate input,
Thanks,
AlexD
Re: PL/SQL - Using a Param both as Value and Key [message #377193 is a reply to message #377180] Sun, 21 December 2008 09:12 Go to previous message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You can't.

Also please read OraFAQ Forum Guide.

Regards
Michel

[Updated on: Sun, 21 December 2008 09:12]

Report message to a moderator

Previous Topic: UPDATING() Doubt
Next Topic: running string concatenation
Goto Forum:
  


Current Time: Thu Dec 08 02:38:15 CST 2016

Total time taken to generate the page: 0.08695 seconds