Call procedure's package from sql query ?

Hi,
I've write a package. In this package there is a procedure A with this parameters (in x, in y, out z).
In the second procedure B, i want te create a cursor like this :
'select * from table where table.fiels in ( A.(x,y) )'
Is it possible to do this ?
Thanks for the answer.

I think so. Could you flesh out your code a little more? Yes of course, this is my PLSQL code :
/*This is the first procedure */
procedure Get_IDGeneriques(i_idfamille in generiquesliensfamilles.idfamille%type, i_idprofil in generiqueslienslistesmono.idlisteprofil%type, i_idconstitution in generiqueslienslistesmono.idlisteconstitution%type, i_idserie in generiqueslienslistesmono.idlisteseriefraises%type, i_idpas in generiqueslienslistesmono.idlistepasfraises%type, i_idtypeattache in generiqueslienslistesmono.idlisteattache%type, i_idlisteSensISO in generiqueslienslistesmono.idlisteSensISO%type, i_idlistearrosagecentre in generiqueslienslistesmono.idlisteArrosageCentre%type, i_listematieres in varchar2, i_listemachines in varchar2,i_listeopes in varchar2, o_idgenerique out tbl_bin_int)
is
BEGIN
DECLARE
TYPE TypeCursorReq IS REF CURSOR;
          test TypeCursorReq;
sqlstm VARCHAR2(4000);
recordcount number default 0;
idgenerique generiqueslienslistesmono.idref%type;
BEGIN
sqlstm := 'SELECT GENERIQUESLIENSLISTESMULTI.IDGENERIQUE FROM GENERIQUESLIENSLISTESMULTI, GENERIQUESLIENSLISTESMULTI GENERIQUESLIENSLISTESMULTI1, GENERIQUESLIENSLISTESMULTI GENERIQUESLIENSLISTESMULTI2
WHERE GENERIQUESLIENSLISTESMULTI.IDGENERIQUE = GENERIQUESLIENSLISTESMULTI1.IDGENERIQUE AND GENERIQUESLIENSLISTESMULTI.IDGENERIQUE = GENERIQUESLIENSLISTESMULTI2.IDGENERIQUE AND (GENERIQUESLIENSLISTESMULTI.TYPE1 =''MT'')
AND GENERIQUESLIENSLISTESMULTI.IDLISTE IN (' || i_listematieres || ') AND (GENERIQUESLIENSLISTESMULTI1.TYPE1 =''OP'') AND GENERIQUESLIENSLISTESMULTI1.IDLISTE IN (' || i_listeopes || ') AND GENERIQUESLIENSLISTESMULTI2.TYPE1 =''MA''
AND GENERIQUESLIENSLISTESMULTI2.IDLISTE IN (' || i_listemachines || ')';
OPEN test for sqlstm;
                    LOOP
                    FETCH test INTO      idgenerique;
                    EXIT WHEN test%NOTFOUND;
recordcount := recordcount+1;
o_idgenerique(recordcount) := idgenerique;
END LOOP;
END;
end;
/* This is the second procedure who call the first one */
procedure Get_IDOutils(i_idfamille in generiquesliensfamilles.idfamille%type, i_idprofil in generiqueslienslistesmono.idlisteprofil%type, i_idconstitution in generiqueslienslistesmono.idlisteconstitution%type, i_idserie in generiqueslienslistesmono.idlisteseriefraises%type, i_idpas in generiqueslienslistesmono.idlistepasfraises%type, i_idtypeattache in generiqueslienslistesmono.idlisteattache%type, i_idlisteSensISO in generiqueslienslistesmono.idlisteSensISO%type, i_idlistearrosagecentre in generiqueslienslistesmono.idlisteArrosageCentre%type, i_listematieres in varchar2, i_listemachines in varchar2,i_listeopes in varchar2, o_idoutil out tbl_bin_int)
is
BEGIN
DECLARE
TYPE TypeCursorReq IS REF CURSOR;
          test TypeCursorReq;
