Dynamic Queries in reports 6i

Hi, I was wondering if its possible to build a dynamic query on reports 6i. on the report wizard I cant get a user parameter...
here is what im trying to do: I have a query where the fileds am retrieving are always the same, what its going to change is the where clause, it can be like betwwen 2 different dates ot it also could be a lot of ORs, like, Company_ID = 1 or Company_ID = 2 and such.
Thanks

yes, the thing is when I build the query on the report wizard it goes like this:
select field1,field3, field4 from Table
where p_clause
so I get an error, and the query cannot be build like that, it says ORA-00920 invalid relational operator Where p_clause ==>
So I thing my problem basically is how to build the query... any idea on how to do it? thanks
can you explain me how this After Parameter works a little bit more
Edited by: user10798811 on Mar 24, 2009 1:11 PM

Similar Messages

  • Dynamic queries in report builder 6i ( ref cursor query )

    Hi everyone,
    My requirement is that I want to create a report where the query is dynamic. The dynamic part will be known at runtime as it is being passed via a parameter. My query looks like this :
    select * from emp where sal :p1 :p2
    Possible values for :p1 are - '>', '<', '>=', '<=', '=', '!='
    Possible values for :p2 are - any value entered by the user
    I tried creating a query in report builder based on a ref cursor. But it does not allow me to create the query for the ref cursor dynamically. That means I have to hardcode the query in the program.
    I tried using place holder columns without success.
    Can someone please help me ?
    Regards,
    Al

    Hi,
    You can use lexical paramters in the sql query
    x - char - parameter
    select * from emp &x
    you need to pass the value for x in the parameter as
    'where sal < 1234'.
    Note : Lexical variable should be of char datatype.
    This is an alternative to the ref cursors.
    This works. Hope this is clear.

  • Dynamic queries best practice

    Hello,
    I want to create a report that the user can use radio buttons to refine. As an example, referring to the apex sample application's Products page, add radio buttons for [>] All prices [>] under $500.
    I think the technique demonstrated for building dynamic query reports (this is a 1.6 tutorial,link to it is here) is the way to do this, but I'm not sure this is the best approach.
    I'm wondering about any design disadvantage. I'd appreciate comment. Also, if there is a working example with source view in the public apex workspaces you are aware of, post a link if there's value beyond the tutorial I mentioned.
    Thank you.
    Albert

    I am using dynamic queries from time to time. Here is a working example:
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    You may have a look.
    Denes Kubicek

  • Applying a Template to a Dynamic PL/SQL Report

    I have an application in which there are several reports, all based on the wizard and using standard templates.
    One of my reports, however is a Dynamic PL/SQL Report, using htp.print statements to create the output.
    I'm not quite sure, how I can specify that I want to use the same template as the rest of my reports, so as to maintain the look and feel of the whole application.
    Can someone tell me how this is done, or where I can read about it?
    Thank you.

    Sergio,
    I have a table with two columns I want to display. The columns aren't wide but there are 15 or 20 rows. What I would like is that after 10 rows the report starts another set of colums beside the first ones. The standard report continues on down so you have to scroll down to see the bottom. I'm not sure if my explanation is clear so instead of:
    1 info1
    2 info2
    3 info3
    4 info4
    5 info5
    6 info6
    I want:
    1 info1 4 info4
    2 info2 5 info5
    3 info3 6 info6
    Not being too picky, it could also be:
    1 info1 2 info2
    3 info3 4 info4
    5 info5 6 info6
    I don't see a way of doing this with standard reporting so a PL/SQL report seems to be the way to go (which works fine except for the formatting). Sorry if I've just missed it in the options. I'd prefer to do it using standard HTMLDB
    Thanks.
    Paul

  • How to show the columns dynamically in OBIEE report based on the selection?

    Hi,
    I have a requirement where the columns should be dynamically shown in report based on what we select in propmt page.
    I'm creating a report in OBIEE where i want to give an option to the end user to select the columns whichever he wants to see in the report.
    For example I have the following columns in the report already:
    Customer Name,
    Customer Number,
    Bank Account,
    Address
    I want to give an option to the user to select 'Customer Mail ID' dynamically and see the column to be displyed in the report along with the existing columns.
    Through 'Column Selector' user can select a single column at a time, but if he want to select more than one column, how can we do this ?
    Please help me out in resolving this issue.
    Thanks,
    Chaithanya.

    Hi Chaithanya,
    there's not a straight solution for this. You can create different analysis containing different number of columns and then directing the user to this analysis using Action Links or you can also use View Selector to switch from one view (analysis) to the other. But it's not going to be very flexible nor dynamic.
    J.

  • Dynamic seleciton in report variant FBL1N

    Hi,
    Problem Description
    I am trying use dyanamic selection in report variant of FBL1N but its not working.
    My working
    I am using dyanamic date variant.
    In the selection screen of FBL1N, we have posting date in dynamic selections.
    While creating a variant for the selection screen of FBL1N, I am selecting Posting Date of dyanamic selection and choosing selection variant as "D" (D: Dynamic date calculation) along with Current Date as variable.
    However system is not accepting this and the current date is not coming up while choosing this variant.
    Solution required
    Can anyone please help me out with dyanamic date calculation in dates from dynamic selection in report FBL1N.
    Thanks,
    Nitish

    Dear
    You did not specify in which version you are working.  If you are in new GL instead of using FBL1N you can as well use T.Code S_AC0_52000888 and here you can make dynamic selections.
    Regds

  • Dynamic lenght in report heading

    Hi experts,
    I need to pass dynamic length in report heading.
    i.e.., REPORT zrep LINE-SIZE dyn_len NO STANDARD PAGE HEADING.
    So that my report output width will be in different length based on value dyn_len.
    Any solution or alternative in simple list display. Pls suggest ....
    Thanks in advance.
    Zak.

    Hello,
    Do not specify LINE SIZE in that case.
    Thanks,
    Jayant

  • Dynamic Sql In Report

    Hello
    Can i use dynamic sql in report builder , so as to allow user-defined reports .
    Thanx
    Shrikant

    read in the help system about lexical variables (these are variables with & at the begining).
    So you can define a query as select &P_1 where you get P_1 as a parameter.

  • How to create  some columns dynamically in the report designer depending upon the input selection

    Post Author: ekta
    CA Forum: Crystal Reports
    how  to create  some columns dynamically in the report designer depending upon the input selection 
    how  export  this dynamic  report in (pdf , xls,doc and rtf format)
    report format is as below:
    Element Codes
    1
    16
    14
    11
    19
    10
    2
    3
    Employee nos.
    Employee Name
    Normal
    RDO
    WC
    Breveavement
    LWOP
    Sick
    Carers leave
    AL
    O/T 1.5
    O/T 2.0
    Total Hours
    000004
    PHAN , Hanh Huynh
    68.40
    7.60
    76.00
    000010
    I , Jungue
    68.40
    7.60
    2.00
    5.00
    76.00
    000022
    GARFINKEL , Hersch
    66.30
    7.60
    2.10
    76.00
    In the above report first column and the last columns are fixed and the other columns are dynamic depending upon the input selection:
    if input selection is Normal and RDO then only 2 columns w'd be created and the other 2 fixed columns.
    Can anybody help me how do I design such report....
    Thanks

    Hi Developer life,
    According to your description that you want to dynamically increase and decrease the numbers of the columns in the table, right?
    As Jason A Long mentioned that we can use the matrix to do this and put the year field in the column group, amount fields(Numric  values) in the details,  add  an filter to filter the data base on this column group, but if
    the data in the DB not suitable to add to the matrix directly, you can use the unpivot function to turn the column name of year to a single row and then you can add it in the column group.
    If there are too many columns in the column group, it will fit the page size automatically and display the extra columns in the next page.
    Similar threads with details steps for your reference:
    https://social.technet.microsoft.com/Forums/en-US/339965a1-8cca-41d8-83ef-c2548050799a/ssrs-dataset-column-metadata-dynamic-update?forum=sqlreportings 
    If your still have any problem, please try to provide us more details information, such as the data structure in the DB and the table structure you are currently designing.
    Any question, please feel free to let me know.
    Best Regards
    Vicky Liu

  • How to spilt columns dynamically in the report based on Date Parameters

    Hi All,
    We have an XML Publisher report in which the parameters are Fom date and To date.
    User wants the data in the report to be split dynamically based on the months in the From date and To date interval.
    Eg. if the From date is 01-JAN-2013 and To date is '31-MAR-2013' then the report should show 3 columns JAN,FEB and MAR and the corresponding data.
    if the From date is 01-JAN-2013 and To date is '31-MAY-2013' then the report should show 5 columns JAN,FEB,MAR,APR and MAY and the corresponding data.
    Can anyone please advise, how can we spilt the months and data dynamically in the report.
    Regards,
    Shruti

    well you wanted the columns to be added dynamically.  the easiest way would be to use a Pivot since the columns are based on the values in the data.  and if the values of that column are Month Name/Abbreviation for that date then you will get month columns.
    Have you worked with Pivots before?

  • Dynamic queries in weblogic

    In case of dynamic queries, I found out that the finder method can not be defined
    in the Home class. I defined the finder
    method in the Bean.
    In my Bean, this is the code:
    public Collection findAllActivities(String filter, Object[] arguments) throws
    FinderException
         Properties myProp = new Properties();
         for(int i = 0; i < arguments.length; i++)
              myProp.setProperty(String.valueOf(i), String.valueOf((arguments)));
         try
              InitialContext ic = new InitialContext();                
              RolesHome rh = (RolesHome)ic.lookup("RolesHome");     
              QueryHome qh = (QueryHome)rh;
              String weblogicQL = "SELECT DISTINCT OBJECT(o) FROM roles AS o" + filter;
              Query query = qh.createQuery();
              return query.find(weblogicQL, myProp);
         catch (Exception e)
              e.printStackTrace();
              return null;
    I get a naming exception if I use :      RolesHome rh = (RolesHome)ic.lookup("RolesHome");
    javax.naming.NameNotFoundException: Unable to resolve 'RolesHome' Resolved: ''
    Unresolved:'RolesHome' ; remaining name
    'RolesHome'
    I get a casting exception if I use:      RolesHome rh = (RolesHome)ic.lookup("Roles");
    In my jsp file:
    I have this code
    InitialContext jndiContext = new InitialContext();
    Object obj = jndiContext.lookup("Roles");
    RolesHome rolesHome = (RolesHome) obj;
    list = (ArrayList) rolesHome.findAllActivities(filter, filterParams);          
    but the problem is that the home interface does not contain the findAllActivities
    function. I have already defined rolesHome
    earlier in the code which I want to use for findAllActivities also. I can not
    cast the bean e.g. RolesBean rolesBean = (
    RolesBean) rolesHome. I do not want to create a new bean as I am already using
    an old rolesHome. How do I solve this
    problem??? Please do let me know. I am really confused.
    Thanks
    Ronak Parekh

    This should be posted to the ejb newsgroups
    mbg
    "ronak" <[email protected]> wrote in message
    news:3e57faa9$[email protected]..
    >
    In case of dynamic queries, I found out that the finder method can not bedefined
    in the Home class. I defined the finder
    method in the Bean.
    In my Bean, this is the code:
    public Collection findAllActivities(String filter, Object[] arguments)throws
    FinderException
    Properties myProp = new Properties();
    for(int i = 0; i < arguments.length; i++)
    myProp.setProperty(String.valueOf(i), String.valueOf((arguments)));
    try
    InitialContext ic = new InitialContext();
    RolesHome rh = (RolesHome)ic.lookup("RolesHome");
    QueryHome qh = (QueryHome)rh;
    String weblogicQL = "SELECT DISTINCT OBJECT(o) FROM roles AS o" + filter;
    Query query = qh.createQuery();
    return query.find(weblogicQL, myProp);
    catch (Exception e)
    e.printStackTrace();
    return null;
    I get a naming exception if I use : RolesHome rh =
    (RolesHome)ic.lookup("RolesHome");
    >
    javax.naming.NameNotFoundException: Unable to resolve 'RolesHome'Resolved: ''
    Unresolved:'RolesHome' ; remaining name
    'RolesHome'
    I get a casting exception if I use: RolesHome rh =(RolesHome)ic.lookup("Roles");
    >
    >
    In my jsp file:
    I have this code
    InitialContext jndiContext = new InitialContext();
    Object obj = jndiContext.lookup("Roles");
    RolesHome rolesHome = (RolesHome) obj;
    list = (ArrayList) rolesHome.findAllActivities(filter, filterParams);
    but the problem is that the home interface does not contain thefindAllActivities
    function. I have already defined rolesHome
    earlier in the code which I want to use for findAllActivities also. I cannot
    cast the bean e.g. RolesBean rolesBean = (
    RolesBean) rolesHome. I do not want to create a new bean as I am alreadyusing
    an old rolesHome. How do I solve this
    problem??? Please do let me know. I am really confused.
    Thanks
    Ronak Parekh

  • Change image size dynamically in BIP report

    Can we change the size of image dynamically in bip report. If yes can I get some doccument or samples on it.
    Thanks
    Aj

    I am doing small POC
    I have a rtf template with three sample images on it with three different sizes for 1” by 1” , 3” by 3” and 5” by 5”.
    I have a standard size of 2” by 2” image in my server (Could change size in future depending on req)
    Now when I run the report the template should call the standard image from server and replace the sample images on the rtf and show the the standard image in three different sizes.
    Pls let me know if i am missing something

  • Adding the columns dynamically in crystal report

    Hi,
      I am developing a application using asp.net and crystal report. In a report the column is created dynamically( ie, the report gets input from a sp which returns N no. of columns). Since i dont know the column name and no. of columns at design time i am not able to create the report. If any of you have any idea on adding the columns dynamically please send me the code or the link.
    Thanks
    Sankar

    Hello Sankar,
    please see CS code for VS 2005 below to add a database field to a report using inproc RAS.
    This sampels retrieves the table column name from the database and adds it to the report.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using CrystalDecisions.CrystalReports.Engine;
    using CrystalDecisions.ReportAppServer.Controllers;
    using CrystalDecisions.ReportAppServer.ClientDoc;
    using CrystalDecisions.ReportAppServer.DataDefModel;
    namespace CS_Add_Field_inproc
        public partial class Form1 : Form
            // CR Declarations
            ReportDocument boReportDocument;
            ISCDReportClientDocument boReportClientDocument;
            CrystalDecisions.ReportAppServer.ReportDefModel.Section boSection;
            CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject boFieldObject;
            public Form1()
                InitializeComponent();
                //Create a new ReportDocument
                boReportDocument = new ReportDocument();
                // load the RPT file
                boReportDocument.Load("..
    AddField.rpt");
                //Access the ReportClientDocument in the ReportDocument (EROM bridge)
                boReportClientDocument = boReportDocument.ReportClientDocument;
                //Get the first section in the details section
                   boSection = boReportClientDocument.ReportDefController.ReportDefinition.DetailArea.Sections[0];
                   //Create the field object that we will add to the report and set all of its properties
                   boFieldObject = new CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject();
                //Set which field to use for the data to be displayed
                   boFieldObject.DataSourceName = "{Customer.City}";
                   boFieldObject.FieldValueType = CrystalDecisions.ReportAppServer.DataDefModel.CrFieldValueTypeEnum.crFieldValueTypeStringField;
                   boFieldObject.Left = 4 * 1440; //1440 twips per inch
                   boFieldObject.Width = 3 * 1440;
                   boFieldObject.FontColor = new CrystalDecisions.ReportAppServer.ReportDefModel.FontColor();
                   boFieldObject.FontColor.Font.Name = "Arial";
                   boFieldObject.FontColor.Font.Size = 10;
                   boFieldObject.Format.HorizontalAlignment = CrystalDecisions.ReportAppServer.ReportDefModel.CrAlignmentEnum.crAlignmentLeft;
                   //Add the object to the report
                   boReportClientDocument.ReportDefController.ReportObjectController.Add(boFieldObject, boSection, -1);
                // show in reportviewer
                crystalReportViewer1.ReportSource = boReportDocument;
            private void button1_Click(object sender, EventArgs e)
                //Get the first section in the details section
                boSection = boReportClientDocument.ReportDefController.ReportDefinition.DetailArea.Sections[0];
                //Create the field object that we will add to the report and set all of its properties
                boFieldObject = new CrystalDecisions.ReportAppServer.ReportDefModel.FieldObject();
                //Set which field to use for the data to be displayed
                boFieldObject.DataSourceName = "{Customer.City}";
                boFieldObject.FieldValueType = CrystalDecisions.ReportAppServer.DataDefModel.CrFieldValueTypeEnum.crFieldValueTypeStringField;
                boFieldObject.Left = 4 * 1440; //1440 twips per inch
                boFieldObject.Width = 3 * 1440;
                boFieldObject.FontColor = new CrystalDecisions.ReportAppServer.ReportDefModel.FontColor();
                boFieldObject.FontColor.Font.Name = "Arial";
                boFieldObject.FontColor.Font.Size = 10;
                boFieldObject.Format.HorizontalAlignment = CrystalDecisions.ReportAppServer.ReportDefModel.CrAlignmentEnum.crAlignmentLeft;
                //Add the object to the report
                boReportClientDocument.ReportDefController.ReportObjectController.Add(boFieldObject, boSection, -1);
                // show in reportviewer
                crystalReportViewer1.ReportSource = boReportDocument;

  • Simple Queries on Reports

    Hi, I have some simple queries on reports, which are following. Any help is appreciated!!
    Q1. Where does following information go ??
    a. The heading that I want to print on only the first page of the Report, like Report Name,
    Company name, should go to Margin or Header or Body ?
    b. Where does the page numbers go ?
    c. Field titles/labels, that should print on the beginning of every page of the report
    Q2. How can I restrict the printing of a cloumn to once, when a same value is repeating more than once.
    This is the first column of the report, so if it's value is same in the next rows, i need to print it only once.
    Should I use format trigger or that can be simply done my setting some properties ? If format trigger,
    then how ?
    Q3. Is it possible that I have two parameters in my Parameter Form and after accepting first parameter
    value I show the the list of second parameters on the basis of first value choosen by the user ?
    e.g. If somebody chooses dept# 10, and then second field displays all the employees of dept# 10.
    Q4. Im my report, I want always a last page that is dipalying data from altogether different query which is no
    way related to my other main query. This is query is pretty simple and I just want to display the
    data always on the last page of the report. How would I handle the layout of this page ??
    Thanks!!
    Shalu

    Hi Shalu,
    Q1-
    a)If you want to Print heading on the First Page ONLY then it sholud be
    in MAIN SECTION/BODY olny.(Fields Property- Print OBject On- Should be
    First Page).
    b)Bottom-Right of the MARGIN Section.
    c)if Report Heading is in Main Section then in the layouts Main Frame,
    inside that you can keep (Field titles/labels).
    Q2- Go to Report Wizard try these two Report Style(Group Above and Group Left)
    i think this will solve your Problem...
    Q3- I thinnnnnnnk this is not possible.
    Q4- You can use Trailer Section of the Report.
    Regards,
    Ravi

  • Data series / dynamic queries

    Hi,
    I've got the following problem:
    I want to create a stacked bar chart based on dynamic queries. The query I use for the first series is:
    select null link, kw label, sum (volume) value from testview
    where id = to_number(:P18_ID)
    group by kw
    order by kw
    P18_ID is an input field.
    The query works fine and the chart is also ok.
    But if I use this same query for a second series I get an empty svg canvas as result. Even worse: no matter what kind of query I use for the second series I never get a result unless I take the variable P18_ID away from the first query.
    For info: the view testview is based on a table created by a pl/sql function (using pipelined output).
    Any ideas. I really would appreciate a quick answer very much because this is part of a project and we are running out of time because of this error.
    Thanks.

    Hi Andy,
    first of all: thank you very much for your efforts.
    I've tried something like you said before and yes, it works (at least most of the times). The problem is I want to have the option 'show all'. That's why I can't use a' where' clause (because I can't work with 'like ...%' for it would sometimes give wrong results because of ids with the same prefix -> or am I wrong?)
    What I mean is:
    where id like '1'% -> results for item 1 (and 10,11,12,...)
    where id like ' '% -> results for all items
    That's why I want to use a pl/sql function. The function is tested and works fine. But if I try to call it form ApEx it works only if use constants instead of variables or if I have only one series.
    Is there something like a time limit? Like ApEx stops processing if the database isn't answering as fast as expected (because a function is slower than querying a table). I don't really think that could be the answer because it's very little data and I'm using a pipelined function... but perhaps...

