Skip to Main Content

SQL & PL/SQL

Selecting Column based on variable passed

JanGLiJun 12 2018 — edited Jun 12 2018

Hi,


This is my query:

insert into qa_results_interface@EBS

(

process_status,

organization_code,

plan_name,

decode(qa_results_stage.mon,'Jan',qa.character14,'Feb',qa.character15,NULL)

)

values (select

3,

'FFL',

'HYPERION_CAPEX_WB',

MON

from qa_results_stage

where product = 'CAPEX Additions');

I am passing variable (month name like Jan and Feb) passed on the variable passed i have to select a the table in which i have to insert data. I am trying to achieve this using decode but i am unable to do so.


Need expert opinion.


Regards

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 10 2018
Added on Jun 12 2018
2 comments
134 views