jdmartin74
Programmer
I have a function which is passed a value. I wish to make up a field name based on that value:
v_field := 'ADDRESS_' || p_line;
The above line would give v_field a value of 'ADDRESS_1' for example.
I then want to do:
SELECT v_field INTO v_address from COMPANIES;
This works in so far as the value of v_address becomes 'ADDRESS_1' in this case, and not the value of that field if I had:
SELECT ADDRESS_1 INTO v_address from COMPANIES;
Does anyone know how I can in affect use a variable field name?
Thanks
v_field := 'ADDRESS_' || p_line;
The above line would give v_field a value of 'ADDRESS_1' for example.
I then want to do:
SELECT v_field INTO v_address from COMPANIES;
This works in so far as the value of v_address becomes 'ADDRESS_1' in this case, and not the value of that field if I had:
SELECT ADDRESS_1 INTO v_address from COMPANIES;
Does anyone know how I can in affect use a variable field name?
Thanks