SQL Query Report (Customize link)

I have an SQL query report with bind variables so that users can choose conditions for the query. If I don't have any conditions, the report is empty. How do I get it to display all the records. I tried typing * but it didn't work.
Basically I want it to act like the Query Wizard's Customize feature. The report give me all the records. I can query one field or all the fields.
In the SQL report's Customize feature, I have to enter a value for all the bind variables I have. What if I just want to query one field. What do I put in the others to indicate that I want all. I hope this makes some sort of sense and that someone out there knows what I'm blabbing about.

Hi,
I h've same type of requirement in most of my reports in the application and I h've solved this in the sql of the report itself. Let's see a example report from the table scott.emp with a sql like
Select EMPNO,
ENAME,
JOB,
MGR,
HIREDATE,
SAL,
DEPTNO
From scott.emp
Where EMPNO = nvl(:v_empno,EMPNO)
and DEPTNO = nvl(:v_deptno,DEPTNO)
where :v_empno and :v_deptno are bind variables to this report and if there is no arguements passed to these arguements all the records will be retrieved from the table ..likeley if value for any one of these arguements is passed then this sql will return only those records which meet that condition.
Hope this helps
-Krishnamurthy

Similar Messages

  • SQL Query Report Very slow

    Hi I have a sql query report that is taking very long to render.The query on sql developer comes back in less than a second.Any ideas on what could be wrong?

    Hi
    When posting code on the forum, put {noformat}{noformat} (with the curly brackets and the word code in lowercase) above and below your code like this...
    {noformat}{noformat}
    SELECT *
    FROM emp
    {noformat}{noformat}
    It will then appear like this, preserving formatting...SELECT *
    FROM emp
    Next, how many rows are returned in total, it may be that you have SQL Developer set up to fetch only the first x number of rows?
    Why have you put a CHOOSE hint in there?
    Is it a classic report or an interactive report?
    It looks like you're going over a database link, you really need to provide an explain plan (formatted as I have detailed above), a DRIVING_SITE hint may help you but it's impossible to know without seeing the plan...
    Cheers
    Ben                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • SQL Query report region that only queries on first load

    Hello all,
    Is there any way in which you can prevent a SQL Query report region from quering data after every refresh?
    I would like to make a report that queries on the first load, but then I would like to change the individual values, and reload to show the change, but every time I reload the page the columns are queried and the original values are displayed once again...
    any ideas?
    -Mux

    Chet,
    I created a header process to create the HTMLDB_COLLECTION. It is something like:
    HTMLDB_COLLECTION.CREATE_COLLECTION_FROM_QUERY(
    p_collection_name => 'Course_Data',
    p_query => 'SELECT DISTINCT COURSE_ID, HTMLDB_ITEM.CHECKBOX(14,COURSE_ID) as "checker", TITLE, SUBJECT, COURSE_NUMB, SECTION, ENROLLED, null as "temp_term", null as "temp_title", null as "temp_crse_id", null as "temp_subj", null as "temp_crse_numb", null as "temp_sect", FROM DB_TBL_A, DB_TBL_B, DB_TBL_C, DB_TBL_D, DB_TBL_E, DB_TBL_F WHERE ...');
    The names were changed, for obvious reasons.
    I then created an SQL Report Region to see if it would work. The SQL is:
    SELECT c001, c002, c003
    FROM htmldb_collections
    WHERE collection_name = 'COURSE_DATA'
    When I run the page it says:
    ORA-20104: create_collection_from_query Error:ORA-20104: create_collection_from_query ExecErr:ORA-01008: not all variables bound
    Any idea why this is happening?
    I'm new to HTMLDB_COLLECTIONS, so I may be doing something wrong
    -Mux

  • Setting a Default Value in SQL Query Report

    Hello:
    We are using a SQL Query Report to provide a mass update to a table. We are using the apex.collection and having it display a number of records in a SQL Query Report for mass update. We have 14 columns in the report, for which the first 11 are populated via the collection. The remaining 3 are open for input but the individual making the updates. We've were able to provide a default value for 2 of the remaining 3 columns using a named LOV's - however the fourth column we would like to default a sysdate - but we are not successful.
    We've attempted many things but none seem to work, including adding that column to the collection and assigning it a default sysdate value. We've also tried changing the settings in the report attributes --> Tabular Form Elements by setting the Display as to: Datepicker, Default type to PL/SQL Expression and setting the default to sysdate. We've also tried caputuring a date on the previous page and loading it onto the report page and trying to default the date column to a page item default.
    I'd appreciate any help.
    Thanks
    FYI - we are using version 3.2

    use as default
    to_char(sysdate, 'dd/mm/yyy') where the format is your application or item date format

  • How do you select a clob column in an SQL query report?

    I must be missing something fundamental as there is practically no help on this on the forum.
    All I want to do is ...
    select numcol,aclob_col from table
    in an SQL Query report.
    Sounds easy??? I get no data appearing in the clob column. Doesn't work in SQL Workshop either. What's the catch??
    regards
    Paul P

    Paul,
    It works when I try it. What version of Application Express, what is the table DDL, the exact query, and how much data is in the clob columns?
    Scott

  • Apex - SQL query report.

    Hi,
    Apex - 4.0 and Oracle -11g
    I m having a SQL Query report.
    Query
    SELECT htmldb_item.hidden(1,id) id,
      htmldb_item.select_list_from_query_xl(2,name,'SELECT name ,                                                              
    deptid                                                     
    FROM  emp                                                     
    WHERE name like ''E%''') name,
      htmldb_item.select_list_from_query_xl(3,deptname,'SELECT  deptname from dept where deptid =   ???') deptname
    FROM tabel
    My problem, in the report when the Select list for 'name' has been choosen , then it should retrieve the deptname based on the 'name'.
    Is it possible ?

    you want  select list value should affected in SQL report? i mean redirect and set value to SQL report?

  • Fail to create SQL query report because of ORA-00923

    Hi expert,
    I would like to SQL query report using the following query:
    select min(identified_date) first_identified,
    max(actual_COMPLETE) last_closed,
    count(id) total_issues,
    sum(decode(status,'Open',1,0)) open_issues,
    sum(decode(status,'Pending',1,0)) pending_issues,
    sum(decode(status,'Resolved',1,0)) closed_issues,
    sum(decode(status,'Will Not Resolve',1,0)) not_resolve_issues,
    sum(decode(status,
    'Open',decode(priority,null,1,0),
    0)) open_no_prior,
    sum(decode(status,
    'Open',decode(priority,1,1,0),
    0)) open_prior_1,
    sum(decode(status,
    'Open',decode(priority,'2',1,0),
    0)) open_prior_2
    sum(decode(status,
    'Open',decode(priority,3,1,0),
    0)) open_prior_3,
    sum(decode(status,
    'Open',decode(priority,'4',1,0),
    0)) open_prior_4,
    sum(decode(status,
    'Open',decode(priority,5,1,0),
    0)) open_prior_5
    from SOFTPROJ_issues
    where project_id = :P83_PROJECT
    However, I got the following error during the steps of creation:
    1 error has occurred
    Query cannot be parsed, please check the syntax of your query. (ORA-00923: FROM¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿)
    I wonder why if it is getting the error because I could create the report with the following query without problems:
    select min(identified_date) first_identified,
    max(actual_COMPLETE) last_closed,
    count(id) total_issues,
    sum(decode(status,'Open',1,0)) open_issues,
    sum(decode(status,'Pending',1,0)) pending_issues,
    sum(decode(status,'Resolved',1,0)) closed_issues,
    sum(decode(status,'Will Not Resolve',1,0)) not_resolve_issues,
    sum(decode(status,
    'Open',decode(priority,null,1,0),
    0)) open_no_prior,
    sum(decode(status,
    'Open',decode(priority,1,1,0),
    0)) open_prior_1,
    sum(decode(status,
    'Open',decode(priority,3,1,0),
    0)) open_prior_3,
    sum(decode(status,
    'Open',decode(priority,5,1,0),
    0)) open_prior_5
    from SOFTPROJ_issues
    where project_id = :P83_PROJECT
    1 error has occurred
    Query cannot be parsed, please check the syntax of your query. (ORA-00923: FROM¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿)
    The difference is to add the followings only:
    sum(decode(status,
    'Open',decode(priority,'2',1,0),
    0)) open_prior_2
    sum(decode(status,
    'Open',decode(priority,'4',1,0),
    0)) open_prior_4,
    Does anyone have any idea to resolve the issue?
    Thanks in advance,
    Rui

    By putting a comma after open_prior_2:
    sum(decode(status,
    'Open',decode(priority,'2',1,0),
    0)) open_prior_2,Sima

  • Dynamic Link in SQL Query Report

    Andy,
    I refromatted the message since it was all garbled, I didn't realize it came out like that the first time.
    1) I am not sure what you meant by the "#" in your message until I did the substitution of #'s for < > I didn't have that in my URL.
    2) Since the whole statement is enclosed in single quotes to be inside of a decode statement I think this is an issue with the javascript and it's double quotes or is it?
    3) I took care of the passing values for items, even if I can just get the link to work some what I would be happy I can worry abou those values later..
    Hello I have a a link that is generated in a report
    sql based on an SQL query and I would like to turn it
    into a popup instead of a direct link. But I seem to
    be having some problems going from a link to a popup
    link...
    <b> I replaced the brackets < > with "#" </b>
    This statement works;
    SELECT decode(create_date, NULL, NULL, '#a
    href="f?p=&APP_ID.:71:&SESSION.::NO:100:P71_EQUIPMENT_
    ID,P71_CONTAINER_TYPE_ID:' || equipment_id || ',' ||
    container_type_id || '"/#' || create_date ||'#/#>' )
    AS "HIST_NOTE",
    </br>
    </br>
    but I would like to turn make it a popup instead of a
    direct link, I think the problem has something to do
    with the parenthesis (double and single mixed) any
    ideas?
    </br>
    </br>
    I tried doubling them up (using three single ticks
    for double parens inside of single ticks and
    everything
    </br>
    </br>
    <b> I replaced the brackets < > with "#" </b>
    decode(create_date,
    NULL,
    NULL,
    '#a href="javascript:popupPage('f?p=&APP_ID.:71:&SESSION.::NO:100:P71_EQUIPMENT_ID,P71_CONTAINER_TYPE_ID:' || equipment_id || ',' || container_type_id || '"/#' || create_date ||'#/a#')" ' AS "HIST_NOTE",
    </br>
    </br>
    Any ideas?
    The error I usually get mostly complains about "ORA-00907: missing right parenthesis"....
    I put an example up on apex.oracle.com if you want to debug it there (it of course does not work right now)
    http://apex.oracle.com/pls/otn/f?p=18490:5
    guest/apex123
    Thanks
    Justin
    Message was edited by:
    Justin P

    Denes,
    I was able to get it working based on one of your examples, it gets ugly when you embed the popup javascript into the link as you know. You have some really great examples, I hadn't been to your page in awhile.
    Here is my end result (this is embedded in a decode statement so single ticks would go around the entire example below)
    &lt;a href="javascript:popUp2('''
    || 'f?p=&APP_ID.:71:&SESSION.::NO:100:'
    || 'P71_EQUIPMENT_ID,P71_CONTAINER_TYPE_ID:'
    || equipment_id || ',' || '&F110_CONTAINER_TYPE_IP.'
    || ''', 900, 600);">'
    || create_date
    || '&lt;/a>
    Thanks to all that helped me out here,
    Justin

  • Showing column value as counter in sql query - report

    I created a classic report with search bar based on an sql query. I would like to show the "notes" column in this query using some sort of counter and as a hyperlink to another section on the page (same idea as footnotes in a book). So if I have 10 rows and 5 have "notes". I should show 1,2,3,4,5 in the notes column for those rows and the number gets displayed as a link to another section listing the notes 1 through 5.
    I was thinking of creating a hidden page item as the counter with value of 0 and then in my query doing counter+1 but i'm not sure how to do this or if i can do that...
    If anyone can help or have any other ideas I would really appreciate it!!
    Thanks,
    Hindy

    Well, I'm doing this in VB and the subquery is dynamic. I'm passing an ADO recordset to a routine that sets up a listview to display the results. The number of columns selected can vary. My idea was to size the columns appropriately based on the size of the data. Within the display routine I could:
    sql = "SELECT "
    for i = 0 to oRS.Fields.Count - 1
    sql = sql & "MAX(LENGTH(" & i & ")), "
    next 'i
    sql = sql & "FROM (" & oRS.Source & ")"

  • ORA-06502 on  'SQL query' report with sort in 'Report Attributes'

    Hi All,
    We get the next error if we set sorting on a column in a 'Report' based on a 'SQL query'. Removing the sort, error disappeares:
    failed to parse SQL query:
    ORA-06502: PL/SQL: numeric or value error: NULL index table key value
    Any suggestions?
    Erik

    Erik,
    Thanks, this explains it. By specifying the request as part of your URL you run into the recently uncovered issue. The request you're setting is REMFROMLIST and ADD2LIST. You probably either have links that include those requests or you have branches where you specify them. Either way, in order to get reports sorting to work, you'll have to make sure that the request strings are not part of your URL. This is a work-around and the upcoming HTML DB patch release will solve this issue.
    One way of avoiding this is to have computations on the previous pages that set a napplication level or page level item to the REMFROMLIST and ADD2LIST values and then you can use those items for your conditions that are currently evaluating those strings.
    Hope this helps and sorry for the inconvenience,
    Marc

  • Displaying a radio group in SQL QUERY report region

    Good morning everyone,
    I have a report in which a column - ORDER STATUS, will come in with a value of 1, 2 or 3...being order unfilled, order partially filled, or order filled, respectively.
    I would like to display the order status as a radio group on the report so that it will be easy to run down the column of radio buttons to see what is filled, etc.
    I've gone to the manual and checked the doco on HTMLDB_ITEM.RADIOGROUP. But the example given there is actually for CHECKBOX (is this an error?!?).
    I went to the forums and found nothing suitable.
    My region is an SQL QUERY. Can I display the STATUS as a radio group in the SELECT ?
    This is the question.
    Thankyou in anticipation. TC. 23/11/2004

    Tony,
    There may be better solutions, but here's what I was thinking:    create table orders (id number, status number, customer varchar(30))
        insert into orders (id,status,customer) values(1,1,'ACME')
        insert into orders (id,status,customer) values(2,2,'BENSON')
        insert into orders (id,status,customer) values(3,3,'CLARKE')
        commit
        Query Source
        select
          id "ORDER NUMBER",
          decode(status,
            1,htmldb_item.RADIOGROUP(1,status,'1','unfilled')||htmldb_item.RADIOGROUP(2,status,'2','partial','"disabled=true"')||htmldb_item.RADIOGROUP(3,status,'3','filled','"disabled=true"'),
            2,htmldb_item.RADIOGROUP(1,status,'1','unfilled','"disabled=true"')||htmldb_item.RADIOGROUP(2,status,'2','partial')||htmldb_item.RADIOGROUP(3,status,'3','filled','"disabled=true"'),
            3,htmldb_item.RADIOGROUP(1,status,'1','unfilled','"disabled=true"')||htmldb_item.RADIOGROUP(2,status,'2','partial','"disabled=true"')||htmldb_item.RADIOGROUP(3,status,'3','filled'))
          "STATUS",
          customer "Customer Name"
        from orders;Scott

  • SQL Query (report region) without full page reset

    Hello,
    I have a page with several items, some of them with default values, and a report region, performing SQL query based on one of the items – text field (always submits page when Enter pressed). When the page submits, the HTML DB engine performs and display the query, but at the same time, reset the other page items to their default values.
    Is it possible to run the query without the HTML DB reset the item values to their default state?
    Thanks,
    Arie.

    Hi Peter,
    Well, this is not exactly the case. I have an Item – File Browse – which defined as "Only when current value in session state is null", and a HTML text region, which contain Iframe, with default src tag (which I'm changing, using JavaScript, prior to the running of the SQL query). After running the query – in a report region – both the item and the Iframe reset to their original state.
    Any Ideas on how to prevent that?
    Thanks,
    Arie.

  • SQL Query Report Not working

    Hi,
    I have a region as the type
    "SQL Query (PL/SQL function body returning SQL query)".
    The query works fine for reports if I query two columns. Select 1, 2 from table.
    For some reason if the returning query has more than three columns (select 1, 2, 3 from table), I get an error:
    "report error:
    ORA-01403: no data found"
    Any help would be great. Thanks.

    Hi,
    I've been trying all sorts of things on a test report and the only way that I get extra columns is by including derived columns in the report. Otherwise, even with custom headings, adding or removing columns in the report's PL/SQL adjusts the columns as I would expect.
    Are your extra columns derived or can your report return a varying number of columns?
    Andy

  • Column Headings on PL/SQL returning SQL Query report- using br

    Hi,
    I would like to create a report region based upon a function returning a SQL query. As a dem oI have created the following:
    create or replace function xxjk_retsql return varchar2
    as
    begin
    return 'select i "column header" from wwv_flow_dual100';
    end;I want to be able to insert a line break in the column header so it wraps over two lines. I tried this:
    create or replace function xxjk_retsql return varchar2
    as
    begin
    return 'select i "column<br>header" from wwv_flow_dual100';
    end;however when the region is rendered, it appears to strip out the HTML tag. I also tried another tag, <i></i>, as a test and this is stripped out also.
    Is there a way to include a break in a column header in this manner?
    Thank-you,

    There is an option Strip HTML and it is turned on by default. Try changing that to see what happes.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------

  • Using Package to produce pl/sql function body returning sql query Report

    I have existing code that we want to use in building reports in APEX. We are needing to modify it slightly to handle some new requirements, but would like to use them in reports based upon SQL query (pl/sql function body returning sql query) functionality.
    Any suggestions as how to call these in an APEX report region?
    Thank you,
    Tony Miller
    UTMB/EHN

    Hi Tony-
    I am also v new to Apex and you may have answered a question I was in search of. I, however, now have a couple more. First a bit of background-- Like in your situation, my college has a lot of existing code (400 +) that we need to get into Apex. The majority of this canned code contains one/both: 1) many lines, sometimes containing multiple select statements 2) imbedded create table & view statements (temp user owned). Up until reading your post, I was unable to figure out an easy way of getting this existing code into the product. Thanks. Now the questions, do you know how I would go about dealing with the create tables/views. I've read some posts on this forum which suggest temporary tables being unstable in this environment. Also, do you know if there's a size limitation when passing sql code via a function?
    As you may/may not be able to tell, I'm a bit lost right now... so any info you can provide would be appreciated. Thanks.
    Don

Maybe you are looking for

  • Boot Camp/Windows XP crashes when trying to play games

    I'm at a complete loss. I've installed Windows XP with Boot Camp and everything starts up fine. All I want to use XP for is some light gameing. I've done this a few times with with different games. I get the same problem every time. At some point whi

  • Connectivity issue in RAC(exadata)

    Team, oracle version : 11gr2 2 node rac exadata x2-2 Application team is complaining the connectivity issue and they are telling we get connection after 5 to 8 hits on the application application logfile errors are below SQL Error: 17002, SQLState: 0

  • Sony rdp-xf100ip error message

    I recently purchased your sony rdp-xf100ip iphone dock and radio and really like it. I'm concerned now after reading a lot of negative reviews about people having an error messages and the unit turns off and doesn't work again. Just keeps getting err

  • Content Pane

    I do not think that a window could have more than one content pane, so how could I use borderlayout for a toolbar and have a button use a different layout. In other words I do no want my button to have to be either south, west, or east because my too

  • Datapump export in sql developer

    Getting issue while exporting  using data pump: Error on Job Submit ORA-39002: invalid operation dbms_datapump.get_status(14...) ORA-39002: invalid operation ORA-39070: Unable to open the log file. ORA-29283: invalid file operation ORA-06512: at "SYS