Maybe you are looking for

  • Already Converted 10 of my family members over to AT&T for Nokia Lumia 900!!!

    Verizon, You decided to drag you feet, promote the crap out of Android and stop supporting Windows Phone 7. So I converted 10 of my family members over yesterday to AT&T for the Nokia Lumia 900. I got them $100 credit towards the Nokia Lumia 900 whic

  • Link to a file not working

    Hi, I'll try to be clear, but it ain't gonna be easy! I am planning putting a portfolio of illustrations on the web. When a visitor clicks on an image thumbnail, it will open a larger version of the image in the same window-I was even able to create

  • Maximum Image size for 21mp Canon Camera

    HI, I need advice and help please.  Can anyone tell me how big I can get my 21mp photos to go. I have a Canon 5D Mark II and am using a 16-35mm Pano lens. I also need to know how to work with these photos to get them to maximum size. I haver Cs3, Any

  • ? About converting a 2-disc movie ...

    Ok, so I have finally been able to convert movies to a format acceptable to use with my little 5th Gen Video iPod. Now, I have another question though. How do you convert a single movie that is on 2 discs so that it is one continuous movie and isn't

  • Need documentation for Oracle VM

    I am new to Oracle VM and need documentation on this product. Any help would be appreciated. Where can I get started learning (and using) Oracle VM (on OEL)? Cheers!