Using bind variables in user defined reports

How do I go about using a bind variable in a user defined report?
Here's a trivial example in SQL*Plus:
var ublocksize number
begin
select value into :ublocksize
from v$parameter
where name = 'db_block_size';
end;
select :ublocksize from dual;
This code does not work in raptor.
The error displayed is:
Missing IN or OUT parameter at index:: 1
Vendor code 17041
any ideas?

You also have a second issue of supporting the following syntax in SQL scripts:
var ublocksize number
begin
select value into :ublocksize
from v$parameter
where name = 'db_block_size';
end;
We are itterating to support all SQL plus commands
Mike

Similar Messages

  • Bind variables in User Defined Reports

    SQL Developer 1.0.0.11 / Windows XP / Oracle 9.2.0.5
    Thanks for adding the capability for bind variables in user defined reports. However, if there is more than one instance of the same bind variable in the report, the "Enter Bind Values" prompt lists all instances and requires the value be input for all instances. This is unlike the SQL worksheet which only lists the bind variable once. Please change the report behavior to prompt only once per unique bind variable.

    Just spoke with the developer of this - you will be prompted for each instance of a bind. That will not change any time soon so I wanted to let you know -
    -- Sharon

  • Using Bind variables in SQL PLUS Report

    using Bind variables in SQL PLUS Report. This report gets the arguments from the application concurrent program. Now my need is to convert the start_date and end_date to bind Variables to improve the performance. I have commented the original code in 'prompt List of Unapproved Adjustments' and used my Bind Variable but it is giving an error
    error: Bind Variable "ENDING_DATE" not declared
    Report Date and Time:
    26-OCT-2010 15:44:13
    List of Unapproved Adjustments
    Bind Variable 'ENDING_DATE" not declared
    Please see below the code for the sql plus report:
    define p_org_id           = '&1'
    define p_fy_begin_date = '&2'
    define p_start_date = '&3'
    define p_end_date = '&4'
    define p_conversion = '&5'
    declare
    variable begin_date date;
    exec :begin_date := p_start_date;
    variable ending_date date;
    exec :ending_date := p_end_date;
    /* Begin
    :begin_date := to_date('&p_start_date','YYYY/MM/DD HH24:MI:SS');
    :ending_date := to_date('&p_end_date','YYYY/MM/DD HH24:MI:SS');
    End; */
    set newpage none
    set termout off
    set pagesize 55
    set linesize 180
    set heading on
    set feedback off
    set wrap off
    set space 1
    set heading on
    begin
    dbms_application_info.set_client_info('&p_org_id');
    end;
    prompt
    prompt Report Date and Time:
    prompt ----------------------
    select to_char(sysdate,'DD-MON-YYYY HH24:MI:SS')
    from dual ;
    prompt
    prompt List of Unapproved Adjustments
    prompt -------------------------------
    select b.trx_number,
    a.adjustment_number,
    f.user_name created_by
    from apps.ar_adjustments a,
    apps.ra_customer_trx b,
    apps.fnd_user f
    where a.customer_trx_id = b.customer_trx_id
    and a.status <> 'A'
    and a.created_by = f.user_id
    and a.creation_date between :begin_date
    and :ending_date
    -- and a.creation_Date between to_date('&p_start_date','YYYY/MM/DD HH24:MI:SS')
    -- and to_date('&p_end_date','YYYY/MM/DD HH24:MI:SS')
    order by
    b.trx_number ;

    Hi
    Please go to customization part of the report and verify..You have set a default value out there ..And also verify your lov and look at the values ..If it is again giving you the problem ..pl delete the report and develop it again from the scratch it will be solved...
    vishnu
    null

  • Using bind variables in a portal report

    I'm using a portal 3.0.9 report with bind variables.
    I also use LOV to let the user choose his own parameters for these variables.
    When user click Apply on the customization form of the report, the selection is always "set to default"

    Hi
    Please go to customization part of the report and verify..You have set a default value out there ..And also verify your lov and look at the values ..If it is again giving you the problem ..pl delete the report and develop it again from the scratch it will be solved...
    vishnu
    null

  • Using bind variables in Shared Component Reports not working

    I've created a report query as a shared component in my APEX application. I'm calling the report on a page via a button. The query behind the report has bind variables for period and entity fields which are both defined on Page 0. I can run the query and return values just fine, but when you run the report from the page via the button, I get no values back. Does anyone know a trick to getting this to work? I've been working in APEX for about a month and I don't have much developer experience so any help is appreciated.
    Regards,
    -Steve

    Rohit,
    Thanks for your response. We are using APEX version 4.2.1.00.08. I do have Session State enabled and have put the required page items in the list. Here is my report query (highlighted lines contain the bind variables):
    SELECT TAX_DIVISION.DIVISION_CODE Division,
    TAX_ENTITY.ENTITY_CODE Entity_Code,
    DECODE(TAX_ADJUSTMENT.CATEGORY_DESC,'Net Income/(Loss)',1,'Permanent Adjustment',2,'Temporary Adjustment',3,4) Category_Desc,
    TAX_ADJUSTMENT.CLASSIFICATION Classification,
    TAX_ADJUSTMENT.ADJUSTMENT_CODE Adjustment_Code,
    SUM(NVL(NVL(TAX_ENTITY_ADJUSTMENT.OVERRIDE_AMT,TAX_ENTITY_ADJUSTMENT.ADJUSTMENT_AMT),0)) Tax_Amount
    FROM TAX_DIVISION,
    TAX_ENTITY,
    TAX_ENTITY_ADJUSTMENT,
    TAX_ADJUSTMENT,
    TAX_PERIOD
    WHERE TAX_DIVISION.DIVISION_ID = TAX_ENTITY.DIVISION_ID
    AND TAX_ENTITY.ENTITY_ID = TAX_ENTITY_ADJUSTMENT.ENTITY_ID
    AND TAX_ENTITY_ADJUSTMENT.ADJUSTMENT_ID = TAX_ADJUSTMENT.ADJUSTMENT_ID
    AND  TAX_ENTITY_ADJUSTMENT.PERIOD_ID = :P0_PERIOD_ID
    AND  TAX_ENTITY_ADJUSTMENT.YEAR_ID = :P0_YEAR_ID
    AND  TAX_ENTITY.DIVISION_ID = :P0_DIVISION_ID
    AND TAX_ADJUSTMENT.ADJUSTMENT_CODE = 'IBIT'
    GROUP BY TAX_DIVISION.DIVISION_CODE ,
    TAX_ENTITY.ENTITY_CODE ,
    DECODE(TAX_ADJUSTMENT.CATEGORY_DESC,'Net Income/(Loss)',1,'Permanent Adjustment',2,'Temporary Adjustment',3,4),
    TAX_ADJUSTMENT.CLASSIFICATION ,
    TAX_ADJUSTMENT.ADJUSTMENT_CODE
    HAVING SUM(NVL(NVL(TAX_ENTITY_ADJUSTMENT.OVERRIDE_AMT,TAX_ENTITY_ADJUSTMENT.ADJUSTMENT_AMT),0)) !=0
    ORDER BY DIVISION_CODE, DECODE(TAX_ADJUSTMENT.CATEGORY_DESC,'Net Income/(Loss)',1,'Permanent Adjustment',2,'Temporary Adjustment',3,4), CLASSIFICATION, ENTITY_CODE, ADJUSTMENT_CODE
    The query returns data when I set the bind variables and test in the report queries screen. When I assign the report query URL to the button in the application and run from there, I get no results.

  • User defined report with bind variable

    How can I create an user defined report using a bind variable?

    We currently do not support bind variables in User Defined Reports. We are looking at adding that function before production but I can't promise.
    -- Sharon

  • PL/SQL in user defined reports

    Is it possible to use PL/SQL in user defined reports? As far as I know, it isn't, but...
    And one more question: can we do something like this in user defined reports:
    ' select * from :TABLE '
    where
    :TABLE is a bind variable?
    Thanks in advance
    Aliq

    I want to create a parent-child report, which in simply version does three things:
    parent
    1. takes all the table names from user_tables
    2. for each table_name (taken from user_tables) it takes a few rows from this table (selet A,B,C from table_name).
    child
    3. for each table name (from master) gives additional information from this table (select D,E,F from table_name)
    And I wonder if it's possible.

  • Having trouble with variables followed by a period in user defined reports.

    Using SQL Developer 1.0.0.15 on XP.
    The DB is Oracle 10.
    Having trouble with variables followed by a period in user defined reports.
    select * from &OWNER.TABLE_NAME
    I noticed that the "Data Dictionary Reports" use :OWNER
    So I have tried all sort of variations:
    select * from :OWNER.TABLE_NAME
    select * from :OWNER\.TABLE_NAME
    select * from ":OWNER".TABLE_NAME
    select * from ':OWNER'.TABLE_NAME
    select * from (:OWNER).TABLE_NAME
    And every other variation I can think of. This is a simple example, but all my reports need the owner of tables as a variable.
    I assume this is simple, I just have not hit the right combination.
    Thanks -
    Dyer

    Use two points ..
    select * from &OWNER..TABLE_NAME

  • Report Using Bind Variables

    Hey Everyone,
    I'm having a bit of trouble creating a report. I need the FROM part of the code to use bind variables. I have come up with this peice of code below but im getting the following error:
    failed to parse SQL query:
    ORA-06550: line 1, column 8:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin function package pragma procedure subtype type use
    form
    current cursor
    The symbol "" was ignored.
    ORA-06550: line 2, column 24:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin function package pragma procedure subtype type use
    form
    current
    Can anyone see where im going wrong?
    Thanks in advance,
    -N.S.N.O.
    Code*
    DECLARE
    x VARCHAR2 (4000);
    BEGIN
    x := x || 'select *';
    x := x || 'from ';
    x := x || :p13_schema;
    x := x || '.ddl_log@';
    x := x || :p13_db_name;
    x := x || '_DBAAPEX.TNTEWW.COM';
    RETURN (x);
    END;

    Hey Roel and Daylocks,
    After getting frustrated for a while i deleted the page and started again. I put in the exact same code and it worked just how i wanted in the first place :S
    The only thing i did different is when i was creating the report region the first time around i used a normal SQL query, For Example:
    select sysdate from dual;
    Then i modified it to
    DECLARE
    x VARCHAR2 (4000);
    BEGIN
    x := x || 'select ';*
    x := x || 'from ';
    x := x || :p14_schema;
    x := x || '.ddl_log@';
    x := x || :p14_db_name;
    x := x || '_DBAAPEX.TNTEWW.COM';
    RETURN (x);
    END;
    Whereas on the second attempt i used the peice of code in question straight away. Its been a bit of a frustrating morning because i used a similar peice of code for a different application, nevermind tho :)
    Thanks for your replys, much appreciated.
    -N.S.N.O.

  • Using a query with bind variable with columns defined as raw

    Hi,
    We are on Oracle 10.2.0.4 on Solaris 8. I have a table that has 2 columns defined as raw(18). I have a query from the front end that queries these two raw columns and it uses bind vairables. The query has a performance issue that I need to reproduce but my difficulty is that how to test the query in sqlplus using bind variables (the syntax for bind vairables fails for columns with raw datatype).
    SQL> DESC TEST
    Name                                      Null?    Type
    ID1                                                RAW(18)
    ID2                                                RAW(18)
    SQL> variable b1  RAW(18);
    Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
                        VARCHAR2 (n [CHAR|BYTE]) | NCHAR | NCHAR (n) |
                        NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
                        BINARY_FLOAT | BINARY_DOUBLE ] ]
    The above is the error I get - i cant declare a variable as raw.
    SQL> variable b2  RAW(18);
    Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
                        VARCHAR2 (n [CHAR|BYTE]) | NCHAR | NCHAR (n) |
                        NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
                        BINARY_FLOAT | BINARY_DOUBLE ] ]
    SQL> variable b3  RAW(18);
    Usage: VAR[IABLE] [ <variable> [ NUMBER | CHAR | CHAR (n [CHAR|BYTE]) |
                        VARCHAR2 (n [CHAR|BYTE]) | NCHAR | NCHAR (n) |
                        NVARCHAR2 (n) | CLOB | NCLOB | REFCURSOR |
                        BINARY_FLOAT | BINARY_DOUBLE ] ]
    --now the actual query below
    SQL> SELECT * FROM TEST WHERE ID1=:B1 AND ID2 BETWEEN :B2 AND :B3;
    SP2-0552: Bind variable "B3" not declared.
    (this fails due to the errors earlier)Also this is a third party app schema so that we don't have the option of modifying the data type of the columns.
    Thanks,
    Edited by: orausern on May 10, 2011 11:30 AM

    Try anonymous PL/SQL block:
    declare
    b1 RAW(18);
    b2 RAW(18);
    b3 RAW(18);
    begin
    b1:=..;
    b2:=..;
    b3:=..;
    SELECT col1, col2, ..
    INTO ...
    FROM TEST
    WHERE ID1=:B1
    AND ID2 BETWEEN :B2 AND :B3;
    end;
    /

  • How to use SYSDATE as a default value of a bind variable in a query report?

    Hi,
    I want to use SYSDATE as default value for a bind variable in Query based report.
    I don't see any way to do it, someone helps?
    Thanks a lot.
    Paulo.

    You can aslo use #sysdate directly.
    Hi,
    The way I'm doing in my report is, I have a database function (f_ret_sysdate) with the following code
    create function f_ret_sysdate return varchar2
    begin
    return to_char(sysdate,'mm/dd/yyyy');
    end;
    Now, in the 'Customization Form Display Options' section of the report I'm calling this function as #f_ret_sysdate in the default value field of corresponding bind variable to display SYSDATE with the format.
    Hope this helps!...
    -Krishnamurthy

  • 4.1EA2 User-Defined-Report strips CRLF when using PL/SQL DBMS Output

    Hi,
    I have a report with a child report.
    That child report uses pl/sql to print to the screen. (dbms output)
    When i use the procedure manually it prints fine.
    When i copy this output to a text editor i can see the CRLF in there.
    If i call the same procedure tru the reports section of SQLDeveloper the output is stripped of any CRLF characters.
    This is causing it to be useless for me: i am using it to generate code and it all appears as one big line on the screen.
    Copying this to a text editor indeed shows all CRLFs gone.
    Is this intentional or a bug ?

    Jeff,
    Thnx for the answer.
    I don't have a problem writing html in my code being a former webdeveloper with experience in apex as well.
    The problem is that the option presents itself as a standard plsql dbmsoutput, which suggests identical output as a dbmsoutput pane in sqldeveloper.
    From your answer i gather it really is supposed to do html formatting.
    Your "solution" of inserting br tags would be fine if it weren't for the fact that when i do a copy of the output in this report pane sqldeveloper strips away the br tags but doesn't replace them with crlf's.
    And since the crlfs that were in the output are also stripped in this result pane i get a single line of text when i copy over a page of text from the result pane into a normal texteditor.
    As such it behaves differently then say a browser when i copy a page of text from the browser and paste it in a text editor. There i see the crlfs that were present in the original source.
    Is there a listing somewhere that explains what tags are supported?
    Or CSS ?
    Does it support stuff like white-space: pre ?
    I understand the usefullness of a html-aware plsql dbmsoutput output option in the reports list of a user-defined report.
    However i would like to use this opportunity to advocate to include , as an extra option or tick box etc., an option to just display the output as the normal dbmsoutput pane displays it.
    That is without extra formatting.
    I like the idea of being able to click in the table section above and to have bottom pane generate the appropriate code as output.
    That  use-case can not happen right now since it formats as html (and not even the correct way) or, when going along with this route, strips everything to a single line of text when copying the data from the result pane.
    rgrds mike

  • Unifier Table name used for storing User-Defined Reports Information

    Hello Everyone,
    I am looking for the table name that stores all the User-Defined Reports information pertaining to report creation details. I want to create a dataview that will provides all the user-defined reports the system presently had on file.
    Does anyone know about the system auto-created table name for User Defined Reports. It might start with "sys_"
    Thanks

    For custom reports, you can find them through data views - "sys_custom_report". I am wondering why UDR tables were not included.
    The only effort left is manually copy pasting each name and information from Unifier on an Excel sheet. It will take a lot of time though. I will also log a SR meanwhile.
    Thanks everyone for your help.

  • Bind variable is not defined

    Hi, it is my first attempt to modify a rdf file.
    I run into a problem while trying to add an additional user parameter in an existing rdf file. While I am successful in adding a new FREQUENCY user parameter and I am able to update the form to show this new parameter, I am not able to run the report.
    I have updated the SQL query in the report editor, under data view to use this new parameter :FREQUENCY. (select ... from table where frequency= :FREQUENCY) There was no error here.
    Whenever I run the report, I will always get an error saying:
              "REP-0730: The following bind variable is not defined: "(nothing behind this                                                             error message)
    The program will have a memory error and it exits itself.
    I had tried many methods trying to solve this problem to no avail.
    I am using Oracle 9i Reports Builder 9.0.2.0.3.
    I would appreciate any help given on this matter.
    Thank you :)
    Message was edited by:
    Leion

    In Object Navigator Under Layout ->User parameters are you able to see your bind variable FREQUENCY?

  • Columns tab in User Defined Report

    I've written a few user defined reports, but so far I've just filled in the SELECT command. I'm looking at the tab labeled "Columns" and trying to understand how that affects the report formatting.
    Am I right in assuming that this is equivalent to the COLUMN command in SQL*Plus? So "Name" maps to the column name in the SELECT, right? "hAlign" and "vAlign" are pretty self explanatory, and valid values for these are listed in the on-line help. But what about "Format"? What are valid values for this field? Do I use the format values from SQL*Plus, like "A30" for a 30 character wide column?
    Finally, is there a way to specify that a column is not to be displayed? I have a primary key that I don't want to display, but I do need to include in the SELECT, because the report has a Child query that needs to use this as a bind variable for a foreign key.

    <p>
    I've found part of the answer to my own question:
    </p>
    <p>
    Formats for the "format" field in the Columns tab are the formats used in the java.text.MessageFormat class. For example, you can use:
    </p>
    {0,date,yyyyMMdd hh:mm:ss}<p>
    The zero means the first argument; it will always be zero because we are only formatting one column. The second part tells what kind of formats to use, date or number. There is also a "choice" format type, which is related to number - works sort of like the DECODE function. The third part is the format itself, which can be one of several default formats like "currency", "percent" and "integer" for numbers, or "short", "medium", "long" or "full" for dates. I used an explicit format.
    </p>
    <p>
    I still don't have an answer to the second part of my question: How do I include a column in my query to be used as a bind variable in a child query, but exclude it from the report?
    </p>

Maybe you are looking for

  • Can't open Premiere CS4 project in CS5

    Having issues opening a premiere cs4 project in cs5. The machine I was using with Cs4 has died, so I'm trying to continue the project with CS5. Whenever I open the project I get a message saying "this project contained a sequence that could not be op

  • Activation of the change list canceled

    Hi Guys I am doing the SOAP to FILE Scenario using BPM when I activate my Integration Processes (Soap_to_file_BPM ) i get the below error, on my IM the source is "yonela_ob_mi" and the target is "yonela_ob_mi_AS" which is my abstract.Then on the Tran

  • InDesign crashes when updating InCopy ICML files

    I created an assignment file with around 20 different stories. The next time I opened InDesign the writer had input text to most of the story files. One story file was a couple of pages of text, the rest were just a few lines of copy, nothing huge. E

  • Java program not running by the Ant

    i have a small java program. its a classpath problem. cant figure out where is the problem. i am running the code via Ant. build.xml <?xml version="1.0"?> <project name="myproject" basedir="." default="all">     <property name="src.dir"     value="sr

  • Standard report for TDS

    HI SAP GURUS please tell me what is the standard report for TDS IN SAP ?