sqlstm VARCHAR2(4000);
recordcount number default 0;
idoutil outilslienslistesmono.idref%type;
BEGIN
sqlstm := 'SELECT * FROM OUTILSLIENSLISTESMONO,LIENSGENERIQUESOUTILS
WHERE OUTILSLIENSLISTESMONO.IDRef = LIENSGENERIQUESOUTILS.IDRefOutilFabMati
AND LIENSGENERIQUESOUTILS.IDRefGeneFabMati in (Get_IDGeneriques(1,232,22,47,26,210,206,50,''10444,10448,10451'',''10337'',''10319'') )';
OPEN test for sqlstm;
                    LOOP
                    FETCH test INTO      idoutil;
                    EXIT WHEN test%NOTFOUND;
recordcount := recordcount+1;
o_idoutil(recordcount) := idoutil;
END LOOP;
END;
end;
END TITAN2;

Similar Messages

  • How to call procedure in Java from SQL Server Database

    Hello Every Body
    i Have Question about
    How to call procedure in Java from SQL Server Database
    Thanks

    Hi,
    have you tried a Google search? I just gave it a 3 second try and already found: http://stackoverflow.com/questions/6113674/how-do-i-execute-a-ms-sql-server-stored-procedure-in-java-jsp-returning-table-d
    Frank

  • How call procedure or package from Oracle BI Publisher 10.1.3.2.1

    Hi Gurus,
    I need to call a procedure or package from Oracle BI Publisher 10.1.3.2.1 by passing parameters, I do it because it would be easier to fill a table as the report that asks for is too complex (8 breaks, 5 dblinks, 20 tables, etc).
    I'm not using the Oracle XML. Review include the following solutions:
    Re: Stored procedures and dynamic columns
    Re: Is it possible to use Stored Procedures in BI Publisher GUI?
    Re: PL/SQL Stored Procedure w/ XML Template?
    But none of them useful for me was the level of complexity.
    Best regards.

    Hi Vetsrini,
    I write the sentence as it showed in the previous thread
    select from whc_kk_v2.whc_p_kk_publisher (pv_msgerror =>: msgerror,*
    pv_pro1 =>: prov_1,
    pv_pro2 =>: prov_2)
    run when I get the error BIP
    ORA-00933: SQL command not properly ended
    Show me I'm doing wrong, or who may be causing the error. I tried everything but does not leave, please your help.
    Best regards

  • Call the stored package from SQL in the APEX Report Region.

    SELECT COUNT (DISTINCT ah.BIB_DOC_NUM) AS "TITLES"
    FROM NC_AL_HOL_LOCN ah ,NC_AL_CALL_NUMBER ac
    WHERE
    ac.CN_STEM>= cross_inst.call_callnojava.callno_parse('A1','A')
    AND ac.CN_STEM< cross_inst.call_callnojava.callno_parse('D1','A');
    In oracle 10g, I create the package under cross_inst schema.
    When I tried to run the page, I got the following parse error page.
    ===================================
    failed to parse SQL query:
    ORA-00904: "CROSS_INST"."CALL_CALLNOJAVA"."CALLNO_PARSE": invalid identifier
    Any Idea?
    Thanks ahead.

    The parsing schema of your application needs execute privilege on the cross_inst.callnojava package (a direct grant and not a grant through a role).
    Scott

  • Calling the function from SQL query

    Hi,
    I am trying to run the below statement,
    Select to_number(apps.pay_balance_pkg.get_value( 326, :paa.assignment_action_id,to_date ('31032011','ddmmyyyy'))) from dual;
    getting an error as :
    ORA-14552 cannot perform a DDL, commit or rollback inside a query or DML
    ORA - 06512 at apps.pay_balance_pkg , line 4526.
    How can I execute this funciton "apps.pay_balance_pkg.get_value" from sql query?
    Thanks in advance.

    user1175432 wrote:
    Hi,
    I am trying to run the below statement,
    Select to_number(apps.pay_balance_pkg.get_value( 326, :paa.assignment_action_id,to_date ('31032011','ddmmyyyy'))) from dual;
    getting an error as :
    ORA-14552 cannot perform a DDL, commit or rollback inside a query or DML
    ORA - 06512 at apps.pay_balance_pkg , line 4526.
    How can I execute this funciton "apps.pay_balance_pkg.get_value" from sql query?
    Thanks in advance.If the function is performing DDL, commit or rollback inside it then you will not be able to call it from an SQL statement.
    Either change the function so it doesn't perform DDL, commit or rollback, or use a different means to obtain the information you want (assuming you can't change the function)

  • How to select a procedure in package from crystal report

    I want to select a oracle procedure in package from a crystal report. I can able to select stored procedure from crystal report if I check the option storedprocedure in file menu--option-SQL tab.

    Thanks Jayanthi,
    We had already read the article, but did not interpret it correctly. We found the solution in an SAP OSS note.
    We had to use method get_document_handle to get an OLE link and continue from there with OLE. The article however is very brief on that part and has no example.
    So for anyone who would like to do the same or simular:
    - call method do_document->get_document_handle:
        EXPORTING
           no_flush = ''
        IMPORTING
           error = do_error
           handle = do_handle
           retcode = do_retcode.
    - GET PROPERTY OF do_handle-obj 'Application' = do_ole_application.

  • How to find the name of calling procedure or package?

    Hi all..
    Is it possible to find the name of the calling procedure or package?
    I mean..if proc_1 is calling proc_2 How can i find in proc_2 that proc_1 is calling?
    Proc_2 is being called from different procedures? I need to write to small code which needs to fire depends on the Proc it is calling?
    Please help me to solve this.
    Thanks

    Not sure, if this is what you're looking for
    SQL> create or replace procedure p0 as
      2  begin
      3    dbms_output.put_line(dbms_utility.format_call_stack);
      4  end;
      5  /
    Procedure created.
    SQL> create or replace procedure p1 as
      2  begin
      3    p0;
      4  end;
      5  /
    Procedure created.
    SQL> create or replace procedure p2 as
      2  begin
      3    p1;
      4  end;
      5  /
    Procedure created.
    SQL> set serveroutput on
    SQL> begin
      2    p2;
      3  end;
      4  /
    ----- PL/SQL Call Stack -----
      object      line  object
      handle    number  name
    3a7f2d618         3  procedure INV_ADM.P0
    39abfeef0         3  procedure INV_ADM.P1
    39c5ae7a0         3  procedure INV_ADM.P2
    3a0f3a538         2  anonymous block
    PL/SQL procedure successfully completed.
    SQL>

  • Need (procedure or function or sql query )for Email filter

    Hi All,
    in (procedure or function or sql query ) ,if i pass the a input parameter like (anbu@y or anbu@ or anbu@yahjjj ) ,i need to get output like [email protected] .
    please give me code for this ...

    SQL> with t
      2  as
      3  (
      4  select 'anbu@y' email from dual union all
      5  select 'anbu@' from dual union all
      6  select 'anbu@yahjjj' from dual
      7  )
      8  select email, regexp_replace(email, '@.*','@yahoo.com') email_new
      9    from t
    10  /
    EMAIL
    EMAIL_NEW
    anbu@y
    [email protected]
    anbu@
    [email protected]
    anbu@yahjjj
    [email protected]

  • Query based Report (Reports From SQL Query)

    Hi All,
    I am facing a problem with a report. I need your help.
    I am creating a Report From SQL Query (Portal) with some arguments passed at runtime. I am able to view the output, if the query returns few rows ( arount 1000 rows). But for some inputs it needs to generate >15000 records, at this point the page is getting time out (i think!) and showing error page. I am able to execute query from the SQL Plus console ot using TOAD editor. Here the query is not taking more that 2 mins time to show the result.
    If i am executing from Portal i observed that, once i give the appropriate input and hit submit button a new oracle process is getting created for the query on UNIX (I am usign "TOP" command to check processes). The browser page will be shown error page after 5 minutes (i am assuming session time out!) , but on the backend the process will be executed for more than 30 mins.
    Can i increase a timeout of portal page, how i can do this?
    The data returned as a result of the query is sized more than 10 MB. Is caching this much data is possible by the browser page? is the returned data is creating any problem here.
    Please help me to find appropriate reasone for the failure?

    Can you post the URL that is giving you the page not found error ? I am not sure if I can be of much help though.
    In order to increase your chances to get a reply you should also post your question in the Portal Forum - Oracle Application Server Portal
    Edited by: Rodolfo Ferrari on Jun 16, 2009 3:49 PM

  • Adding update and delete buttons to a  Report from SQL Query

    There is an option when creating a QBE to add update and delete
    links which i find quite useful, but this option doesn't seem to
    be possible on a Report from SQL Query. Do i need to do
    something special to add them? is the option located in a
    different place?

    Hi,
    You can only add Update ,Delete in QBE Reports,
    there is no option in Portal which can be used to
    have these buttons in the Reports from Query Wizard or
    Report from SQL Query.
    Thanks
    Vineet

  • Getting zero-sized reply error when running report from SQL query

    Hi,
    I have a Report from SQL Query in Portal. When I select Excel in Output Format and then run the report, it works properly, but when I select HTML in Output Format, the report works if the rows returned are not so many (I've been able to display the report for up to 701 rows), but when I try selecting a value from the LOV that selects many rows, I get the following error:
    ERROR
    The requested URL could not be retrieved
    While trying to retrieve the URL: <data suppressed>
    The following error was encountered:
    Zero Sized Reply
    Squid did not receive any data for this request.
    Any ideas on how to fix this? Why does the number of rows returned affect the report this way?
    Thanks,
    Lorena

    Problem comes when any of the filter is applied in any one of the cases selected from the GUI.Do you mean that the problems only shows when you run the report in your browser via 9iAS?
    Which version are you using?
    Can you post the before report trigger?

  • Getting Zero Sized Reply error in report from SQL query

    Hi,
    I have a Report from SQL Query in Portal 3.0.9. When I select Excel in Output Format and then run the report, it works properly, but when I select HTML in Output Format, the report works if the rows returned are not so many (I've been able to display the report for up to 701 rows), but when I try selecting a value from the LOV that selects many rows, I get the following error:
    ERROR
    The requested URL could not be retrieved
    While trying to retrieve the URL: <data suppressed>
    The following error was encountered:
    Zero Sized Reply
    Squid did not receive any data for this request.
    Any ideas on how to fix this? Why does the number of rows returned affect the report this way?
    Thanks,
    Lorena

    Hi,
    I have a Report from SQL Query in Portal 3.0.9. When I select Excel in Output Format and then run the report, it works properly, but when I select HTML in Output Format, the report works if the rows returned are not so many (I've been able to display the report for up to 701 rows), but when I try selecting a value from the LOV that selects many rows, I get the following error:
    ERROR
    The requested URL could not be retrieved
    While trying to retrieve the URL: <data suppressed>
    The following error was encountered:
    Zero Sized Reply
    Squid did not receive any data for this request.
    Any ideas on how to fix this? Why does the number of rows returned affect the report this way?
    Thanks,
    Lorena

  • How to compare result from sql query with data writen in html input tag?

    how to compare result
    from sql query with data
    writen in html input tag?
    I need to compare
    user and password in html form
    with all user and password in database
    how to do this?
    or put the resulr from sql query
    in array
    please help me?

    Hi dejani
    first get the user name and password enter by the user
    using
    String sUsername=request.getParameter("name of the textfield");
    String sPassword=request.getParameter("name of the textfield");
    after executeQuery() statement
    int exist=0;
    while(rs.next())
    String sUserId= rs.getString("username");
    String sPass_wd= rs.getString("password");
    if(sUserId.equals(sUsername) && sPass_wd.equals(sPassword))
    exist=1;
    if(exist==1)
    out.println("user exist");
    else
    out.println("not exist");

  • Width of field in Report From SQL Query

    I have created a report from SQL query with 15 columns being selected. However, no matter what column width and column type (pixel, char, percent) I enter in the column formatting tab of the report, I cannot get the report to format the column to the width I desire. It is always a fixed width. Does anyone have any suggestions?
    Thanks,
    Martin

    Hi,
    Char (used for ASCII format)
    Displays the output in the specified number of
    characters per line. For example, if you enter 20
    in Width, the report displays 20 characters of the
    column data in each line. If the number of
    characters per line exceeds the specified
    number, the remaining characters are wrapped
    to the next line.
    Pixel
    Displays the output in the specified number of
    pixels per row. For example, if you enter 10 in
    Width, the column data displays 10 pixels of
    data per line of the displayed table.
    Percent
    Displays the output in the specified percentage
    of the table. For example, if you enter 25 in
    Width, the column data displays in 25% of the
    displayed table.
    Thanks,
    Sharmila

  • Need help in Report From SQL Query

    Hi All,
    I am facing a problem with a report. I need your help.
    I am creating a Report From SQL Query (Portal) with some arguments passed at runtime. I am able to view the output, if the query returns few rows ( arount 1000 rows). But for some inputs it needs to generate >15000 records, at this point the page is getting time out (i think!) and showing error page. I am able to execute query from the SQL Plus console ot using TOAD editor. Here the query is not taking more that 2 mins time to show the result.
    If i am executing from Portal i observed that, once i give the appropriate input and hit submit button a new oracle process is getting created for the query on UNIX (I am usign "TOP" command to check processes). The browser page will be shown error page after 5 minutes (i am assuming session time out!) , but on the backend the process will be executed for more than 30 mins.
    I tried also increase the page time out in httpd.conf, but no use.
    The data returned as a result of the query is sized more than 10 MB. Is caching this much data is possible by the browser page? is the returned data is creating any problem here.
    Please help me to find appropriate reasone for the failure?

    user602513 wrote:
    Hi All,
    I am facing a problem with a report. I need your help.
    I am creating a Report From SQL Query (Portal) with some arguments passed at runtime. I am able to view the output, if the query returns few rows ( arount 1000 rows). But for some inputs it needs to generate >15000 records, at this point the page is getting time out (i think!) and showing error page. I am able to execute query from the SQL Plus console ot using TOAD editor. Here the query is not taking more that 2 mins time to show the result.
    If i am executing from Portal i observed that, once i give the appropriate input and hit submit button a new oracle process is getting created for the query on UNIX (I am usign "TOP" command to check processes). The browser page will be shown error page after 5 minutes (i am assuming session time out!) , but on the backend the process will be executed for more than 30 mins.
    I tried also increase the page time out in httpd.conf, but no use.
    The data returned as a result of the query is sized more than 10 MB. Is caching this much data is possible by the browser page? is the returned data is creating any problem here.
    Please help me to find appropriate reasone for the failure?Do you get any errors or warnings or it is just the slow speed which is the issue?
    There could be a variety of reasons for the delayed processing of this report. That includes parameter settings for that page, cache settings, network configurations, etc.
    - explore best optimization for your query;
    - evaluate portal for best performance configuration; you may follow this note (Doc ID: *438794.1* ) for ideas;
    - third: for that particular page carrying that report, you can use caching wisely. browser cache is neither decent for large files, nor practical. instead, explore the page cache settings that portal provides.
    - also look for various log files (application.log and apache logs) if you are getting any warnings reflecting on some kind of processing halt.
    - and last but not the least: if you happen to bring up a portal report with more than 10000 rows for display then think about the usage of the report. Evaluate whether that report is good/useful for anything?
    HTH
    AMN

Maybe you are looking for

  • I have V1 video app on my iPhone and on my iPad but can't get the videos to merge when backed up to the icloud.

    My V1 video app is use on my iPhone and iPad but I can not get them to merge when I back up to the iCloud. I want to be able to take the video of a swing with the iPhone and play it back on the iPad. What am I missing?

  • Notes syncing to iCloud even when not selected in preferences

    I do not want Notes that I create on my MBP to go to iCloud.  Therefore I have deselected it from the iCloud preferences.  In fact, that option was never selected.  However, I notice that every time I create a new Note, it still goes to iCloud.  How

  • Text in email coming in as attachements?

    My brothersis a Verizon user ,so I am. He texts me through my email using the email address my phone number and @vzwpix.com .. when i open the email the text are as an attachment & i have to download it .. Does anyone know how to fix this ?

  • CD Won't Open-nada happens

    Using iTunes 7.6.2 on a G4 Sawtooth, 1G RAM; 10.4.11 I have a Stacy Mitchhart CD (Gotta Get the Feeling Back; Dr Sam Records) that plays fine in my home stereo and two car stereos. It has the words, "InterActive CD-place this CD in your computer for

  • Export to Encore from Premiere - Set DVD Title?

    I am new to Encore. I tried to Export to Encore from Premiere. The DVD turns out fine, but the DVD is named "Untitled Project" and I'd like to give the disc a custom title. I saved the Encore project, gave the disc a title, and the titling works out