How to pass parameters when we create datablock through stored procedure..

I have one table emp table.
I have created one package pk_ref_cursor,In that my recursor return type is record type.
I created one procedure p_test with two parameters...
1. ref cursor type
2. deptno
Now i created one data block through procedure...
Then i run my form it's giving no records.Because i am not passing parameter deptno.
Now i go to block property 'QUERY DATA SOURCE ARGUMENTS'.Here i set the parameter p_deptno is 20
Then i run the form it's giving some records for deptno 20.
But every time i cannot open fmb form and change the property.
Is there any way to pass parameter..
Just see my code...
--Package spec
CREATE OR REPLACE PACKAGE pk_ref_cursor IS
TYPE p_record IS RECORD(p_num emp.empno%TYPE,
p_name emp.ename%TYPE);
TYPE p_ref IS REF CURSOR RETURN p_record;
PROCEDURE p_test(p_data IN OUT p_ref,p_deptno IN NUMBER);
END pk_ref_cursor;
--Package body
CREATE OR REPLACE PACKAGE BODY pk_ref_cursor IS
PROCEDURE p_test(p_data IN OUT p_ref,p_deptno IN NUMBER) IS
BEGIN
OPEN p_data FOR SELECT empno,ename FROM EMP WHERE deptno = p_deptno;
END;     
END pk_ref_cursor;
Thanks,

But how to use package variables...
Can u show me one example..

