Ref No

Hi
   I am entering openings bill wise through AR invoice  , item type = service and entering bill no in ref no , bill date in posting date
. Entries are appearing in Incoming Payments , but i want ref no should also appear . How that can be done.
Thanks

Hi.........
I think while doing incoming payment the option is there for display customer ref. no. You need to just tick that box......
Regards,
Rahul

Similar Messages

  • Excise Invoice is captured with another Po  -During MIGO- Only refer Excise

    Hi,
    I have did a PO with two line item say Material M1 and M2..
    step1-  We did J1IEX with capture excise invoice option for material M1 and M2.
    step 2-  We did GR for material M1 only where i have selected my excise tab as Only refer Excise
    step 3-  Now we are trying to do GR for 2nd line item material M2, where we getting error msge as
    *Excise Invoice is captured with another Purchase Order
    Message no. 4F278*
    I have searched in forum and found related info in the belw links
    CIN related error at the time of GRN
    GR for Import PO,
    where experts are suggesting to apply a note 843490 &994052. seems these notes for older version.. my client version is ECC 6.03
    Please let me know if any note available or any other methods to solve my issue (we don't want to put the excise invoice with suffix of * or /1).
    regards
    Jay
    Edited by: Jayakumar Raju A.S on Sep 6, 2010 11:28 AM

    Hi,
    System takes only single excise invoice in system.
    here i suggest wat u can do ( very tricky)
    for first goods receipt excise invoice is 123
    then u cant give same for other GR it will give an error at this time u can provide excise invoice as (123.).
    Means one dot at beginnig or at the end.
    Note : Hence forth for same excise invoice u should have only one GR.

  • Odd error while opening a ref cursor

    Hi.
    I have a procedure in a package that has both in and out parameters. One of those out parameters is a ref cursor. The procedure creates a dynamic query and then executes it, then it opens the cursor:
    PROCEDURE PROC(
    A IN VARCHAR2,
    B IN VARCHAR2,
    C OUT TYPES.cursorType; --(TYPES is a package whose only use is to declare a cursor type)
    ) IS
    --DECLARATIONS
    OPEN C FOR 'SELECT A, B, C, D...';
    END;
    When I execute the package in an anonymous block it throws the error:
    ORA-00938: not enough arguments for function, just in the line where the cursor is being opened.
    Any ideas?

    is everything defined correctly?
    create or replace package types  as
      type cursorType is ref cursor;
    end types;
    SQL> set serveroutput on
    SQL> declare
      2 
      3    ref_C types.cursorType;
      4   
      5    v_a varchar2(1);
      6    v_b varchar2(1);
      7    v_c varchar2(1);
      8    v_d varchar2(1);
      9   
    10    procedure Proc (a in varchar2
    11                   ,b in varchar2
    12                   ,C out types.cursorType) as
    13 
    14      begin
    15        open C for 'select :1, :2, ''c'', ''d'' from dual' using a, b;
    16    end  Proc;
    17  begin
    18 
    19 
    20    Proc('a', 'b', ref_C);
    21   
    22    fetch ref_C into v_a, v_b, v_c, v_d;
    23    if (ref_C%found) then
    24      dbms_output.put_line(v_a);
    25      dbms_output.put_line(v_b);
    26      dbms_output.put_line(v_c);
    27      dbms_output.put_line(v_d);
    28    end if;
    29   
    30   
    31  end;
    32  /
    a
    b
    c
    dP;
    Edited by: bluefrog on Feb 18, 2010 6:07 PM

  • Error while determining ref.mov.type for WM via Table 156S: 647/ / / /L/ /

    Guyz,
    Firstly despite the plant+storage location + warehouse no. assignments are done , my replenishment delivery (delivery for stock transport order between plants under same company code) is not picking up storage location and warehouse no and thus stopping me from doing picking and PGI (post goods issue).
    However in VL02N when i'm trying to change storage location for line item, i'm getting following weird error
    *Error while determining ref.mov.type for WM via Table 156S: 647/ / / /L/ /*
    I found a SAP Note(133223) regarding this error and VL02 transaction but that note was specific to older versions. I'm on ECC 6.0
    Any suggestions please ?
    Thanks

    Warehouse managment has its own movement types, most identical to inventory management movement types.
    These WM movement types are determined via reference movement types.
    the error you have just looks like your customizing is not complete.
    IMG > LE > WM > Interfaces > IM > define movement types.

  • Friends, MacBook Pro 8,1 – Intel Core i5 – 2.23 GHz (early 2011)   New MB Pro with OSX 10.6 – current on all updates.  I successfully installed rEFit. I used Boot Camp to install Win 7.  All was great.  Then installed debian 6.  Somehow after the debian i

    MacBook Pro 8,1 – Intel Core i5 – 2.23 GHz (early 2011) New with OSX 10.6 – current on all updates.
    I successfully installed rEFit. I used Boot Camp to install Win 7.  All was great.
    Then installed debian 6.  Somehow after the debian install and restart (I know this sounds crazy) but I am now reduced to Win 7 only. rEFit is not present when rebooting nor is OSX or debian. Further, I am unable to force the install DVD to launch when rebooting, by holding C, D or F8.  The Option key brings me to the grey screen with a padlock. I have attempted the root and local pw- no go. Restart holding D takes me to the windows boot manager. I have attempted several options within the Advanced Options; including – Repair Your computer, safe mode and “last known good config,” All of which did nothing.
    I can see all my OSX files within win7. I tried to install the OSX within windows. Ya right, that did nothing..
    I only desire to get back to OSX...
    What are my options??

    Yes, you royally hosed up your machine.
    You should first try to get your files off, any way you can to a external drive.
    Your going to need to hold c and boot from the disk that came with your computer and a couple of screens in under the menu is a option for Disk Utility.
    Select your drive and Erase with Security Option Zero, format the drive HFS+ Journaled and when that's finished (about a hour or so) then quit and install OS X from the installer.
    I hope this works, but I suspect it won't. Others have hosed their machines trying to use a Linux disk without proper partition formatting too.
    Another option might be to use another Mac to c boot off the Snow Leopard disk and install OS X onto a external drive, take that to the problem Mac and try holding option and booting off of it to erase your internal drive.
    You could replace the drive.
    frederick s wrote:
     The Option key brings me to the grey screen with a padlock.
    Is this holding option while booting?
    There was someone else around here who hosed their Mac with a Linux disk too. Try to find it.

  • In Oracle 11g query, how can I refer to results of different column ....

    I want to be able to refer to the results of C1 in another column expression C2. I get ORA-00904: "C1" invalid identifier, which makes sense. I know that I can repeat the entire very long CASE again in my C2 DECODE, but wondering if I can save the server many extra cycles from evaluating the CASE again.
    SELECT [very long nested CASE statements] as C1, DECODE(C1,1,'YES','NO') as C2 FROM TABLE
    Many thanks,
    AK

    Hello
    You can't refer to the alias at the same level so you either have to repeat the CASE statement or wrap it in an inline view and refer to the alias in that. i.e.
    SELECT
        c1,
        DECODE(C1,1,'YES','NO') as C2
    FROM
            SELECT
                [very long nested CASE statements] as C1
            FROM
                FROM TABLE
        )HTH
    David

  • Processo de venda com referência à NFe de fornecedor

    Olá Pessoal,
    Existe um cenário de vendas que pretentem referenciar a NFe do fornecedor informando-a na OV, Cabeçalho, aba Contabilidade campo Referência.
    Por ser Venda Normal o campo J_1BNFDOC-DOCREF não é preenchido de forma standard.
    Vi no tópico http://scn.sap.com/thread/3238930 que posso preencher a estrutura OUT_REF pela BADI da NFe.
    Antes de eu iniciar o desenvolvimento, gostaria de saber se eu preencher a estrutura OUT_REF, o campo J_1BNFDOC-DOCREF vai ser preenchido posteriormente e poderei ver a referência na J1B3N ?
    Obrigado,
    Marcelo

    Marcelo,
    Pelo que vi o erro ocorre por faltar incluir a referência numa tabela interna (WREFOBJ).
    Nessa tabela vc precisaria inserir o número do doc referenciado no campo VBELN. --> WREFOBJ-VBELN.
    O check é feito no include LJ1BGF02, no FORM UPDATE_ORIGINAL_NF.
    Fiz alguns testes aqui, preenchendo as informações funciona na mão funciona, porém não sei qual o melhor momento, pois tem várias operações que levam em consideração o documento referenciado  - até dados da FCI ele busca com base no doc referenciado. Aí vc precisa ver bem como pode dar certo no seu caso.
    Abs,
    Eduardo Hartmann

  • Redeterminação de CFOP e Taxcode em OVs feitas com referência a Cotações

    Olá a todos,
    Gostaria de saber se existe alguma forma para que o CFOP e Codigo de Imposto (ou pelo menos 1 deles) sejam redeterminados em uma Ordem de venda quando esta é criada com referência a uma cotação?
    O cenário é bem obvio: Cotações são feitas aos clientes. O codigo de imposto e CFOP são pertinentes a uma venda normal.
    Porém, no momento que o cliente emite o pedido de compra ele informa que deseja que a venda seja uma Entrega Futura (que demandaria de um CFOP e Cod de Imposto diferentes), mas o taxcode e o CFOP que consigo na Ordem de venda são sempre puxados da cotação usada como referência.
    Já tentei até deixar o CFOP em branco na cotação pra ver se haveria uma redeterminação...mas obtive na OV o campo de CFOP tambem em branco.
    Já agradeço a atenção de todos!
    Obrigado
    Sergio Augusto

    Olá Filipe.
    Eu não sei lhe dizer o efeito disso nas suas ordens de venda pois sou de MM... mas por exemplo: uma vez que você já gerou o documento da nota fiscal o sistema tem esse comportamento de não atualizar os dados na nf após você fazer uma modificação nos dados mestres. Ou seja, esse é o comportamento normal e você precisa modificar e/ou fazer o refresh no documento.
    No passado os dados cadastrais (cliente/fornecedor) eram dinâmicos mas com a nf-e não é mais assim.
    Abraço
    Eduardo Chagas

  • Can Oracle view refer a table in Sql Server Database

    Can a view created in Oracle database refer a table created in SQL Server database. If yes, how do we do it. Code will be very help full.
    Again, if yes does it require any special software and what would be price of that software.
    Thanks for your response in advance.
    Venkat Sathiamurthy

    You would need to configure Oracle Heterogeneous Connectivity to create a database link to the SQL Server system. This can either be done via the Oracle Transparent Gateway for Microsoft SQL Server, which retails for $15,000 per server at http://store.oracle.com or by configuring Oracle Generic Connectivity and using ODBC to go after the SQL Server data. Depending on the operating system you run Oracle on, there may be a free (or cheap) ODBC driver for SQL Server that could be used.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Using REF with object table in SQL Developer

    When i create object tables and fill them with data, then in SQL Developer de REF value isn't displayed.
    I did the following:
    CREATE TYPE adres_type AS OBJECT
    (straat VARCHAR2(20)
    ,nummer VARCHAR2(10)
    ,postcode VARCHAR2(6)
    ,plaats VARCHAR2(50));
    CREATE TABLE adressen of adres_type;
    CREATE TYPE locatie_type AS OBJECT
    (nr NUMBER
    ,naam VARCHAR2(20)
    ,adres REF adres_type);
    CREATE TABLE locaties OF locatie_type;
    CREATE TABLE locaties OF locatie_type
    (SCOPE FOR (adres) IS adressen);
    insert into adressen values (adres_type('Arnhemsestraatweg', '33','6881ND','Velp'));
    insert into locaties values (1,'Directie', (select ref (a) from adressen a where a.plaats = 'Velp'))
    Then in SQL Developer de REF(A) column is empty, while in SQL*Plus it displays the REF value:
    In SQL Developer: SELECT a.*, REF(a) FROM adressen a;
    STRAAT NUMMER POSTCODE PLAATS REF(A)
    Arnhemsestraatweg 33 6881ND Velp
    In SQLPLUS: SELECT a.*, REF(a) FROM adressen a;
    STRAAT NUMMER POSTCODE PLAATS REF(A)
    Arnhemsestraatweg 33 6881ND Velp 0000280209C70341FBB96B4F77813B27B50E53BB4332382E22ADD64AD9B755F651D416B6DA010134
    Is this a bug or is there another reason why the ID doesnt display in SQL Developer.
    (this didnt work in all the previous SQL Developer releases and still not in de 2.1 E.A. version)

    Hi <not sure of your first name>,
    I have replicated the issues and logged a bug against this
    Bug 9102579 - FORUM: REF FUNCTION NOT RETURNING CORRECT RESULT
    Regards,
    Dermot O'Neill
    SQL Developer Team

  • Ref Cursor and For Loop

    The query below will return values in the form of
    bu     seq     eligible
    22     2345     Y
    22     2345     N
    22     1288     N
    22     1458     Y
    22     1458     N
    22     1234     Y
    22     1333     N
    What I am trying to accomplish is to loop through the records returned.
    for each seq if there is a 'N' in the eligible column return no record for that seq
    eg seq 2345 has 'Y' and 'N' thus no record should be returned.
    seq 1234 has only a 'Y' then return the record
    seq 1333 has 'N' so return no record.
    How would I accomplish this with a ref Cursor and pass the values to the front end application.
    Procedure InvalidNOs(io_CURSOR OUT T_CURSOR)
         IS
              v_CURSOR T_CURSOR;
         BEGIN
    OPEN v_CURSOR FOR
    '     select bu, seq, eligible ' ||
    '     from (select bu, seq, po, tunit, tdollar,eligible,max(eligible) over () re ' ||
    '          from (select bu, seq, po, tunit, tdollar,eligible ' ||
    '          from ( ' ||
    '          select bu, seq, po, tunit, tdollar, eligible, sum(qty) qty, sum(price*qty) dollars ' ||
    '               from ' ||
    '               ( select /*+ use_nl(t,h,d,s) */ ' ||
    '               h.business_unit_id bu, h.edi_sequence_id seq, d.edi_det_sequ_id dseq, ' ||
    '                    s.edi_size_sequ_id sseq, h.po_number po, h.total_unit tUnit, h.total_amount tDollar, ' ||
    '                    s.quantity qty, s.unit_price price,' ||
    '               (select (case when count(*) = 0 then ''Y'' else ''N'' end) ' ||
    '          from sewn.NT_edii_po_det_error ' ||
    '          where edi_det_sequ_id = d.edi_det_sequ_id ' ||
    '               ) eligible ' ||
    '     from sewn.nt_edii_purchase_size s, sewn.nt_edii_purchase_det d, ' ||
    '     sewn.nt_edii_purchase_hdr h, sewn.nt_edii_param_temp t ' ||
    '     where h.business_unit_id = t.business_unit_id ' ||
    '     and h.edi_sequence_id = t.edi_sequence_id ' ||
    '     and h.business_unit_id = d.business_unit_id ' ||
    '     and h.edi_sequence_id = d.edi_sequence_id ' ||
    '     and d.business_unit_id = s.business_unit_id ' ||
    '     and d.edi_sequence_id = s.edi_sequence_id ' ||
    '     and d.edi_det_sequ_id = s.edi_det_sequ_id ' ||
    '     ) group by bu, seq, po, tunit, tdollar, eligible ' ||
    '     ) ' ||
    '     group by bu, seq, po, tunit, tdollar, eligible)) ';
              io_CURSOR := v_CURSOR;
    END     InvalidNOs;

    One remark why you should not use the assignment between ref cursor
    variables.
    (I remembered I saw already such thing in your code).
    Technically you can do it but it does not make sense and it can confuse your results.
    In the opposite to usual variables, when your assignment copies value
    from one variable to another, cursor variables are pointers to the memory.
    Because of this when you assign one cursor variable to another you just
    duplicate memory pointers. You don't copy result sets. What you do for
    one pointer is that you do for another and vice versa. They are the same.
    I think the below example is self-explained:
    SQL> /* usual variables */
    SQL> declare
      2   a number;
      3   b number;
      4  begin
      5   a := 1;
      6   b := a;
      7   a := a + 1;
      8   dbms_output.put_line('a = ' || a);
      9   dbms_output.put_line('b = ' || b);
    10  end;
    11  /
    a = 2
    b = 1
    PL/SQL procedure successfully completed.
    SQL> /* cursor variables */
    SQL> declare
      2   a sys_refcursor;
      3   b sys_refcursor;
      4  begin
      5   open a for select empno from emp;
      6   b := a;
      7   close b;
      8 
      9   /* next action is impossible - cursor already closed */
    10   /* a and b are the same ! */
    11   close a;
    12  end;
    13  /
    declare
    ERROR at line 1:
    ORA-01001: invalid cursor
    ORA-06512: at line 11
    SQL> declare
      2   a sys_refcursor;
      3   b sys_refcursor;
      4   vempno emp.empno%type;
      5 
      6  begin
      7   open a for select empno from emp;
      8   b := a;
      9 
    10   /* Fetch first row from a */
    11   fetch a into vempno;
    12   dbms_output.put_line(vempno);
    13 
    14   /* Fetch from b gives us SECOND row, not first -
    15      a and b are the SAME */
    16 
    17   fetch b into vempno;
    18   dbms_output.put_line(vempno);
    19 
    20 
    21  end;
    22  /
    7369
    7499
    PL/SQL procedure successfully completed.Rgds.
    Message was edited by:
    dnikiforov

  • Partner function not working when creating PO with ref to PReq

    Partner function is not working when creating a Purchase Order with ref to a Purchase Requistion, Partner functions maintained in the vendor master are VN, OA & PI.
    But OA & PI are not appearing in the PO header partner tab when created with ref to PR.
    however it works when i create the PO directly ( without the PR ref )
    I am using the same material & Plant for both manual PO & PR to PO.
    Any idea what could be wrong .
    I have maintained the settings for schema groups for vendor master & purchasing doc in the partner determination.
    Thanks
    Dkmurthy

    Hi,
    I have also an issue that seems similar to one you are discussing.
    When we use ME59N and create a PO with ref. from a PR (created from a sales order), the message determination works well, it reads the condition set in MN04 (condition records for messages), and creates a message (with output type for EDI , medium: 6, and partner function LS: Logical system). Message is created and idoc is sent.
    When we try with ME21N, ME21 and we create the PO with ref. to the same PR, either by entering manually the PR in the document overview of ME21N or by selecting the PR (without entering the PR number), i.e with date, the message is not created in the PO.
    Company code is assigned to purchase organization, and so is purchase organization to plant.
    Any idea why there is no automatic message determination in the case of the transaction: ME21N
    Note: If I try ME21N, and enter the output type and partner, manually, I receive a warning message
    VN006 (Partner XXXX does not exist for partner function LS). If I accept this warning message, then message is saved- idoc is sent. However I can not overcome the warning message, if it plays any role, because I can not assign partner function LS to the vendor.Then I receive message CZ 327 (Can not use this partner role).
    Any input is wellcome.

  • Dynamic sql and ref cursors URGENT!!

    Hi,
    I'm using a long to build a dynamic sql statement. This is limited by about 32k. This is too short for my statement.
    The query results in a ref cursor.
    Does anyone have an idea to create larger statement or to couple ref cursors, so I can execute the statement a couple of times and as an result I still have one ref cursor.
    Example:
    /* Determine if project is main project, then select all subprojects */
    for i in isMainProject loop
    if i.belongstoprojectno is null then
    for i in ProjectSubNumbers loop
    if ProjectSubNumbers%rowcount=1 then
    SqlStatement := InitialStatement || i.projectno;
    else
    SqlStatement := SqlStatement || PartialStatement || i.projectno;
    end if;
    end loop;
    else
    for i in ProjectNumber loop
    if ProjectNumber%rowcount=1 then
    SqlStatement := InitialStatement || i.projectno;
    else
    SqlStatement := SqlStatement || PartialStatement || i.projectno;
    end if;
    end loop;
    end if;
    end loop;
    /* Open ref cursor */
    open sql_output for SqlStatement;
    Thanks in advance,
    Jeroen Muis
    KCI Datasystems BV
    mailto:[email protected]

    Example for 'dynamic' ref cursor - dynamic WHERE
    (note that Reports need 'static' ref cursor type
    for building Report Layout):
    1. Stored package
    CREATE OR REPLACE PACKAGE report_dynamic IS
    TYPE type_ref_cur_sta IS REF CURSOR RETURN dept%ROWTYPE; -- for Report Layout only
    TYPE type_ref_cur_dyn IS REF CURSOR;
    FUNCTION func_dyn (p_where VARCHAR2) RETURN type_ref_cur_dyn;
    END;
    CREATE OR REPLACE PACKAGE BODY report_dynamic IS
    FUNCTION func_dyn (p_where VARCHAR2) RETURN type_ref_cur_dyn IS
    ref_cur_dyn type_ref_cur_dyn;
    BEGIN
    OPEN ref_cur_dyn FOR
    'SELECT * FROM dept WHERE ' | | NVL (p_where, '1 = 1');
    RETURN ref_cur_dyn;
    END;
    END;
    2. Query PL/SQL in Reports
    function QR_1RefCurQuery return report_dynamic.type_ref_cur_sta is
    begin
    return report_dynamic.func_dyn (:p_where);
    end;
    Regards
    Zlatko Sirotic
    null

  • ORA-01008 with ref cursor and dynamic sql

    When I run the follwing procedure:
    variable x refcursor
    set autoprint on
    begin
      Crosstab.pivot(p_max_cols => 4,
       p_query => 'select job, count(*) cnt, deptno, row_number() over (partition by job order by deptno) rn from scott.emp group by job, deptno',
       p_anchor => Crosstab.array('JOB'),
       p_pivot  => Crosstab.array('DEPTNO', 'CNT'),
       p_cursor => :x );
    end;I get the following error:
    ^----------------
    Statement Ignored
    set autoprint on
    begin
    adsmgr.Crosstab.pivot(p_max_cols => 4,
    p_query => 'select job, count(*) cnt, deptno, row_number() over (partition by
    p_anchor => adsmgr.Crosstab.array('JOB'),
    p_pivot => adsmgr.Crosstab.array('DEPTNO', 'CNT'),
    p_cursor => :x );
    end;
    ORA-01008: not all variables bound
    I am running this on a stored procedure as follows:
    create or replace package Crosstab
    as
        type refcursor is ref cursor;
        type array is table of varchar2(30);
        procedure pivot( p_max_cols       in number   default null,
                         p_max_cols_query in varchar2 default null,
                         p_query          in varchar2,
                         p_anchor         in array,
                         p_pivot          in array,
                         p_cursor in out refcursor );
    end;
    create or replace package body Crosstab
    as
    procedure pivot( p_max_cols          in number   default null,
                     p_max_cols_query in varchar2 default null,
                     p_query          in varchar2,
                     p_anchor         in array,
                     p_pivot          in array,
                     p_cursor in out refcursor )
    as
        l_max_cols number;
        l_query    long;
        l_cnames   array;
    begin
        -- figure out the number of columns we must support
        -- we either KNOW this or we have a query that can tell us
        if ( p_max_cols is not null )
        then
            l_max_cols := p_max_cols;
        elsif ( p_max_cols_query is not null )
        then
            execute immediate p_max_cols_query into l_max_cols;
        else
            RAISE_APPLICATION_ERROR(-20001, 'Cannot figure out max cols');
        end if;
        -- Now, construct the query that can answer the question for us...
        -- start with the C1, C2, ... CX columns:
        l_query := 'select ';
        for i in 1 .. p_anchor.count
        loop
            l_query := l_query || p_anchor(i) || ',';
        end loop;
        -- Now add in the C{x+1}... CN columns to be pivoted:
        -- the format is "max(decode(rn,1,C{X+1},null)) cx+1_1"
        for i in 1 .. l_max_cols
        loop
            for j in 1 .. p_pivot.count
            loop
                l_query := l_query ||
                    'max(decode(rn,'||i||','||
                               p_pivot(j)||',null)) ' ||
                                p_pivot(j) || '_' || i || ',';
            end loop;
        end loop;
        -- Now just add in the original query
        l_query := rtrim(l_query,',')||' from ( '||p_query||') group by ';
        -- and then the group by columns...
        for i in 1 .. p_anchor.count
        loop
            l_query := l_query || p_anchor(i) || ',';
        end loop;
        l_query := rtrim(l_query,',');
        -- and return it
        execute immediate 'alter session set cursor_sharing=force';
        open p_cursor for l_query;
        execute immediate 'alter session set cursor_sharing=exact';
    end;
    end;
    /I can see from the error message that it is ignoring the x declaration, I assume it is because it does not recognise the type refcursor from the procedure.
    How do I get it to recognise this?
    Thank you in advance

    Thank you for your help
    This is the version of Oracle I am running, so this may have something to do with that.
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
    I found this on Ask Tom (http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:3027089372477)
    Hello, Tom.
    I have one bind variable in a dynamic SQL expression.
    When I open cursor for this sql, it gets me to ora-01008.
    Please consider:
    Connected to:
    Oracle8i Enterprise Edition Release 8.1.7.4.1 - Production
    JServer Release 8.1.7.4.1 - Production
    SQL> declare
      2    type cur is ref cursor;
      3    res cur;
      4  begin
      5    open res for
      6    'select * from (select * from dual where :p = 1) connect by 1 = 1'
      7    using 1;
      8  end;
      9  /
    declare
    ERROR at line 1:
    ORA-01008: not all variables bound
    ORA-06512: at line 5
    SQL> declare
      2    type cur is ref cursor;
      3    res cur;
      4  begin
      5    open res for
      6    'select * from (select * from dual where :p = 1) connect by 1 = 1'
      7    using 1, 2;
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    And if I run the same thing on 10g -- all goes conversely. The first part runs ok, and the second
    part reports "ORA-01006: bind variable does not exist" (as it should be, I think). Remember, there
    is ONE bind variable in sql, not two. Is it a bug in 8i?
    What should we do to avoid this error running the same plsql program code on different Oracle
    versions?
    P.S. Thank you for your invaluable work on this site.
    Followup   June 9, 2005 - 6pm US/Eastern:
    what is the purpose of this query really?
    but it would appear to be a bug in 8i (since it should need but one).  You will have to work that
    via support. I changed the type to tarray to see if the reserved word was causing a problem.
    variable v_refcursor refcursor;
    set autoprint on;
    begin 
         crosstab.pivot (p_max_cols => 4,
                 p_query => 
                   'SELECT job, COUNT (*) cnt, deptno, ' || 
                   '       ROW_NUMBER () OVER ( ' || 
                   '          PARTITION BY job ' || 
                   '          ORDER BY deptno) rn ' || 
                   'FROM   emp ' ||
                   'GROUP BY job, deptno',
                   p_anchor => crosstab.tarray ('JOB'),
                   p_pivot => crosstab.tarray ('DEPTNO', 'CNT'),
                   p_cursor => :v_refcursor);
    end;
    /Was going to use this package as a stored procedure in forms but I not sure it's going to work now.

  • Ref cursors and dynamic sql..

    I want to be able to use a fuction that will dynamically create a SQL statement and then open a cursor based on that SQL statement and return a ref to that cursor. To achieve that, I am trying to build the sql statement in a varchar2 variable and using that variable to open the ref cursor as in,
    open l_stmt for refcurType;
    where refcurType is a strong ref cursor. I am unable to do so because I get an error indication that I can not use strong ref cursor type. But, if I can not use a strong ref cursor, I will not be able to use it to build the report based on the ref cursor because Reports 9i requires strong ref cursors to be used. Does that mean I can not use dynamic sql with Reports 9i ref cursors? Else, how I can do that? Any documentation available?

    Philipp,
    Thank you for your reply. My requirement is that, sometimes I need to construct a whole query based on some input, and sometimes not. But the output record set would be same and the layout would be more or less same. I thought ref cursor would be ideal. Ofcourse, I could do this without dynamic SQL by writing the SQL multiple times if needed. But, I think dynamic SQL is a proper candidate for this case. Your suggestion to use lexical variable is indeed a good alternative. In effect, if needed, I could generate an entire SQL statement and place in some place holder (like &stmt) and use it as a static SQL query in my data model. In that case, why would one ever need ref cursor in reports? Is one more efficient over the other? My guess is, in the lexical variable case, part of the processing (like parsing) is done on the app server while in a function based ref cursor, the entire process takes place in the DB server and there is probably a better chance for re-use(?)
    Thanks,
    Murali.

  • Ref cursor and dynamic sql

    Hi..
    I'm using a ref cursor query to fetch data for a report and works just fine. However i need to use dynamic sql in the query because the columns used in the where condition and for some calculations may change dynamically according to user input from the form that launches the report..
    Ideally the query should look like this:
    select
    a,b,c
    from table
    where :x = something
    and :y = something
    and (abs(:x/:y........)
    The user should be able to switch between :x and :y
    Is there a way to embed dynamic sql in a ref cursor query in Reports 6i?
    Reports 6i
    Forms 6i
    Windows 2000 PRO

    Hello Nicola,
    You can parameterize your ref cursor by putting the query's select statement in a procedure/function (defined in your report, or in the database), and populating it based on arguments accepted by the procedure.
    For example, the following procedure accepts a strongly typed ref cursor and populates it with emp table data based on the value of the 'mydept' input parameter:
    Procedure emp_refcursor(emp_data IN OUT emp_rc, mydept number) as
    Begin
    -- Open emp_data for select all columns from emp where deptno = mydept;
    Open emp_data for select * from emp where deptno = mydept;
    End;
    This procedure/function can then be called from the ref cursor query program unit defined in your report's data model, to return the filled ref cursor to Reports.
    Thanks,
    The Oracle Reports Team.

Maybe you are looking for

  • "No internet access" error, but can connect to any webpage - Intel 6300

    I've been experiencing a somewhat annoying error; it seems very hard to troubleshoot just based on the terminology ("no internet access" is a very popular search). I have a W520 with the intel 6300 nic. The networking center says that I have "no inte

  • Material wise invoice of vendor.

    Hi I want Invoice report that shows me Invoice document no.,Vendor,Material,amount. I tried in MIR6 but material name and number not getting. any other t-code.

  • HT4759 how do you update icloud with contacts transferred to Iphone by verizon

    How do you update icloud with contacts transferred to Iphone by Verizon?  The only contacts that show up in icloud are the ones I entered myself to the phone.

  • Error entering SSO administrator creds

    I am trying to configure SA 5.5.1.1 but when it asks me to put in the SSO administrator credentials I get the following error: Something failed. Try again. General failure. java.net.UnknownHostException: XXXXXXXXXXXXX.xxx.xxxxxxxx.gov: Name or servic

  • Handset Speaker Mysteriously Non-functional

    Torch 9850, 7.1 Bundle 2879 (v7.1.0.1066, Platform 5.1.0.699)  Handset speaker will not work and/or works intermittently then stops.  Hard Reset sometimes will reactivate handset speaker but then next call handset speaker will again stop working.  Wh