Skip to Main Content

Oracle Forms

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Block based on "From clause query" and substitution variable

TomeoOct 17 2007 — edited Oct 19 2007

Hi Folks,

I have a "From clause query" block type, which is based on query that uses a substitution variable (:BLOCK.COLUMN) from previous block. When I run a query, then I obtain an error: ORA-01008: not all variables bound.

My query looks like:

 select seq_no, prod_code, descr, curr_code,
       max(decode(sched_type_code,'ROLLOVER',amt,0)) OUTSTD_DRAW,
       max(decode(sched_type_code,'INTCHG',amt,decode(sched_type_code,'FEEREC',amt,0))) OUTSTD_INTEREST_FEE
 from
(
    select r.fac_no, r.prod_code, f.descr, r.prod_seq_no seq_no, r.curr_code, r.sched_type_code,sum(nvl(rep_amt,0)) amt 
      from repay_scheds r, 
           fac_prods f
     where r.fac_no = f.fac_no
       and r.prod_code = f.prd_code
       and r.prod_seq_no = f.seq_no
       and r.fac_no = :B2.FAC_NO
       and r.trans_ref_from is not null
       and r.status         <> 'P'
    group by r.fac_no, r.prod_code, f.descr, r.prod_seq_no, r.curr_code, r.sched_type_code  
)
group by seq_no, prod_code, descr, curr_code
having max(decode(sched_type_code,'ROLLOVER',amt,0)) >0 or max(decode(sched_type_code,'INTCHG',amt,decode(sched_type_code,'FEEREC',amt,0))) > 0

Once I replace that substitution variable in query condition with some exact test number then it works fine.

select seq_no, prod_code, descr, curr_code,
       max(decode(sched_type_code,'ROLLOVER',amt,0)) OUTSTD_DRAW,
       max(decode(sched_type_code,'INTCHG',amt,decode(sched_type_code,'FEEREC',amt,0))) OUTSTD_INTEREST_FEE
 from
(
    select r.fac_no, r.prod_code, f.descr, r.prod_seq_no seq_no, r.curr_code, r.sched_type_code,sum(nvl(rep_amt,0)) amt 
      from repay_scheds r, 
           fac_prods f
     where r.fac_no = f.fac_no
       and r.prod_code = f.prd_code
       and r.prod_seq_no = f.seq_no
       and r.fac_no = 2012500
       and r.trans_ref_from is not null
       and r.status         <> 'P'
    group by r.fac_no, r.prod_code, f.descr, r.prod_seq_no, r.curr_code, r.sched_type_code  
)
group by seq_no, prod_code, descr, curr_code
having max(decode(sched_type_code,'ROLLOVER',amt,0)) >0 or max(decode(sched_type_code,'INTCHG',amt,decode(sched_type_code,'FEEREC',amt,0))) > 0

How can I use substitution variable within query for "From clause query" block type? Or any other way how to get the same result?

Thanks for your reply.

Tomas

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 16 2007
Added on Oct 17 2007
6 comments
8,675 views