Hello esteemed users -
I have a spreadsheet with various cells and want to create a dynamic query to access a backend dictionary table based on the value of certain cells and insert into another tb.
For example, in the following:
EID or PID PhyNum Web Red Blu Gre Sil
5000418 p97582 x x x x x
5000419 p97584 x x x x x
5000420 p97583 x x x x x
5000421 p97585 x x x x x
5000422 p97586 x x x
EID, PID relate to CPK_WORKGROUP_ID
web, red, blu, gre, sil relate to C_DESC column
I want to query a table / insert to another.
Tables are:
tworkgroup (dictionary):
CPK_WORKGROUP_ID
C_DESC
C_CREATED_TS
tworkgroupreqister:
CPK_WORKGROUP_ID
CPK_USERID
C_WORKGROUP_ADMIN
Query is:
insert into db21sql.tworkgroupregister
select cpk_workgroup_id, '<PhyNum from xls>', 0
from db21sql.tworkgroup
where upper(c_desc) like '%SILVER%'; (or web, red, blu, gre for each with an 'x')
Is this doable? or am I up a tree
TIA,
Jeff A
[year+ old attachment deleted by admin]