Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

dynamic column name in select

SJenkinsMar 1 2021

I need a dynamic action (preferably PL/SQL Function Body) to:
declare ret_val varchar(50);
begin
select :column_name into ret_val from table where primary_col = :primary_value;
return ret_val;
end;

basically I have a select list in an interactive grid where they can pick the column_name
then the dynamic action looks up the value in that column and sets it in another column.
problem is, the dynamic action sets it to the column_name instead of the value...
its acting like: select "column_name" into ret_val from table; instead of looking up the value of the column

This post has been answered by Frank Kulash on Mar 1 2021
Jump to Answer

Comments

Post Details

Added on Mar 1 2021
2 comments
9,541 views