Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Eval or macro substitution
Message
General information
Forum:
Oracle
Category:
PL/SQL
Miscellaneous
Thread ID:
00883448
Message ID:
00886203
Views:
17
Hi Dave.

I have not seen a situation in Oracle where you can assign a value to a variable by assigning the value to the name of the variable.

Even with EXECUTE IMMEDIATE, you create the entire SQL as a variable but you must explicitly list any INTO variables.

-- George

>creating a ad-hoc report system where the number of columns is variable. We'll know the number of columns at runtime but would like to make this process as generic as possible. Instead of hard-coding the collection groups, We'd like to use something like the following code:
>
>for i in 1..g_count -1 loop
> l_field := l_field ||'l_value' || i || ', ';
>end loop;
>l_field := l_field || 'l_value'||g_count;
>-- would like to use this
>fetch l_ref_cur bulk collect into l_field;
>-- instead of this
>fetch l_ref_cur bulk collect into l_value, l_value1, l_value2, l_value3, l_value4, l_value5, l_value6;
>
>
>This error is generated when compiling the code for the first fetch statement:
>
>PLS-00497: cannot mix between single row and multi-row (BULK) in INTO list.
>
>How can I tell the compiler to use the value of l_field instead of the variable name?
George
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform