XSQL ERROR with bind-params in ref-cursor-function

Hi Steve
I always get the error
ORA-01006 bind variable does not exist
when using a bind variable in a <xsql:ref-cursor-function> action element.
when I replace the bind variable with a @ - parameter substitution, all works fine.
My configuration:
XSQL 1.0.4.1 on Win200Pro ,Apache + Jserv + DB from ORA 8.1.7 installation
My Source
<xsql:ref-cursor-function
dbconn="ekat"
eblike="%"
list="a0"
bind-params="eblike"
include-schema="no"
null-indicator="no"
id-attribute=""
fetch-size="500"
>
{@dbconn}o.ekatkategcv.open_cv_ebh ('{@list}', :1)
</xsql:ref-cursor-function>
( dbconn selects my schema, not changed often, which contains package ekatkategcv with
function open_cv_ebh returning a cursor)
Any fix would be appreciated to avoid reparsing on each call.
BTW, is it right, that a ref-cursor funtion is reparsed whenever the content of
a parameter used with @ changes?
Best regards
H.Buschmann ([email protected])
null

I have tried it using ? instead of :1, this method works fine.
I haven't tried the name method (:bindvar) yet.
Until now, I only used xsl:query and xsql:ref-cursor-function, so I didn't check
the other action handlers with bind variables like :1
null

