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?

Similar Messages

  • 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;
    /

  • Bind variable does not exist...

    Hi,
    I have an Access UI which is calling an Oracle package. The package has a simple command:
    INSERT INTO Table1 SELECT * from Table2
    The above query runs fine in Oracle directly, but when I run it through the package, I get the error "Bind variable does not exist". What does that mean? The query does not have any parameters. Similar queries running thgough the package that insert into other tables work fine.
    Something with structure of Table2 (this is a new table)?
    Thanks.
    Edited by: markk2 on Jan 12, 2009 9:59 PM
    Edited by: markk2 on Jan 12, 2009 10:10 PM

    I am not sure what's package you were talking about. Is it a package designed in Access?
    Access to Oracle is using ODBC, some of the SQL syntax specific to Oracle may not work. You might also check how table1 and table2 defined in Access. Are they all linked Oracle tables or one of them is Access table?
    Do you have any Oracle error message like ORA-xxxx ?

  • SP2-0552: Bind variable "SV_STUDENT_ID" not declared.

    I get this error:
    SP2-0552: Bind variable "SV_STUDENT_ID" not declared.
    DECLARE
    sv_student_id NUMBER;
    v_student_id NUMBER := &sv_student_id;
    v_enrolled VARCHAR2(3) := 'NO';
    BEGIN
    DBMS_OUTPUT.PUT_LINE ('Check if the student is enrolled');
    SELECT 'YES'
    INTO v_enrolled
    FROM enrollment
    WHERE student_id = v_student_id;
    DBMS_OUTPUT.PUT_LINE ('The student is enrolled into one course');
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    DBMS_OUTPUT.PUT_LINE ('The student is not enrolled');
    WHEN TO_MANY_ROWS
    THEN
    DBMS_OUTPUT.PUT_LINE ('The student is enrolled to many courses');
    END;

    Define &sv_student_id;
    DECLARE
      v_student_id NUMBER := &sv_student_id;
      v_enrolled VARCHAR2(3) := 'NO';
    BEGIN
      DBMS_OUTPUT.PUT_LINE ('Check if the student is enrolled');
      SELECT 'YES'
        INTO v_enrolled
        FROM enrollment
       WHERE student_id = v_student_id;
      DBMS_OUTPUT.PUT_LINE ('The student is enrolled into one course');
    EXCEPTION
      WHEN NO_DATA_FOUND THEN
        DBMS_OUTPUT.PUT_LINE ('The student is not enrolled');
      WHEN TO_MANY_ROWS THEN
        DBMS_OUTPUT.PUT_LINE ('The student is enrolled to many courses');
    END;

  • 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

  • About ora-01006 :bind variable does not exist

    Hi all of you,i have this dynamic sql :
    DECLARE
    v_query clob;
    cpt number;
    begin
    v_query:='
    SELECT
    count(TBA.ANT_ID)
      FROM
    WHERE TBA.ANT_FUT_ID = TFT.FUT_ID
           AND TBA.ANT_KATEGORIE_CODE_ID = TAKCL.ANT_KATEGORIE_CODE_ID(+)
           AND TBA.ANT_KFZ_REIHEN_ID = TKR.KFZ_REIHEN_ID(+)
           AND TBA.ANT_ID = F1.ANT_ANT_ID(+)
           AND TBA.ANT_ID = F2.ANT_ANT_ID(+)
           AND TBA.ANT_ID = F3.ANT_ANT_ID(+)
           AND TBA.ANT_ID = ERS.ers_bdk(+)
           AND TBA.ANT_ID = F1_2.ANT_ANT_ID(+)
           AND TBA.ANT_ID = F2_3.ANT_ANT_ID(+)
           AND TBA.ANT_ID = MFU.MFU_ANT_ID(+)
           AND MFU.MFU_NIETGEOMETRIE_ID = NG.NG_ID(+)
           AND MFU.MFU_MATRIZEN_BEICHNUNG_ID = MZB.MZB_ID(+)
        -- Suchkriterien: --
        --Ersteller
        AND  DECODE( ERS.ers_id, NULL, ''%'', ERS.ers_name ) LIKE DECODE('':1'',NULL,''%'','''')||''''|| :1 ||''''||DECODE('':1'',NULL,''%'','''')
         --Fahrzeug
        AND  DECODE( TKR.NAME, NULL, ''%'', TKR.NAME ) LIKE DECODE('':2'',NULL,''%'','''')||''''|| :2 ||''''|| DECODE('':2'',NULL,''%'','''')
         --BDK
        AND  DECODE( fuege_db.bdk_nummer( TBA.ANT_ID,''.'' ), NULL, ''%%'',
       fuege_db.bdk_nummer( TBA.ANT_ID,''.'' ) )   LIKE ''%''||:3||''%''
        --Technologie
        AND  TBA.ANT_FUT_ID LIKE DECODE('':4'',NULL,''%'','''')||''''|| :4 ||''''||DECODE('':4'',NULL,''%'','''')
         --Art
        AND ((TBA.ANT_WFP_ID is null and 1=DECODE('':5'',NULL,1,1,1) ) or (TBA.ANT_WFP_ID is not null and 2=DECODE('':5'',NULL,2,2,2)))
        --VTA
        AND TBA.ANT_VTA = decode('':6'',1,1,TBA.ANT_VTA)  ';
    execute immediate v_query
    into cpt USING
    'Dominik Hussmann',
    'AU736_Q7_SUV' ,
    'WPS Stahl',
    '0';  
    end ;
    In the execution,i have this error :ora-01006 :bind variable does not exist, after analyzing,i have found that the problem is with parameters :5 and :6 ,i don't understand they have the same syntax
    as bind variables 1,2,3 and 4.
    Than you for any suggestion.

    I hope you do realise that there are 13 bind-variables in your sql, not 6?
    Variables are bound by position. You cannot use the same bind variable twice, they will be 2 distinct bind variables.
    For example, you use :1 three times, so you need to provide three arguments, in this case three times the same value.

  • I am getting this error message "ORA-01006: bind variable does not exist.

    My code works fine like this:
    DECLARE
    v_JOBTYPE varchar2(8);
    v_STATUS varchar2(8);
    v_FAILURE varchar2(8);
    v_CAUSE varchar2(8);
    v_ACTION varchar2(8);
    BEGIN
    SELECT EVT_STATUS, EVT_FAILURE, EVT_CAUSE, EVT_ACTION, EVT_JOBTYPE
    INTO v_STATUS, v_FAILURE, v_CAUSE, v_ACTION, v_JOBTYPE
    FROM R5EVENTS WHERE ROWID = :ROWID;
    IF NVL(v_STATUS, 'X') = 'C' AND NVL(v_JOBTYPE , 'X') IN ('BRKD','UNPLBRKD','FILTRA', 'LUB', 'FAC') AND (v_FAILURE IS NULL OR v_CAUSE IS NULL OR v_ACTION IS NULL) THEN
    RAISE_APPLICATION_ERROR( -20001, 'FAILURE, CAUSE AND ACTION FIELDS MUST BE POPULATED');
    END IF;
    END;
    But I want to change the code to include a record (ACT_TRADE) from another table(R5ACTIVITIES). I am getting this error message "ORA-01006: bind variable does not exist - POST-UPDATE 200Before Binding". Any help would be appreciated.
    DECLARE
    v_STATUS varchar2(8);
    v_FAILURE varchar2(8);
    v_CAUSE varchar2(8);
    v_ACTION varchar2(8);
    V_CODE varchar2(8);
    V_EVENT varchar2(8);
    V_TRADE varchar2(8);
    BEGIN
    SELECT R5EVENTS.EVT_STATUS, R5EVENTS.EVT_FAILURE, R5EVENTS.EVT_CAUSE, R5EVENTS.EVT_ACTION, R5EVENTS.EVT_CODE, R5ACTIVITIES.ACT_EVENT, R5ACTIVITIES.ACT_TRADE
    INTO v_STATUS, v_FAILURE, v_CAUSE, v_ACTION, V_CODE, V_EVENT, V_TRADE
    FROM R5EVENTS, R5ACTIVITIES WHERE V_CODE = :V_EVENT;
    IF NVL(v_STATUS, 'X') = 'C' AND NVL(v_TRADE , 'X') IN ('MTM','MTL','MTMGT', 'FTM', 'FTL', 'FTMGT', 'R5') AND (v_FAILURE IS NULL OR v_CAUSE IS NULL OR v_ACTION IS NULL) THEN
    RAISE_APPLICATION_ERROR( -20001, 'FAILURE, CAUSE AND ACTION FIELDS MUST BE POPULATED');
    END IF;
    END;

    Thank you for your responses. Your feedback was helpful. This is what I ended up doing for a solution:
    DECLARE
    v_JOBTYPE varchar2(8);
    v_STATUS varchar2(8);
    v_FAILURE varchar2(8);
    v_CAUSE varchar2(8);
    v_ACTION varchar2(8);
    v_GROUP varchar2(30);
    BEGIN
    SELECT EVT_STATUS, EVT_FAILURE, EVT_CAUSE, EVT_ACTION, EVT_JOBTYPE, USR_GROUP
    INTO v_STATUS, v_FAILURE, v_CAUSE, v_ACTION, v_JOBTYPE, v_GROUP
    FROM R5EVENTS, R5USERS WHERE R5EVENTS.ROWID = :ROWID
    AND USR_CODE = O7SESS.CUR_USER;
    IF NVL(v_STATUS, 'X') = 'C' AND NVL(V_GROUP,'X') IN ('MTM','MTL','MTMGT','FTL','FTMGTS','PLANNER','DISPATCH','PMCOOR','R5') AND (v_FAILURE IS NULL OR v_CAUSE IS NULL OR v_ACTION IS NULL) THEN
    RAISE_APPLICATION_ERROR( -20001, 'FAILURE, CAUSE AND ACTION FIELDS MUST BE POPULATED');
    END IF;
    END;

  • How to find out if a SQL is using a bind variable or not?

    In order to make a SQL use consistent execution plan, I want to create a profile for a SQL. But I need to know if a SQL is using bind variable or not to create a profile for all the same SQLs except the literal value. How can I do that?
    Thanks in advance

    You can tell if an SQL statement uses a bind variable by looking at the SQL statement.
    If you look in the program that submits the SQL statement you can see how it constructs, prepares, and executes the statement.
    If you are just looking at the SQL in the shared pool then depending on how the statement is written and the setting of database parameters like cursor sharing then it can be more difficult but if you see a constant (actual value) that is a constant. A bind variable would appear as a name in the where clause where that name does not exist any of the tables referenced in the query. Note it is technically possible to create pl/sql variables with the same name as columns in the query but that is poor coding and leads to issues.
    Note - To Oracle two versions of the otherwise same query where one has a constant and the other has a bind variable are not the same query and often produce different plans. This is a common error made by developers new to Oracle when using explain plan. To explain a query that uses bind variables place a ":" in front of the variable name in the SQL submitted to explain plan.
    HTH -- Mark D Powell --

  • ReferenceError: Error #1065: Variable is not defined.

    Hi people.
    Whatever I do (seems like) I end up with the following
    message in Flash CS3:
    "ReferenceError: Error #1065: Variable is not defined."
    I have no clue to what causes it, and therefor I cannot seem
    to fix it. I've been trying to look for answers online, but all I
    got out of that was to declare my classes as public, which I
    already had done.
    Even a very simple class that runs a trace command from its'
    constructor method won't work. It even gives me this message even
    though I don't have any variables or trace commands or anything.
    This is really annoying, so please help me out :)
    A

    Some code sample would help - and remember classes must be
    contained within
    packages in CS3.
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Error #1065: Variable  is not defined on ObjectUtil??

    One comment to Adobe, it would be nice if the debugger would
    output better errors. Maybe it's just my lack of experience, but
    trying to track down errors is a daunting task.
    I had spent an entire night trying to track down this error
    and it has come down to the following code:
    private function server_fault(event:FaultEvent):void{
    Alert.show(ObjectUtil.toString(event));
    The ObjectUtil seems to be causing this error as if i change
    it to (event as String) it works fine. But this makes absolutely no
    sense since i have other classes that use the exact same code w/o a
    hitch. I do have the ObjectUtil imported.
    Here is the entire error:
    ReferenceError: Error #1065: Variable is not defined.
    at global/flash.utils::getDefinitionByName()
    at mx.utils::DescribeTypeCache$/describeType()
    at mx.utils::ObjectUtil$/getClassInfo()
    at mx.controls::DataGrid/::generateCols()
    at
    mx.controls::DataGrid/mx.controls:DataGrid::collectionChangeHandler()
    at mx.controls.listClasses::ListBase/set dataProvider()
    at mx.controls::DataGrid/set dataProvider()
    at mx.core::Container/createComponentFromDescriptor()
    at mx.core::Container/createComponentsFromDescriptors()
    at mx.core::Container/mx.core:Container::createChildren()
    at mx.core::UIComponent/initialize()
    at mx.core::Container/initialize()
    at mx.core::UIComponent/
    http://www.adobe.com/2006/flex/mx/internal::childAdded()
    at mx.core::Container/
    http://www.adobe.com/2006/flex/mx/internal::childAdded()
    at mx.core::Container/addChildAt()
    at mx.core::Container/addChild()
    at mx.core::Container/createComponentFromDescriptor()
    at mx.core::Container/createComponentsFromDescriptors()
    at
    mx.containers::ViewStack/createComponentsFromDescriptors()
    at mx.core::Container/mx.core:Container::createChildren()
    at
    mx.containers::TabNavigator/mx.containers:TabNavigator::createChildren()
    at mx.core::UIComponent/initialize()
    at mx.core::Container/initialize()
    at mx.core::UIComponent/
    http://www.adobe.com/2006/flex/mx/internal::childAdded()
    at mx.core::Container/
    http://www.adobe.com/2006/flex/mx/internal::childAdded()
    at mx.core::Container/addChildAt()
    at mx.core::Container/addChild()
    at mx.core::Container/createComponentFromDescriptor()
    at mx.core::Container/createComponentsFromDescriptors()
    at mx.containers::Panel/createComponentsFromDescriptors()
    at mx.core::Container/mx.core:Container::createChildren()
    at
    mx.containers::Panel/mx.containers:Panel::createChildren()
    at mx.core::UIComponent/initialize()
    at mx.core::Container/initialize()
    at views.movie::MovieDetail/initialize()
    at mx.managers::SystemManager/
    http://www.adobe.com/2006/flex/mx/internal::childAdded()
    at mx.managers::SystemManager/
    http://www.adobe.com/2006/flex/mx/internal::rawChildren_addChildAt()
    at mx.managers::SystemManager/addChild()
    at mx.managers::PopUpManagerImpl/addPopUp()
    at mx.managers::PopUpManager$/addPopUp()
    at com.windowedApplication::WindowManager$/add()
    at
    views.movie::MovieMaster/__movieDataGrid_doubleClick()

    I have on the permit debugging option but it says nothing but these errors
    ReferenceError: Error #1065: Variable Button is not defined.
    ReferenceError: Error #1065: Variable ComponentShim is not defined.
    ReferenceError: Error #1065: Variable LoaderProV3AS3 is not defined.

  • HELP ReferenceError: Error #1065: Variable is not defined.

    okay i keep writing code for a button that when clicked
    should jump to another frame on my timeline but each time i preview
    it i get this error : ReferenceError: Error #1065: Variable is not
    defined.
    I NEED HELP PLEASE HOW DO I DEFINE THE VARIABLE?

    you declare its data type to stop the error message, but
    that's unlikely to help you because you're probably trying to use a
    value of some variable.
    so, you need to pinpoint the area of code that triggers the
    error message. for example, does the error only appear after you
    click your button?

  • ORA-01006:bind variable does not exist for the QUERY

    Dear All,
    Please help on below query :
    DECLARE
    P_ROTATION_NO GCH_VSL_REGN.ROTATION_NO%TYPE :=21;
    P_VESL_NO GCH_VSL_MASTER.VESL_NO%TYPE := NULL;
    P_VESL_NAME GCH_VSL_MASTER.VESL_NAME%TYPE:= NULL;
    P_FROM_REG_DATE GCH_VSL_MASTER.CREATED_DATE%TYPE:= NULL;
    P_TO_REG_DATE GCH_VSL_MASTER.CREATED_DATE%TYPE:= NULL;
    P_FROM_ARRIVAL_DATE GCH_VSL_REGN.ARRIVAL_DATE%TYPE:= NULL;
    P_TO_ARRIVAL_DATE GCH_VSL_REGN.ARRIVAL_DATE%TYPE:= NULL;
    P_CLOSE_TYPE GCH_VSL_CLOSE_DTLS.CLOSE_TYPE%TYPE:= NULL;
    P_RESULT_LIST SYS_REFCURSOR;
    P_TOTAL_LENGTH NUMBER;
    P_ERROR_MESSAGE VARCHAR2(1000);
    lv_sql1 VARCHAR2(5000);
    lv_sql2 VARCHAR2(5000);
    lv_whereClause VARCHAR2(5000);
    pv_text VARCHAR2(1000);
    BEGIN
    pv_text := NULL;
    lv_whereClause := ' WHERE GVM.VESL_MASTER_NUM = GVR.VESL_MASTER_NUM
    AND GVR.ROTATION_NO = GVCH.ROTATION_NO
    AND GVCH.CLOSE_HDR_ID = GVCD.CLOSE_HDR_ID(+)
    AND (:P_ROTATION_NO IS NULL OR
    (:P_ROTATION_NO IS NOT NULL AND
    GVR.ROTATION_NO LIKE % :P_ROTATION_NO %))
    AND GVM.IS_VALID = 1';
    lv_sql1 := 'SELECT COUNT(gvr.rotation_no)
    FROM gch_vsl_close_hdr gvch,
    gch_vsl_master gvm,
    gch_vsl_regn gvr,
    gch_vsl_close_dtls gvcd'||lv_whereClause;
    dbms_output.put_line (lv_sql1);
    EXECUTE IMMEDIATE lv_sql1 INTO :P_TOTAL_LENGTH
    USING P_ROTATION_NO;
    END;
    I am getting below error when running the above query
    ORA-01006:     bind variable does not exist

    why (date datatype assumed for variables with names containing DATE)
    PROCEDURE XVY(P_ROTATION_NO IN GCH_VSL_REGN.ROTATION_NO%TYPE,
                  P_VESL_NO IN GCH_VSL_MASTER.VESL_NO%TYPE,
                  P_VESL_NAME IN GCH_VSL_MASTER.VESL_NAME%TYPE,
                  P_CM_REGN_NO IN GCH_VSL_REGN.CM_REGN_NO%TYPE,
                  P_FINAL_CLOSE_STA IN GCH_VSL_CLOSE_HDR.FINAL_CLOSE_STA%TYPE,
                  P_FROM_REG_DATE IN GCH_VSL_MASTER.Created_Date%TYPE,
                  P_TO_REG_DATE IN GCH_VSL_MASTER.CREATED_DATE%TYPE,
                  P_FROM_ARRIVAL_DATE IN GCH_VSL_REGN.ARRIVAL_DATE%TYPE,
                  P_TO_ARRIVAL_DATE IN GCH_VSL_REGN.ARRIVAL_DATE%TYPE,
                  P_RESULT_LIST OUT SYS_REFCURSOR,
                  P_TOTAL_LENGTH OUT NUMBER,
                  P_ERROR_MESSAGE OUT VARCHAR2
                 ) AS
      lv_sql1        VARCHAR2(4000);
      lv_sql2        VARCHAR2(4000);
      lv_whereClause VARCHAR2(4000);
    BEGIN
    --  pv_text := NULL;
      lv_whereClause := ' WHERE gvm.vesl_master_num = gvr.vesl_master_num '||
                          ' AND GVR.ROTATION_NO(+) = GVCH.ROTATION_NO '||
                          ' AND (:P_ROTATION_NO IS NULL '||
                          '  OR  (:P_ROTATION_NO IS NOT NULL '||
                          ' AND   gvch.rotation_no LIKE ''%'' || :P_ROTATION_NO || ''%'' ' ||
                          '      ) '||
                          '     ) '||
                          ' AND (:P_CM_REGN_NO IS NULL '||
                          '  OR  (:P_CM_REGN_NO IS NOT NULL '||
                          ' AND   gvr.cm_regn_no LIKE ''%'' || :P_CM_REGN_NO || ''%'' '||
                          '      ) '||
                          '     ) '||
                          ' AND (:P_VESL_NAME IS NULL '||
                          '  OR  (:P_VESL_NAME IS NOT NULL '||
                          ' AND   gvm.vesl_name LIKE ''%'' || :P_VESL_NAME || ''%'' '||
                          '      ) '||
                          '     ) '||
                          ' AND (:P_VESL_NO IS NULL '||
                          '  OR  (:P_VESL_NO IS NOT NULL '||
                          ' AND   GVM.vesl_no LIKE ''%'' || :P_VESL_NO || ''%'' '||
                          '      ) '||
                          '     ) '||
                          ' AND (:P_FINAL_CLOSE_STA IS NULL '||
                          '  OR  (:P_FINAL_CLOSE_STA IS NOT NULL '||
                          ' AND   gvch.imp_close_sta LIKE ''%'' || :P_FINAL_CLOSE_STA || ''%'' '||
                          '      ) '||
                          '     ) '||
                          ' AND (:P_FROM_REG_DATE IS NULL '||
                          '  OR  (:P_FROM_REG_DATE IS NOT NULL '||
                          ' AND   gvch.created_date >= :P_FROM_REG_DATE '||
                          '      ) '||
                          '     ) '||
                          ' AND (:P_TO_REG_DATE IS NULL '||
                          '  OR  (:P_TO_REG_DATE IS NOT NULL '||
                          ' AND   gvch.created_date <= :P_TO_REG_DATE '||
                          '      ) '||
                          '     ) '||
                          ' AND (:P_FROM_ARRIVAL_DATE IS NULL '||
                          '  OR  (:P_FROM_ARRIVAL_DATE IS NOT NULL '||
                          ' AND   gvch.arrival_date >= :P_P_FROM_ARRIVAL_DATE '||
                          '      ) '||
                          '     ) '||
                          ' AND (:P_TO_ARRIVAL_DATE IS NULL '||
                          '  OR  (:P_TO_ARRIVAL_DATE IS NOT NULL '||
                          ' AND   gvch.arrival_date <= :P_TO_ARRIVAL_DATE '||
                          '      ) '||
                          '     ) '||
                          ' AND gvm.is_valid = 10 ';
      lv_sql1 := 'SELECT COUNT(gvr.rotation_no) '||
                 '  FROM xvz gvch, '||
                 '       zxsc gvm, '||
                 '       dsae gvr, '||
                 '       vvsd gvcd '|| lv_whereClause;
      lv_sql2 := ' SELECT gvch.close_hdr_id, '||
                 '        gvch.rotation_no, '||
                 '        gvr.cm_regn_no, '||
                 '        gvm.vesl_no, '||
                 '        gvm.vesl_name, '||
                 '        gvch.final_close_sta, '||
                 '        gvr.arrival_date, '||
                 '        gvch.close_date, '||
                 '        gvr.created_date '||
                 '   FROM xvz gvch, '||
                 '        zxsc gvm, '||
                 '        dsze gvr '|| lv_whereClause || 'ORDER BY gvch.rotation_no';
      EXECUTE IMMEDIATE lv_sql1 INTO P_TOTAL_LENGTH
                  USING P_ROTATION_NO,P_ROTATION_NO,P_ROTATION_NO,
                        P_CM_REGN_NO,P_CM_REGN_NO,P_CM_REGN_NO,
                        P_VESL_NAME,P_VESL_NAME,P_VESL_NAME,
                        P_VESL_NO,P_VESL_NO,P_VESL_NO,
                        P_FINAL_CLOSE_STA,P_FINAL_CLOSE_STA,P_FINAL_CLOSE_STA,
                        P_FROM_REG_DATE,P_FROM_REG_DATE,P_FROM_REG_DATE,
                        P_TO_REG_DATE,P_TO_REG_DATE,P_TO_REG_DATE,
                        P_FROM_ARRIVAL_DATE,P_FROM_ARRIVAL_DATE,P_FROM_ARRIVAL_DATE,
                        P_TO_ARRIVAL_DATE,P_TO_ARRIVAL_DATE,P_TO_ARRIVAL_DATE;
      OPEN P_RESULT_LIST
       FOR lv_sql2 USING P_ROTATION_NO,P_ROTATION_NO,P_ROTATION_NO,
                         P_CM_REGN_NO,P_CM_REGN_NO,P_CM_REGN_NO,
                         P_VESL_NAME,P_VESL_NAME,P_VESL_NAME,
                         P_VESL_NO,P_VESL_NO,P_VESL_NO,
                         P_FINAL_CLOSE_STA,P_FINAL_CLOSE_STA,P_FINAL_CLOSE_STA,
                         P_FROM_REG_DATE,P_FROM_REG_DATE,P_FROM_REG_DATE,
                         P_TO_REG_DATE,P_TO_REG_DATE,P_TO_REG_DATE,
                         P_FROM_ARRIVAL_DATE,P_FROM_ARRIVAL_DATE,P_FROM_ARRIVAL_DATE,
                         P_TO_ARRIVAL_DATE,P_TO_ARRIVAL_DATE,P_TO_ARRIVAL_DATE;
    END;instead of (the where clauses should be equivalent)
    PROCEDURE XVY(P_ROTATION_NO IN GCH_VSL_REGN.ROTATION_NO%TYPE,
                  P_VESL_NO IN GCH_VSL_MASTER.VESL_NO%TYPE,
                  P_VESL_NAME IN GCH_VSL_MASTER.VESL_NAME%TYPE,
                  P_CM_REGN_NO IN GCH_VSL_REGN.CM_REGN_NO%TYPE,
                  P_FINAL_CLOSE_STA IN GCH_VSL_CLOSE_HDR.FINAL_CLOSE_STA%TYPE,
                  P_FROM_REG_DATE IN GCH_VSL_MASTER.Created_Date%TYPE,
                  P_TO_REG_DATE IN GCH_VSL_MASTER.CREATED_DATE%TYPE,
                  P_FROM_ARRIVAL_DATE IN GCH_VSL_REGN.ARRIVAL_DATE%TYPE,
                  P_TO_ARRIVAL_DATE IN GCH_VSL_REGN.ARRIVAL_DATE%TYPE,
                  P_RESULT_LIST OUT SYS_REFCURSOR,
                  P_TOTAL_LENGTH OUT NUMBER,
                  P_ERROR_MESSAGE OUT VARCHAR2
                 ) AS
      lv_sql1        VARCHAR2(4000);
      lv_sql2        VARCHAR2(4000);
      lv_whereClause VARCHAR2(4000);
    BEGIN
      SELECT COUNT(gvr.rotation_no)
        INTO P_TOTAL_LENGTH
        FROM xvz gvch,
             zxsc gvm,
             dsae gvr,
             vvsd gvcd
       WHERE gvm.vesl_master_num = gvr.vesl_master_num
         AND GVR.ROTATION_NO(+) = GVCH.ROTATION_NO
         AND (P_ROTATION_NO IS NULL
          OR  (P_ROTATION_NO IS NOT NULL
         AND   gvch.rotation_no LIKE '%' || P_ROTATION_NO || '%'
         AND (P_CM_REGN_NO IS NULL
          OR  (P_CM_REGN_NO IS NOT NULL
         AND   gvr.cm_regn_no LIKE '%' || P_CM_REGN_NO || '%'
         AND (P_VESL_NAME IS NULL
          OR  (P_VESL_NAME IS NOT NULL
         AND   gvm.vesl_name LIKE '%' || P_VESL_NAME || '%'
         AND (P_VESL_NO IS NULL
          OR  (P_VESL_NO IS NOT NULL
         AND   GVM.vesl_no LIKE '%' || P_VESL_NO || '%'
         AND (P_FINAL_CLOSE_STA IS NULL
          OR  (P_FINAL_CLOSE_STA IS NOT NULL
         AND   gvch.imp_close_sta LIKE '%' || P_FINAL_CLOSE_STA || '%'
         AND (P_FROM_REG_DATE IS NULL
          OR  (P_FROM_REG_DATE IS NOT NULL
         AND   gvch.created_date >= P_FROM_REG_DATE
         AND (P_TO_REG_DATE IS NULL
          OR  (P_TO_REG_DATE IS NOT NULL
         AND   gvch.created_date <= P_TO_REG_DATE
         AND (P_FROM_ARRIVAL_DATE IS NULL
          OR  (P_FROM_ARRIVAL_DATE IS NOT NULL
         AND   gvch.arrival_date >= P_P_FROM_ARRIVAL_DATE
         AND (P_TO_ARRIVAL_DATE IS NULL
          OR  (P_TO_ARRIVAL_DATE IS NOT NULL
         AND   gvch.arrival_date <= P_TO_ARRIVAL_DATE
         AND gvm.is_valid = 10;
      OPEN P_RESULT_LIST
       FOR SELECT gvch.close_hdr_id, 
                  gvch.rotation_no, 
                  gvr.cm_regn_no, 
                  gvm.vesl_no, 
                  gvm.vesl_name, 
                  gvch.final_close_sta, 
                  gvr.arrival_date, 
                  gvch.close_date, 
                  gvr.created_date 
             FROM xvz gvch, 
                  zxsc gvm, 
                  dsze gvr
            WHERE gvm.vesl_master_num = gvr.vesl_master_num
              AND GVR.ROTATION_NO(+) = GVCH.ROTATION_NO
              AND gvch.rotation_no LIKE '%' || nvl(P_ROTATION_NO,gvch.rotation_no) || '%'
              AND gvr.cm_regn_no LIKE '%' || nvl(P_CM_REGN_NO,gvr.cm_regn_no) || '%'
              AND gvm.vesl_name LIKE '%' || nvl(P_VESL_NAME,gvm.vesl_name) || '%'
              AND gvm.vesl_no LIKE '%' || nvl(P_VESL_NO,gvm.vesl_no) || '%'
              AND gvch.imp_close_sta LIKE '%' || nvl(P_FINAL_CLOSE_STA,gvch.imp_close_sta) || '%'
              AND gvch.created_date BETWEEN nvl(P_FROM_REG_DATE,gvch.created_date) AND nvl(P_TO_REG_DATE,gvch.created_date)
              AND gvch.arrival_date BETWEEN nvl(P_FROM_ARRIVAL_DATE,gvch.arrival_date) AND nvl(P_TO_ARRIVAL_DATE,gvch.arrival_date)
              AND gvm.is_valid = 10;
            ORDER BY gvch.rotation_no;
    END;Regards
    Etbin
    Edited by: Etbin on 8.4.2012 14:37
    In order not to waste your time in the future:
    Don't execute dynamic SQL until it works !!!
    Write out what you managed to put together using dbms_output.
    Paste that into the SQL window of your client tool (SQL Developer ...)
    Convert parameters to bind variables (replace p_ with :p_)
    Try to run it.
    If errors are thrown correct them, adjust the procedure/function set up to write your dynamic SQL accordingly
    Repeat the cycle until no errors are thrown
    Comment out the dbms_output. ... line
    Uncomment the execute immediate ... line

  • Bind variables are not used in select statement

    Hello all of you,
    I have two parameters in Report 6i.
    1) Department
    2) Section
    There are many section in a single department. Both parameters are selected from list. The list for department name is as follows -
    select deptname from department_master order by deptname
    It works very well. The value is stored in :p_dept_name.
    I want to display section of selected department only using following code :-
    select sectname from section_master a, department_master b where a.deptcode = b.deptcode and b.deptname = :p_dept_name
    The value is stored in :p_sect_name.
    But it does not work. bind variables are not allowed in select statement, then how can I do this???
    Please suggest me.
    Thanx,
    Regards,

    Vikas,
    the forum is full of threads about that.
    Dependent Parameters in Reports are possible out-of-the-box in Reports.
    If you're running your report on the web, have a look at Metalink Note:185951.1
    Regards
    Rainer

  • Update_Task results in ORA-01006: bind variable does not exist - bug?

    Hi,
    I have successfuly created projects/tasks, and updated projects. However, when I tried to call pa_project_pub.update_task, I get an error
    U(nexpected):
    PROCEDURE_NAME update_one_task
    PKG_NAME PA_PROJECT_PVT
    FND FND_AS_UNEXPECTED_ERROR
    ERROR_TEXT ORA-01006: bind variable does not exist
    As far as I can see, this must be a bug, because the API must have created an excecute immediate/dbms_sql statement with at least one extra bind variable (i.e. execute '... :a, :b' using a, b, c)
    I've tried with different combinations of arguments to the API, all resulting in the same error:
    The id's and data are taken from a an already created project/task in my apps-instance:
    pa_project_pub.update_task(
    p_api_version_number => 1.0
    ,p_commit => xxpa_opop2pa_interface_utils.g_FALSE
    ,p_msg_count => l_msg_count
    ,p_msg_data => l_msg_data
    ,p_return_status => l_return_status
    ,p_pm_product_code => l_pm_product_code
    ,p_pm_project_reference => '100394'
    ,p_pm_task_reference => 'add_task_1.0'
    -- ,p_ref_task_id => ''
    ,p_task_number => 4
    -- ,p_pa_task_id => '19079'
    ,p_task_name => 'add_task_1.0'
    ,p_long_task_name => 'p_task_name'
    ,p_task_start_date => p_start_date
    ,p_task_completion_date => p_completion_date
    ,p_task_description => 'update-task:'||p_description
    ,p_out_pm_task_reference => l_out_pm_task_reference
    ,p_out_pa_task_id => p_task_id_out
    Am I missing anything, or this really must be a bug in the API?
    Does anyone have any other idea?
    I have looked at the API implementation, and found a use of dbms_sql, a long code constructing a statement then binding variables in if-then clauses.
    Regards,
    ps: ->
    system info
    Database Server
    RDBMS : 11.1.0.6.0
    Oracle Applications : 12.0.6
    System Date : 11-MAY-2009 10:41:50
    Forms Server
    Current Form
    Form Application : Application Object Library
    Form Name : FNDPOMPO
    Form Version : 12.0.2
    Form Last Modified : $Date: 2006/03/23 13:54 $
    Forms
    APPSTAND : 12.0.6.12000000.3
    FNDPOMPO : 12.0.2
    FNDSCSGN : 12.0.14.12000000.3
    Form Menus
    FNDMENU : 12.0.2
    Forms PL/SQL
    APPCORE : 12.0.21.12000000.13
    CUSTOM : 12.0.0
    FNDSQF : 12.0.3
    GHR : 12.0.22.12000000.26
    GLOBE : 12.0.62.12000000.13
    GMS : 12.0.42.12000000.11
    IGILUTIL2 : 12.0.24.12000000.3
    IGILUTIL : 12.0.1.12000000.3
    OPM : 12.0.7.12000000.2
    PQH_GEN : 12.0.7
    PSA : 12.0.17
    PSAC : 12.0.4.12000000.2
    PSB : 12.0.2
    VERT1 : 12.0.0
    VERT2 : 12.0.0
    VERT3 : 12.0.0
    VERT4 : 12.0.0
    VERT5 : 12.0.0
    VERT : 12.0.0
    **********************

    Hello,
    This issue is fixed in the bug 4692368. So you can get a patch from Oracle.
    Hope this helps !
    Thanks,
    Sathish
    www.projectsaccounting.com

  • Error: Bind Variable Does not Exist

    Hello,
    I am getting a bind error, Although I have only one bind variable, the debug output shows three bind parameters exist. Please let me know why this happens ?
    04/08/11 17:02:50 [5341] SELECT Property.PID, Property.CID, Property.REO, Property.MLS, Property.ADDRESS, Property.CITY, Property.STATE, Property.ZIP, Property.FAX, Property.TEL, Property.STYLE, Property.NROOMS, Property.NBEDS, Property.NBATHS, Property.SQFT, Property.AGE, Property.LPRICE, Property.LDATE, Property.EXPDATE, Property.FCDATE, Property.REDEMPTIONDATE, Property.MORTGAUGER, Property.FNAME, Property.FID, Property.BPOVALUE, Property.BPODATE, Property.WDATE, Property.TRASHOUT, Property.LAWNCARE, Property.REKEYED, Property.VACANCYSTATUS, Property.LOCKBOX, Property.PROPSTATUS, Property.LAGENT, Property.ENTRY, Property.USERID, Property.CONTACTID, Property.TAXID, Property.COBORR, Property.BORCONTACT FROM PROPERTY Property WHERE (Property.USERID = :1)
    04/08/11 17:02:50 [5342] Bind params for ViewObject: PropertyView1
    04/08/11 17:02:50 [5343] Binding param 1: 10097
    04/08/11 17:02:50 [5344] Binding param 2: 10097
    04/08/11 17:02:50 [5345] Binding param 3: 10097
    04/08/11 17:02:50 [5346] ViewObject: PropertyView1 close single-use prepared statements
    04/08/11 17:02:50 [5347] QueryCollection.executeQuery failed...
    04/08/11 17:02:50 [5348] java.sql.SQLException: ORA-01006: bind variable does not exist

    setWhereClauseParams must have been called on this VO to set more than required number of parameters. Could you check for that possibility?

Maybe you are looking for

  • Error in LSMW for MM41 - "No batch input data for screen SAPLMGMW 0100"

    I'm trying to create an LSMW for MM41 to create new Retail articles en Mass. This will be used to only create the Basic view as other LSMW's already exist to maintain the other views. I've created the Recording and setup the LSMW already. My data is

  • Grand total on a calculated item

    Hi, I have a crosstab report in discoverer plus 10g. I need to show total at the bottom for two calculated columns, report looks something like below      COMPANY     Beginning Bal     Ending Bal     Net Amount      1457     $35,467.90      $39,875.8

  • Default value for choice list in af:query panel

    Hi all, I have af:queryPanel in which i made one choicelist with static list.i want to have the first value of the static list as a default value to the field in af:queryPanel.how can i achieve this. I am using jdev11.1.1.5 Thanks in advance

  • Mass upload contract with "Distribute Contract to Catalog" flag

    I need to mass upload contract to update the flag "Distribute Contract to Catalog" (for srm mdm). What are the options. I don't see any option of that flag in the screen "Change Contracts: Mass Processing"

  • Host has disabled mysql_pconnect - Make DW ADDT use mysql_connect

    My host has recently disabled mysql_pconnect for 'security reasons' and its upset my Mac Dreamweaver CS4 installation. I've researched possible solutions and have updated the following files with mysql_connect instead of pconnect connection_includefi