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
Messages: 1
Registered: December 2008
Junior Member

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
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,
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: 65076
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You can't.

Also please read OraFAQ Forum Guide.


[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 Jul 20 08:18:14 CDT 2017

Total time taken to generate the page: 0.18004 seconds