Similar Messages

  • Why Dynamic Parameter is not working, when i create report using stored procedure ?

    Post Author: Shashi Kant
    CA Forum: General
    Hi all
    Why Dynamic Parameter is not working, when i create report XI using stored procedure ?
    Only i shaw those parameters which i used in my stored procedure, the parameter which i create dynamic using stored procedure
    is not shown to me when i referesh the report for viewing the results.
    I have used the same procedure which i mention below but can not seen the last screen which is shown in this .
    ============================================================================================
    1. Select View > Field Explorer2. Right-click on Parameter Fields and select New from the right-click menu.3. Enter u201CCustomer Nameu201D as the name for your parameter4. Under u201CList of Valuesu201D select u201CDynamicu201D5. Under the Value column, click where is says u201Cclick here to add itemu201D and select Customer Name from the drop-down list. The dialog shown now look like the one shown below in Figure 1. Click OK to return to your report design.
    Dynamic Parameter Setup6. Next, select Report > Select Expert, select the Customer Name field and click OK.7. Using the drop-down list beside select u201CIs Equal Tou201D and using the drop-down list, select your parameter field (it should be the first field). 8. Click OK to return to your report design and see the parameter dialog.The parameter dialog will appear and show you a dynamic list of values that is updated each time your run your report. It couldnu2019t be easier! In our next tutorial, we will be looking at how to use this feature to create cascading parameter fields, where the values are filtered by the preceding selection.
    Dynamic Parameters in Action
    My question is that whether dynamic parameter is working with storedprocedure or not.
    When i added one table and try to fetch records using dyanmic prameters. after that i am not be able to find the dynamic parameter option when i referesh my report.
    One more thing when i try the static parameter for my report, the option i see when i referesh the screen.
    Please reply soon , it's urgent
    Regards
    shashi kant

    Hi Kishore,
    I have tested the issue step by step by following you description, while the first issue works well in my local environment. Based on my research, this can be caused by the lookup expression or it indeed return Male value based on the logic. If you use the
    expression below, it will indeed only return the Male record. So please try to double-check the record in the two datasets and the expression in your environment:
    =lookup(first(Fields!ProgramID.Value,"DataSet1"),Fields!ProgramID.Value,Fields!Gender.Value,"DataSet2")
    As to the second issue, please try to use the following expression:
    =Count(Lookup(fields!ProgramID.value,fields!ProgramID.value,fields!Gender.value,"DataSet2"))
    Besides, if this issue still exist, in order to trouble shoot this issue more efficiently, could you please post both the .rdl  file with all the size properties to us by the following E-mail address?  It is benefit for us to do further analysis.
    E-mail: [email protected]
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to pass a user defined table type to stored procedure?

    Hi,
    I am trying to call a stored procedure from Java. The store procedure has three IN parameter, 2 IN/OUT params and 3 OUT parameters. The two IN/OUT parameters are user defined objects. Can anyone tell me how to set these IN/OUT parameters in Java.
    Thanks

    It is database/driver specific so you need to use the specific functionality of the driver (not jdbc) to access it.

  • How to pass a table as parameter on a stored procedure

    Hello all,
    I want to pass the name of a table as parameter into a stored procedure, that will be used for cursors etc.
    But when i pass the parameter and i compile the S.P. it give me error (error: table not existing...)
    Any Help?
    Thanks in advance, Marco

    Marco wrote:
    As i've written above, i'm using stored procedures like 'batch' programs which will be executed with oracle scheduler (passing to s.p. the name of the 'input' tables)
    These input tables are 'external' tables which have got the same structure; for example i've got TABLEX_001, TABLEX_002, XXTAB etc. with the same structure.
    This is the the reason... what do you think?An external table definition can reference multiple files via the LOCATION definition or you can user "ALTER TABLE" to alter the location and change the file that the external table points to.
    Thus you only need one static External Table and use an alter table (via execute immediate) to change the file location it points to, or if you want all the data together, just specify all the files in the location.
    That would be clean design, using one fixed table, without the need to pass any table names, just dynamically altering the file names if necessary at run time.

  • How to pass a list of IDs to a stored procedure ?

    Hi All,
    My table has two columns customerID (int) and customerName
    I want to write a stored procedure that will get a list of integers and then return all the customers names associated with these IDs. How to do that ?
    Thanks

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. 
    <Removed unrelated comments>
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking in
    Sets / Trees and Hierarchies in SQL

  • Error when executing DBMS_ERRLOG pkg through Stored Procedures...

    Hi,
    We have TWO schemas like IDWH_ODS and IDWH_ERR running on Oracle 10g Rel.2.
    The schema IDWH_ERR has direct SELECT privilege on all the base tables in IDWH_ODS schema. (As Pl/sql doesn't support ROLE, we have granted direct SELECT on each of the tables)
    IDWH_ODS schema has tables like ACCOUNT & CUSTOMER, for which I need to create DML Error logging tables in IDWH_ERR schema.
    I have one procedure 'Cr_Errlog_Tabs' in IDWH_ERR schema which gets all tables in IDWH_ODS and creates Error logging table in IDWH_ERR schema using DBMS_ERRLOG package. My problem starts here,
    When I execute the DBMS_ERRLOG package in IDWH_ERR through SQL*Plus LIKE,
    > exec DBMS_ERRLOG.CREATE_ERROR_LOG('idwh_ods.ACCOUNT','ERR$_ACCOUNT','idwh_err');
    it's creating the error log table 'ERR$_ACCOUNT' in IDWH_ERR schema.
    (...the same will be working when execute through Anonymous plsql block)
    BUT, when i execute the DBMS_ERRLOG package with same parameters through the stored Procedure 'Cr_Errlog_Tabs',
    it throws the following error...
    ORA-01031: insufficient privileges
    Please let me know the solution at the earliest.
    Thanks.
    -Saravanan

    duplicate post
    Insufficient privilege error when executing DBMS_ERRLOG through PLSQL

  • Form Personalization - Custom Function - How to pass parameters?

    Hi,
    My requirement is to call a custom mod pl/sql program (html page) from purchasing when the "approve" button is pressed. I have it working, but don't know how to pass parameters to my function.
    I have my function defined and registered. In the definition under "Web HTML" tab, I have my pl/sql procedure call under "HTML Call". Where do the parameters go?
    On the customization of form POXPOEPO, I am using Builtin - Launch a function. I want to pass the po_header_id, so under "Parameters", I did "Insert Item Value" of :PO_HEADERS.PO_HEADER_ID
    My custom HMTL page is popping up, but the parameter is not being passed. Is there something in the Function Definition where I can define the incoming paramaters?
    Thanks.
    Paul

    Hi paul;
    There are many usefull link avaliable if you googling
    http://www.google.com.tr/#hl=tr&biw=1259&bih=793&&sa=X&ei=4wxQTZmYEISRswaNktWSDQ&ved=0CC4QBSgA&q=How+to+pass+parameters%2Bform+personalization&spell=1&fp=64d53dfd7a69225a
    Regard
    Helios

  • Form personalization - new custom function - how to pass parameters?

    Hi,
    My requirement is to call a custom mod pl/sql program (html page) from purchasing when the "approve" button is pressed. I have it working, but don't know how to pass parameters to my function.
    I have my function defined and registered. In the definition under "Web HTML" tab, I have my pl/sql procedure call under "HTML Call". Where do the parameters go?
    On the customization of form POXPOEPO, I am using Builtin - Launch a function. I want to pass the po_header_id, so under "Parameters", I did "Insert Item Value" of :PO_HEADERS.PO_HEADER_ID
    My custom HMTL page is popping up, but the parameter is not being passed. Is there something in the Function Definition where I can define the incoming paramaters?
    Thanks.
    Paul

    Post your question in below forum:
    General EBS Discussion
    -Anand

  • How to Pass parameters to Crystal report 10 based on Oracle Stored Procedur

    Hi,
    I use the following code to pass the parameters:
    Rep.Tables[0].ConnectBuffer := Connection_Str;
    Rep.Tables[0].AliasName := 'REP';
    Rep.Connect.Propagate := True;
    Rep.ParamFields.ByName('Lang', '').CurrentValue := IIF(BiDiMode = bdRightToLeft, '2', '1');
    Rep.ParamFields.ByName('SESSION_ID', '').CurrentValue := IntToStr(Session_id);
    Rep.WindowState := wsMaximized;
    Rep.Show;
    The 1st parameter 'Lang' which created from crystal report pass well,
    but the 2nd parameter 'SESSION_ID' which created from Oracle Stored Procedures give the following Error:
    Error: 202 Parameter Name could not be found u2013 ParamFields.ByName
    However in MS SQL Server the above code work fine with the 2 Parameters.
    Any one has solution,

    Hello,
    Click on the businessobjects Tab above and then select Samples and dowload the sample app you for your SDK. There are a few samples for changing/setting Parameters.
    The Parameter collection has all parameters.
    Thank you
    Don

  • I created an image in Photoshop and saved it as the PSD file. Now when I try and open it it says it is not compatible with my version. How could this be when I created it in this version?

    I created an image in Photoshop and saved it as the PSD file. Now when I try and open it it says it is not compatible with my version. How could this be when I created it in this version?

    That depends on why it won't open.  Most of the time it means the file is corrupted and unlikely to be recovered. If you saved it right after adding or copying a LOT of layers - then it might just be the layer limit and we can attempt to recover it.

  • "How to pass classification characteristics while creating batch" ?

    Hi,
        I am using FM's BAPI_BATCH_CREATE/CHANGE while creating/changing batch I have to maintain classification data aswell.But in FM docu i saw as shown below
    1.Create the classification of a batch in the background (object characteristics only)
    2. If the batch is to be classified, you must specify a class in the BatchControlFields parameter. Only single classification is possible.
      According to above statments I have passed class name in Batch Control Fields but I am unable to find " How to pass classification characteristics while creating batch". Please tell me how to pass classification characteristics in background?
    Edited by: Vijay Babu Dudla on Dec 16, 2008 3:24 AM

    Hi, You can update classification for a batch using the following code.
    But first, you'll need to find out that the batch management is cross-plant or plant dependant.
    If it is cross plant then plant(WERKS) is not part of the key to BAPI_OBJCL_CONCATENATEKEY.
    CLEAR: objectkey, objectkeytable, objectkeytable[],
               allocvaluesnumnew, allocvaluesnumnew[],
               return.
        objectkeytable-key_field = 'MATNR'.
        objectkeytable-value_int = matnr.
        APPEND objectkeytable.
        objectkeytable-key_field = 'CHARG'.
        objectkeytable-value_int = charg.
        APPEND objectkeytable.
    * Only if Batch management is Plant dependant
        objectkeytable-key_field = 'WERKS'.
        objectkeytable-value_int = werks.
        APPEND objectkeytable.
        CALL FUNCTION 'BAPI_OBJCL_CONCATENATEKEY'
          EXPORTING
            objecttable    = objecttable
          IMPORTING
            objectkey_conc = objectkey
          TABLES
            objectkeytable = objectkeytable
            return         = return.
        allocvaluesnumnew-charact = "characteristic name goes here".
        allocvaluesnumnew-value_from ="characteristic value goes here".
        APPEND allocvaluesnumnew.
        allocvaluesnumnew-charact =  "characteristic name goes here".
        allocvaluesnumnew-value_from =  "characteristic value goes here".
        APPEND allocvaluesnumnew.
        CALL FUNCTION 'BAPI_OBJCL_CHANGE'
          EXPORTING
            objectkey                = objectkey
            objecttable              = 'MCHA' " MCH1 in case of cross-plant batch management
            classnum                 = classnum " Classification class number, as used in MSC2N
            classtype                = classtype " Classification class type, as used in MSC2N
    *   STATUS                   = '1'
    *   STANDARDCLASS            = STANDARDCLASS
    *   CHANGENUMBER             = CHANGENUMBER
    *   KEYDATE                  = SY-DATUM
    *   NO_DEFAULT_VALUES        = ' '
    * IMPORTING
    *   CLASSIF_STATUS           = CLASSIF_STATUS
          TABLES
            allocvaluesnumnew        = allocvaluesnumnew
            allocvaluescharnew       = allocvaluescharnew
            allocvaluescurrnew       = allocvaluescurrnew
            return                   = return
    * Do not forget to commit, otherwise changes would not take effect.
    commit work.
    Regards,
    Hashir Ahmed

  • How to pass parameters between two xterm windows?

    Hi,
    I would like to know how to pass parameters between two xterm windows where there are two independence processes running on them respectively ? Would appreciate if any one out there can advise me . Thanks.

    Global variables can be used, but you can do what the online help
    says ...
    Parameters are passed to called forms by means of a parameter
    list. A parameter list is a named programmatic construct that is
    simply a list of parameter names (called keys) and their values.
    You can pass parameter values to forms invoked by the built-in
    subprograms CALL_FORM, OPEN_FORM, and NEW_FORM. In addition, you
    can pass parameter values to other Oracle tools with the
    RUN_PRODUCT procedure.
    A parameter you include in a parameter list can be either a text
    parameter or a data parameter. The parameter type determines how
    its value is interpreted.
    Text Parameters The value of a text parameter being passed to a
    called product is a CHAR string that can represent the following:
    n a user-defined form parameter defined in a form invoked
    by the CALL_FORM, OPEN_FORM, or NEW_FORM built-in subprograms
    n a command line or user-defined parameter for a product
    invoked with the RUN_PRODUCT built-in subprogram
    Data Parameters The value of a data parameter being passed to a
    called product is always the name of a record group defined in
    the current form. (A record group is a data structure that
    stores records derived from a query or through programmatic
    assignment.) Data parameters are used to pass data to products
    invoked with the RUN_PRODUCT built-in subprogram. You cannot
    pass data parameters to forms.
    The following table shows the structure of a parameter list that
    contains four parameters:
    Key Paramtype Value
    CITY Text_Parameter 'BOGOTA'
    CATEGORY Text_Parameter 'EXPORTS'
    MULTIPLIER Text_Parameter '.0275'
    NEW_DATA Data_Parameter 'RECORD_GROUP8'
    arun reddy (guest) wrote:
    : im trying to do this but i could not find any way for this.
    : can any one help me how can i pass parameters between two forms
    : in forms4.5. any help will be appreciated
    : thanks.
    null

  • Creating a SQL Stored procedure to call a CF function

    I need to create a method to migrate data from a DMZ inside a firewall.  To do this I was thinking of making a call from the DMZ web server (using CF) to an internal SQL server database stored procedure.  The stored procedure would then call a CF template on the internal web server to pull data inside the firewall.  Not my first choice on implementation but as a consultant I don’t make the rules I create the code to enforce them... Anyway these are the steps I need to follow.
    1.)    Call the stored procedure and pass an int value with the call.
    2.)    The Stored procedure calls a URL and passes the INT with it. I.E.  http://Mylocalhost/Xferdata/MyXferTemplate.cfm?MyIntValue=”PASSED IN INT VALUE”
    3.)    The MyXferTemplate does the actual data migration for me.
    My question is how do I create a simple stored procedure to do this on SQL Server 2008???  After looking at the CF documentation I don’t think there will be much of a problem making the call to the stored procedure… its just writing the stored procedure…  Any and all help is greatly appreciated!!!
    Have an Ordinary Day...
    Kurtis   ~|:-)

    So far this is what I got... When I "execute' this code in SQ
    L Server management studio it compiles without any errors but when I run it I get the message "http: is not recognized as an internal or extermnal command."
    /**********************************  Code to create the SP **************************/
    USE 
    [KDLTransfer]
    GO
    /****** Object: StoredProcedure [dbo].[Migrate_DMZ_Data] Script Date: 03/07/2011 16:48:50 ******/
    SET 
    ANSI_NULLS ONGO
    SET 
    QUOTED_IDENTIFIER ONGO
    -- =============================================
    -- Author: KDL
    -- Create date: 3/7/2011
    -- Description: Migrate data
    -- =============================================
    ALTER 
    PROCEDURE [dbo].[Migrate_DMZ_Data]  
    -- Add the parameters for the stored procedure here
    @MyIntValue
    int = null
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;
    -- Insert statements for procedure here
    EXEC xp_cmdshell 'http://localhost/IREC/KDL/KDL.cfm?@MyIntValue, no_output';
    END
    /**************** Code to call the SP ******************/
    execute  Migrate_DMZ_Data @MyIntValue = N'5'

  • How in ColdFusion with in variables get a Oracle stored procedure to return values?

    How in ColdFusion with in variables get a Oracle stored procedure to return values?
    We have tried several things, we can get  a stored procedure to return a result set if we are not passing in variables but we cannot get them when we are passing in variables.
    We know how to do it calling  MS SQL.
    Thanks for any help,
    Nathan Sr
    P.S. we have heard this may not be possible with the current Oracle Driver is there a different Oracle driver?

    I can only barely understand what you're asking here (not from a technical perspective, but from understanding your written English), but I suspect you're wanting to know how to pass back values other than recordsets from Oracle?
    You should be able to pass them back via a type=out proc param, shouldn't you?
    If you could reword your post so it's a bit more coherent, and possibly post some code, that might help.
    Adam

  • How to limit the response rows while invoking a stored procedure from OSB 10gR3

    Dear Experts,
    I am trying to limit the response while invoking a stored procedure from OSB via DB adapter.
    Here the stored procedure returns cursors as response. I tried using the MaxTransactionSize propertiy (which is used for polling the database option in DB adapter).
    We are investigating the ways to protect the application from response containing huge number of rows.
    Is there any way to restrict the number of rows returned in each and every cursor while invoking the stored procedure via DB adapter?
    Thanks
    Ram

    Hi James ,
    I want to know how to run stored procedure using jca adapter in OSB11g.
    I am new to stored prcoedure,will be great if you could share some example on it as above.
    Req: Single input xml will be posted on queue ,need to perform 3 DB operation (with same input):
    1.Insert operation to insert master table contents.
    2.select the primary key column value from master table for the last inserted record.
    3.Need to insert primary key column value + other fields frm same xml file to child table.
    Pls assist me on how to create a simple stored procedure and to run the same with OSB 11g.I am familiar with creation of DB adapter using Jdeveloper,we have option to perform insert and to call stored procedure here,will it be useful for this scenario?
    Edited by: Anitha R on Nov 21, 2010 9:30 PM

Maybe you are looking for

  • "Instant Alpha" on a PDF Istockimage

    I want to outline an imported image from istockphoto.com, but I don't know the name of what I am trying to do. I am thinking I need to create a path. The reason I called it instant alpha is b/c in Pages I can take the back image away and keep the fro

  • PBO and PA! to Dynpro SAPMV45A 8459 do not execute

    Hi all, I found several threads about Dynpro 8459, which contains "Additional Data B" in the sales order. But I have a problem which isn't mentioned earlier. My problem ist that I did some coding in the PBO of dynpro 8459, but it isn't executed. When

  • Can any1 provide the notes on "ABAP dictionary"

    can any one provid me the the notes of "ABAP dictionary" . Edited by: rajeel jain on Jun 22, 2011 10:57 AM Moderator Message: Please read the [Forum Rules Of Engagement|https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] before posting your

  • How can I save individual songs to one album?

    I have an album and the  iTunes split it into separate songs. How do I save them back to one album? Please help its keep happening. I installed and reinstalled I tunes several times, but no change.

  • TS3694 error code -25170 when trying to sync nano and ipod to itunes

    cannot sync nano or ipod with itunes,,,keep getting error code -25170 cannot sync...any ideas