Similar Messages

  • Can the return from xsql:ref-cursor-function be saved & looped through XSQL?

    If <xsql:ref-cursor-function> returns one field for a number of rows, is there a way to save those values and loop through the data retrieved for other query process within XSQL? Any example?
    Thanks.
    null

    You have a couple of options.
    You can process the XML returned by <Xsql:ref-cursor-function> as the normal part of XSLT processing, or you can write a custom action handler that aggregates the action handler for <xsql:ref-cursor-function> and then uses DOM to operate on the return value.
    Search the Online XSQL Pages Documentation for the term "MyIncludeXSQLHandler" for some sample code that illustrates building a customer action handler that aggregates one of the built-in handlers.

  • Tester: tests a View with bind params?

    Test a View with the right click on the AM, Test, that has
    bind params?
    After much searching the Help and this forum, I can't find the
    post that explained how to wrap another View to front end a
    SQLView/View with bind params.
    Thanks, curt

    Just as I posted this I thought of the search string that worked.
    I searched on "bind param" and oddly only one page of hits and
    the explanation on how to create a ViewHolder and ViewLink to
    front end a View with bind params and then to test it is in
    this message:
    Re: Getting message failed to load the following objects when opening any fmb
    curt

  • Using BIND VARIABLES in REF CURSOR(s)

    Hello I am having trouble making my pl/sql program work using bind variables.
    here is a little snipit from my code:
    declare
    type ref_type is REF CURSOR;
    ref_cursor ref_type;
    summation_table varchar2(4000);
    begin
    summation_table := 'table_sum tsum';
    open ref_cursor for
    select * from :summation_table
    where tsum.revenue = 1000
    USING summation_table;
    end;
    The Error that I get is
    "bad bind variable 'summation_table'"
    could someone please help? I think the way 'tsum' is used could be a problem, but I don't know.

    SQL> CREATE TABLE TABLE_SUM(REVENUE NUMBER(10),
      2                         OTHER   NUMBER(10));
    Table created.
    SQL> INSERT INTO TABLE_SUM VALUES(1000,1);
    1 row created.
    SQL> INSERT INTO TABLE_SUM VALUES(1000,2);
    1 row created.
    SQL> variable alpha refcursor
    SQL> INSERT INTO TABLE_SUM VALUES(2000,3);
    1 row created.
    SQL> DECLARE
      2     summation_table varchar2(30) := 'table_sum tsum';
      3     PROCEDURE MYTEST(p_out out sys_refcursor)
      4     IS
      5     BEGIN
      6       OPEN p_out for 'select * from '||summation_table||
      7                      ' where tsum.revenue = :val' using 1000;
      8     END;
      9  BEGIN
    10     MYTEST(:alpha);
    11  END;
    12  /
    PL/SQL procedure successfully completed.
    SQL> print alpha
       REVENUE      OTHER
          1000          1
          1000          2
    SQL>

  • Bind Variables in ref cursor

    Version details
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for Solaris: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - ProductionBelow is the procedure where I'm using ref cursor
    CREATE OR REPLACE PROCEDURE ref_sample
    p_account_nbr     in     varchar2,
    p_ref_out          out     sys_refcursor
    IS
    BEGIN
         OPEN p_ref_out FOR
         SELECT     account_nbr,status,(
                                            CASE
                                                 WHEN status = 'Pending' THEN
                                                      req_mail_date
                                                 WHEN status IN ('Rejected','Approved') THEN
                                                      NVL(verified_mail_date,req_mail_date)
                                            END
                                            )req_mail_date ,
                                                 CASE
                                                      WHEN status = 'Pending' THEN
                                                           NULL
                                                      WHEN status IN ('Rejected','Approved') THEN
                                                           NVL(verified_user_id,req_user_id)
                                                 END
                                            )req_user_id
         FROM     X_tbl
         WHERE     account_nbr IN p_account_nbr
                   AND TRUNC(upload_date) = TRUNC(SYSDATE)
         ORDER BY upload_date DESC ;
    END;
    /My input parameter p_account_nbr looks like ('a1','a2','a3')
    Now,after knowing the importance of bind variables I'd like to make use of them in the above ref cursor.
    But,here my input parameter is a string of varying length..either I've to go for the approach suggested here
    http://asktom.oracle.com/pls/asktom/f?p=100:11:3667281145899708::::P11_QUESTION_ID:110612348061
    or
    http://www.dba-oracle.com/t_cursor_sharing.htm
    I'm not much clear with the first approach,so I'm thinking of to modify my procedure as below
    CREATE OR REPLACE PROCEDURE ref_sample
    p_account_nbr     in     varchar2,
    p_ref_out          out     sys_refcursor
    IS
    BEGIN
         alter session set cursor_sharing=force;
         OPEN p_ref_out FOR
         SELECT     account_nbr,status,(
                                            CASE
                                                 WHEN status = 'Pending' THEN
                                                      req_mail_date
                                                 WHEN status IN ('Rejected','Approved') THEN
                                                      NVL(verified_mail_date,req_mail_date)
                                            END
                                            )req_mail_date ,
                                                 CASE
                                                      WHEN status = 'Pending' THEN
                                                           NULL
                                                      WHEN status IN ('Rejected','Approved') THEN
                                                           NVL(verified_user_id,req_user_id)
                                                 END
                                            )req_user_id
         FROM     X_tbl
         WHERE     account_nbr IN p_account_nbr
                   AND TRUNC(upload_date) = TRUNC(SYSDATE)
         ORDER BY upload_date DESC ;
         alter session set cursor_sharing=exact;     
    END;
    /Please let me know if the above modified code is fine or should I use bind variables??Also let me know better approach of both.

    The correct way to do this is use an array type for the input values as in this example.
    SQL> create or replace procedure p
      2      (
      3      p_values sys.odcivarchar2list,
      4      c out sys_refcursor
      5      ) as
      6  begin
      7      open c for
      8         select object_name, owner, object_type
      9         from all_objects
    10         where object_name in (select column_value from table(p_values));
    11  end;
    12  /
    Procedure created.
    SQL> var c refcursor
    SQL> exec p (sys.odcivarchar2list('DUAL','USER_VIEWS'), :c)
    PL/SQL procedure successfully completed.
    SQL> print c
    OBJECT_NAME                    OWNER                          OBJECT_TYPE
    DUAL                           SYS                            TABLE
    DUAL                           PUBLIC                         SYNONYM
    USER_VIEWS                     SYS                            VIEW
    USER_VIEWS                     PUBLIC                         SYNONYM
    SQL> exec p (sys.odcivarchar2list('DUAL','USER_VIEWS','ALL_OBJECTS','ALL_SOURCE'), :c)
    PL/SQL procedure successfully completed.
    SQL> print c
    OBJECT_NAME                    OWNER                          OBJECT_TYPE
    DUAL                           SYS                            TABLE
    DUAL                           PUBLIC                         SYNONYM
    ALL_OBJECTS                    SYS                            VIEW
    ALL_OBJECTS                    PUBLIC                         SYNONYM
    USER_VIEWS                     SYS                            VIEW
    USER_VIEWS                     PUBLIC                         SYNONYM
    ALL_SOURCE                     SYS                            VIEW
    ALL_SOURCE                     PUBLIC                         SYNONYM
    8 rows selected.
    SQL>That and other methods are described here.
    http://tkyte.blogspot.com/2006/06/varying-in-lists.html
    You would not use dynamic SQL.

  • Trouble with Bulk Collect to Ref cursor

    I'm trying to open a ref cursor to a dynamic query, and the fetch the cursor (BULK COLLECT)to the table type variable.But I keep getting the compilation error as 'PLS-00597: expression 'EMP_RESULTSET' in the INTO list is of wrong type'
    But when I use a simple select from a table and Bulk Collect directly to the table type variable it works. But that is not what I want.
    Can someone tell me where I have gone wrong in this stored proc I have listed below.
    your help will be highly appreciated.
    PROCEDURE SP_TEST_EMP_TABLE_TYPE (
          p_resultset OUT result_cursor          -- ref cursor as out parameter
       AS
        TYPE TYPE_REC_EMP is RECORD(EMPNO EMPLOYEE.EMPNO%TYPE, JOIN_DATE EMPLOYEE.JOIN_DATE%TYPE, SALARY EMPLOYEE.SALARY%TYPE); -- declare record type
        TYPE TYPE_TAB_EMP IS TABLE OF TYPE_REC_EMP;    -- declare table type
        EMP_RESULTSET TYPE_TAB_EMP; -- declare variable of type type_calendar_avail_resultset  
        SQUERY VARCHAR2(32000):='';
       BEGIN
        SQUERY:='SELECT EMPNO,JOIN_DATE,SALARY FROM EMPLOYEE WHERE EMPNO= 1001 AND JOIN_DATE=''20070530'' ';
        --select EMPNO,JOIN_DATE,SALARY BULK COLLECT INTO EMP_RESULTSET from  EMPLOYEE WHERE EMPNO=1001 AND JOIN_DATE='20070525';
        OPEN p_resultset FOR SQUERY;
          FETCH p_resultset BULK COLLECT INTO EMP_RESULTSET;
      EXCEPTION
          WHEN NO_DATA_FOUND
          THEN
             NULL;
          WHEN OTHERS
          THEN
             DBMS_OUTPUT.put_line (SQLERRM (SQLCODE));   
       END SP_TEST_EMP_TABLE_TYPE ;

    > i) I use a ref cursor to return back to the java
    front end, so I had to use a ref cursor.
    What is a ref cursor? It is not a data set. It is a pointer to a "SQL program". This program is created by the SQL Engine and the CBO that parses the SQL source code and determine an execution plan to get to the requested rows.
    When the client fetches from a (ref) cursor, the client is running this program and it find and returns the next row.
    There is no such thing as a physical result set for a cursor - no "copy" of the rows found for the source code SQL is made as a result set.
    > ii) I also use a dynamic sql, but I was thinking it
    wasn't useful for this posting, so tried to write a
    simple sql
    What is dynamic SQL? SQL where object names (e.g name of the table) is only known at run-time. Or where the filter (e.g. WHERE conditions) can only be determined at run time.
    If these are known, the SQL is static SQL.
    For both static and dynamic SQL, bind variables are critical. It is the biggest performance mistake (in Oracle) to hardcode values and literals into a SQL.
    > ii) I use a Bulk Collect to the table type
    collection, since I use a loop, for which I had to
    collect the results from each loop and finally send
    the resultset thru the ref cursor.
    Impossible. Nor does it make any sense. As stated, a ref cursor is a program and not a result set.
    What you intend to do is run a SQL against data. Copy this data into private/local PL/SQL memory. Construct another SQL against this data - which means that it needs to be shipped back to the SQL engine as it cannot use/read local PL/SQL memory structures. And the pass that SQL cursor to the client.
    What for?
    > I had earlier used the logic to for this using a
    temporary table, which works perfectly fine, but our
    DBA says we should avoid temporary tables since it
    makes additional read/write to the disk. This is the
    reason I'm using table type collection here.
    Your DBA is correct. One should so a single pass through a data set. Which is why simply passing a ref cursor for a SQL statement to the client is the simplest.
    It makes no sense copying SQL data into a collection and then copying that back into the SQL engine in order to throw a ref cursor around it.
    Basic client-server fundamentals.
    And why RTFM the Oracle manuals I've indicated is important. You need to understand the memory and processing architectures in Oracle in order to make an informed and correct decision.

  • JDev11g : Problem with Binding param (viewcriteria)

    When I bind some variables (2 type number and 2 type date) to viewCriteria and start the web site I get very strange problem.
    The Binding param is almost random (I set on binding variables Binding position), and because of this I get constant SQL errors (Invalid type and so on).
    Some data from server log
    First start of server:
    [ pre]
    <strong>[8945]Binding null of type 12 for 1</strong>
    <strong>[8946] Binding null of type 12 for 2</strong>
    <strong>[8947] Binding param 3: 41</strong>
    <strong>[8948] Binding null of type 12 for 4</strong>
    <strong>[8949] Binding param 5: 148</strong>
    <strong>[8950] Binding param 6: 148</strong>
    <strong>[8951] Binding param 7: 148</strong>
    Second start of server:
    <strong>[9213] Binding null of type 12 for 1</strong>
    <strong>[9214] Binding null of type 12 for 2</strong>
    <strong>[9215] Binding null of type 12 for 3</strong>
    <strong>[9216] Binding param 4: 41</strong>
    <strong>[9217] Binding null of type 12 for 5</strong>
    <strong>[9218] Binding param 6: 148</strong>
    <strong>[9219] Binding param 7: 148</strong>
    <strong>[9220] Binding param 8: 148</strong>
    [ pre]
    And view criteria query looks like this :
    FROM_DATE (binded to variable fromDate_bind type DATE and binding position set to 1)
    TO_DATE (binded to variable toDate_bind type DATE and binding position set to 3)
    WORKER_ID (binded to variable worker_bind type NUMBER and binding position set to 2)
    CLASS (binded to variable class_bind type NUMBER and binding position set to 4)
    [ pre]( ( ( ( FROM_DATE &gt;= ? ) OR ( ? IS NULL ) ) AND (WORKER_ID = ? ) AND ( ( TO_DATE &lt;= ? ) OR ( ? IS NULL ) ) AND ( ( CLASS = ? ) OR ( ? IS NULL ) ) ) )
    This viewCriteria is shown on page as af:query (simple search form) and outputs results on af:table.
    Is there any way to solve this random parameter binding?
    Rok Kogov&scaron;ek

    check out the fileUpload article
    Using the File Upload Component
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/file_upload.html

  • Using bind variable for ref cursors

    Hi
    I have a procedure that recieves a tablename in srcTable variable . A query is formed SELECT_Q with values from global varray.
    Table name will be dynamic and query is to be used with a ref cursor. Since table name is not known how to make the refcursor.
    tried the following.....not sure how to do it. pls help.
    PROCEDURE Process1(srcTable VARCHAR2, trgTable VARCHAR2) IS
         TYPE CURSORTYPE IS REF CURSOR RETURN :x%ROWTYPE;
         REC_CUR CURSORTYPE;
         REC_CUR_DATA :x%ROWTYPE;
         DBMS_SQL.BIND_VARIABLE(REC_CUR, ':x', SourceT);
         DBMS_SQL.BIND_VARIABLE(REC_CUR_DATA, ':x', SourceT);
         COUNTi NUMBER :=0;
         SELECT_Q VARCHAR2(1000) := 'SELECT ';
    BEGIN
    FOR COUNTi IN 1..COLUMN_NAME_ARR.COUNT-1 LOOP
              SELECT_Q := SELECT_Q || COLUMN_NAME_ARR(COUNTi) || ',';
    END LOOP;
         SELECT_Q := SELECT_Q || COLUMN_NAME_ARR(COLUMN_NAME_ARR.COUNT) || ' FROM '||SourceT;
         DBMS_OUTPUT.PUT_LINE(SELECT_Q);
    -- query to be used for making cursor.
    ---how to make the cursor
         OPEN REC_CUR FOR Select_Q;
         LOOP
         FETCH REC_CUR INTO REC_CUR_DATA;
         EXIT WHEN REC_CUR%NOTFOUND;
         END LOOP;
    END TableSnapShot_Process1;

    For online books you can start with the documentation.
    PL/SQL Packages and Types Reference
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14258/toc.htm
    PL/SQL User's Guide and Reference
    http://download-east.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm
    Print books
    Oracle PL/SQL Programming By Steven Feuerstein is good book to have.
    http://www.oreilly.com/catalog/oraclep4/

  • Can I use a VO with Bind Params as an LOV?

    And if so, how can I specify the values to be used for the Bind Params at runtime?
    I am trying to think outside the box for dependent dynamic lists...
    Thanks.

    A little more info...
    I have tried adding an Action to my pageDef Bindings:
    <action IterBinding="DelegationsWithScopeTypeParamIterator"
    id="ExecuteWithParams1"
    InstanceName="EVCServiceDataControl.DelegationsWithScopeTypeParam"
    DataControl="EVCServiceDataControl" RequiresUpdateModel="true"
    Action="95">
    <NamedData NDName="ScopeTypeIdVar" NDValue="${userState.currentType}"
    NDType="oracle.jbo.domain.Number"/>
    <NamedData NDName="CurUserIdVar"
    NDValue="${sessionScope.userState.currentUserId}"
    NDType="oracle.jbo.domain.Number"/>
    </action>
    And an invokeAction to the Executables:
    <invokeAction id="ReloadScopeList" Binds="ExecuteWithParams1"
    Refresh="prepareModel" RefreshCondition="true"/>
    Now, how do I get ReloadScopeList to do its thing when a user selects a value in one selectOneChoice list so the second selectOneChoice list's iterator will be updated? Am I crazy?
    Thanks,.

  • Regarding the Ref Cursor functional;ity

    HI,
    I am using ref cursor to return Result Set to .Net.
    I am in doubt that , Is it requires multiple server trips to fill the DataSet at front end.
    As my assumption it will return the address of the work area provided in Oracle server. After that for each row it make a server trip .
    Is my assumption is right ?
    Can any one tell me the functionality behind returning a Ref Cursor .
    Thank you....

    This is (or ought to be) configurable on the .NET side. There will be a server round-trip to fetch every N records where N is a setting on the client. I'm not particularly experienced with .NET, so I'm not sure where this setting is set, but the folks over in the .NET forum might.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Call ref cursor functions in function also returning ref cursor?

    In 10g database, I have several functions and procedures, some packaged, that return ref cursors. These work as expected.
    Is there a way to call one or more of these in a new function and return another ref cursor?
    I know this doesn't work, but I hope it conveys the idea.
    function f_get_order_lines
       return sys_refcursor -- or defined ref cursor
    is
      v_ords orders_rcr;
      v_lines lines_rcr;
      x sys_refcursor;
    begin
      v_ords := f_get_orders;
      for rec in v_ords
       loop
        v_lines := f_get_lines;
       ... do other work here...
      end loop;
    return x;
    end;

    Pipelined table functions might do the trick for you, depending you your requirements and the transformations you need to make:
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/tuning.htm#sthref2345

  • Ora-01008 error with bind variable

    Hi,
    We have a test program which have one bind variable on a column which is varchar2(20), in the test program we've passed a 20 character string to the variable. The program returns error in one of the databases but all others are successful. We've checked the column is same in all of them.
    Exception in thread "main" java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
    ORA-01008: not all variables bound
    Could you please advise how to troubleshoot this issue?
    Regards

    We aren't going to be able to help you if you won't post the database code that is giving the error.
    And now we need the Java code that is constructing the query that you are using.
    Your error is saying there is a second variable that you are not providing a value for.
    And you said
    >
    We have a test program which have one bind variable on a column which is varchar2(20), in the test program we've passed a 20 character string to the variable.
    >
    But you are using a string that is 23 characters long
    "a3g34-b13fd-efaie-f83fk"How does 23 go into 20?

  • App Builder produces "Not Executable" error with Strictly Typed VI Refs

    There is a very frustrating problem with the app builder in LV 8.0.1.  Certain VIs compile and run fine in labview, but the app builder
    refuses to make them into applications.
    The error message is very long and ends with something like "The VI is not
    executable".  Standard advice for this problem is to force LV to recompile
    everything you're building by either mass compiling or ctrl-shift clicking the
    run arrow, but this hasn't worked for me in two separate cases (completely
    different projects).
    It seems that this problem is caused by wiring a strictly typed VI reference to
    an invoke node with the FP.open method selected.  In both cases I resolved
    the issue by changing the Static VI Reference to be weakly typed (right-click
    the static vi reference and make sure "Strictly Typed VI Reference"
    is unchecked). After that, the project build successfully.
    This is very hard for a user to track down for several reasons:
     - The error message in the application builder does not give any
    indication as to what the real problem is
     - The app builder reports that the top-level VI is broken, even when the
    strictly typed reference and invoke node may occur in a sub VI
     - Nothing (that I can
    find at least) in the documentation suggests that strictly typed references
    won't work with the Open.FP method. 
    There is a page that says "some of the properties and methods do
    not work when you configure this function to output a strictly typed VI
    reference," but no indication is given of which methods fail
    Note that in one case I was also able to make the project
    build by deleting an instance of "IMAQ Create.vi" from the top-level
    VI.  I 
    have no explanation for this.
    Hopefully this post will save some other users the trouble
    of tracking this down and maybe even get NI to correct the issue for future
    versions.
    Adam Brewster

    Hello Adam,
    Thank you for sharing your experience and insight.  Your post was well thought-out and offered a
    good description of the problem as well as some possible workarounds.  I believe that the issue has been filed and
    is under investigation (3TU8T8V9).  Feel
    free to post back after the next LabVIEW release and inquire as to its status.
    Thanks again,  
    Travis M
    LabVIEW R&D
    National Instruments

  • Syntax error with ' ' in param

    Hi,
    Can anybody can tell me what is wrong with my sytax, I'm using sample kindly provided to me in earlier thread by Tubby(c) like below, which works fine from SQL+ as we can see. But then I tried to apply this approach to code insdie my PACKAGE BODY and it fails, telling me:
    create or replace --procedure
    PACKAGE BODY UPK_nuls_CRUD_Ryba AS
    PROCEDURE usp_nuls_idryba_01 (open_Cursor_Ryba OUT CURSOR_Ryba, act_date IN date) IS
    BEGIN
    OPEN open_Cursor_Ryba FOR
    ' SELECT * FROM nuls.t_pool_cust partition (' || act_date || ')' ;
    END;
    END ;
    ORA-00933: SQL command not properly ended
    ORA-06512: at "nulsADMD.UPK_nuls_CRUD_Ryba", line 4
    ORA-06512: at line 7
    All partition are fine and exist, how to twick that qoutes to make it work? can I use execute immediate? or ..
    Please help. That really killing me, will take a break for yoga....
    Tx to all and Tobby.
    V
    TUBBY_TUBBZ?TUBBY_TUBBZ?
    TUBBY_TUBBZ?
    TUBBY_TUBBZ?
    variable x refcursor;
    TUBBY_TUBBZ?
    declare
    l_partition_name varchar2(300) default 'p1';
    begin
    4
    open :x for
    'select * from t1 partition (' || l_partition_name || ')';
    end;
    8 /
    PL/SQL procedure successfully completed.
    Elapsed: 00:00:00.01
    TUBBY_TUBBZ?print :x
    PARTITIONID NAME
    2 value2
    1 row selected.
    Elapsed: 00:00:00.01
    TUBBY_TUBBZ?

    Syntaxically, its correct, but you need to debug the issue here. I doubt the date format, with which the partition is created in the table and what you are trying out here
    Declare a local parameter, assign the sql statement for it....print the sql actual sql statement which is going to be parsed in the cursor.
    So if any issue is due to the date, you can resolve it out
    Note, I have declare a local variable L_SQL and assigned the sql statement to it.
    create or replace
    PACKAGE BODY UPK_nuls_CRUD_Ryba AS
    PROCEDURE usp_nuls_idryba_01 (open_Cursor_Ryba IN OUT CURSOR_Ryba, act_date IN date) IS
    l_sql varchar2(4000);
    BEGIN
    l_sql := ' SELECT * FROM nuls.t_pool_cust partition (' || act_date || ')' ;
    dbms_output.put_line(l_sql);
    OPEN open_Cursor_Ryba FOR  l_sql;
    END;
    END

  • Error with Bind Variable for dblink

    Good morning,
    I am attempting to implement some code in a pre-page process but having problems with it. I need to query a value from the database using a dblink that points at a different database depending upon the session. I have tried the following two approaches...
    SELECT COALESCE(Attribute20,'PENDING')
    INTO str_Import_Status
    FROM GL_JE_LINES@&P0_INSTANCE.
    WHERE JE_HEADER_ID = :P430_JE_HEADER
    AND JE_LINE_NUM = :P430_JE_LINE;
    as well as...
    str_SQL_Statement := 'SELECT COALESCE(Attribute20,''PENDING'') '||
    'INTO str_Import_Status '||
    'FROM GL_JE_LINES@'||:P0_INSTANCE||' '||
    'WHERE JE_HEADER_ID = '||:P430_JE_HEADER||' '||
    'AND JE_LINE_NUM = '||:P430_JE_LINE||';';
    EXECUTE IMMEDIATE str_SQL_Statement;
    I am boggled because I completely expected the first approach to work. I have a similar statement in a post submit process which works fine. That statement is...
    SELECT COUNT(*)
    INTO num_Collector_Count
    FROM XXMC_GL_TSG2FIMS_CROSSREF@&P0_INSTANCE.
    WHERE Collector_Code = :P915_Collector_Code;
    Any help or pointers on this would be greatly appreciated.
    --Adam Cumming                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Never mind....
    After I posted this I realized I had a bad variable name. Syntax error

Maybe you are looking for