The snippet of code I have a question about is below:
if state_id = 'AL' or is_state_id = 'CA' then
Select taxes, fees
Into :ld_pst_taxes, :ld_gst_fees
From state_charges p, state_charges g
Where upper(p.fee) ='JSS' and upper
(g.fee) ='MSS'
and p.fee_parm = :a_fee_parm
***********************************************
and p.state_id = :is_state and g.state_id = :is_state
************************************************
and p.corp_id = (select corp_id
from branch_lookup
where branch_id = somevariable)
and g.corp_id = (select corp_id
from branch_lookup
where branch_id = somevariable)
end if
I want to know if it is possible to make the section I have
surrounded by asterisk dynamic without making the whole select statement dynamic.
I need to use dynamic sql here, because state_id is unknown until run time. The variable, is_state, will either be 'AL' or 'CA'.
The code is in an event(powerscript). Using PowerBuilder 9.0.
getjbb
if state_id = 'AL' or is_state_id = 'CA' then
Select taxes, fees
Into :ld_pst_taxes, :ld_gst_fees
From state_charges p, state_charges g
Where upper(p.fee) ='JSS' and upper
(g.fee) ='MSS'
and p.fee_parm = :a_fee_parm
***********************************************
and p.state_id = :is_state and g.state_id = :is_state
************************************************
and p.corp_id = (select corp_id
from branch_lookup
where branch_id = somevariable)
and g.corp_id = (select corp_id
from branch_lookup
where branch_id = somevariable)
end if
I want to know if it is possible to make the section I have
surrounded by asterisk dynamic without making the whole select statement dynamic.
I need to use dynamic sql here, because state_id is unknown until run time. The variable, is_state, will either be 'AL' or 'CA'.
The code is in an event(powerscript). Using PowerBuilder 9.0.
getjbb