DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Report query subsuition

  1. #1
    Join Date
    Aug 2001
    Posts
    35

    Report query subsuition

    Right now i am developing a report,in which a user can
    choose groupby on a certain coulmn(so the user
    parameters will be Group number or Cycle Number or
    Account TYpe).

    I am quering from only one table,ra_customers.

    so my query will be


    select :x_by,sum(....columns)
    from ra_customers
    where (all the conditions)
    :x_recgrp;


    In the after parameter trigger,


    if :x_groupby = 'Group Number' then
    :x_by :='ra_customer.attribute14';
    :x_recgrp := 'group by attribute14';

    elsif :x_groupby = 'Cycle Number' then
    :x_by :='ra_customer.attribute10';
    :x_recgrp := 'group by attribute10';

    elsif :x_groupby = 'Group Number' then
    :x_by :='ra_customer.attribute11';
    :x_recgrp := 'group by attribute11';

    endif;

    Let us assume that one is grouping by 'Group
    Number'then the result is displayed as.

    ra_customer.attribute14 13 15
    ra_customer.attribute14 10000 30000
    ra_customer.attribute14 4000 7000


    Instead of the acutal row value,since i used the
    string value in after parameter trigger,it is
    displaying coulmn header title.any solution to
    this,.Is it possible to use decode in the select statement.

  2. #2
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    You need to use dynamic sql to do this - 'execute immediate' or DBMS_SQL woulddo the job.
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width