Passing parameter to stored procedure from windows form getting error

I've written a procedure which shows the data in a table according to the table flag selected from the windows form. My code is:
--- stored procedure ------
CREATE PROC [dbo].[PROC_SELECT_TABLES]
@TBL_FLAG INT
AS
BEGIN
SET NOCOUNT ON;
IF (@TBL_FLAG = 1)
SELECT * FROM MHT_APPUSER ;
IF (@TBL_FLAG = 2)
SELECT * FROM MHT_ISA11 ;
IF (@TBL_FLAG = 3)
SELECT * FROM MHT_ISA22 ;
SET NOCOUNT OFF;
END
GO
Now, the module for calling the above procedure
namespace DAL;
public class DisplayData
SqlLayer layer = new SqlLayer();
public int tblFlag { get; set; }
public DataTable GetData(int tblFlag)
SqlParameter[] p = new SqlParameter[1];
p[0] = new SqlParameter("@tblFlag", this.tblFlag);
return layer.ExecuteDataSet("PROC_SELECT_TABLES", p).Tables[0];
Now the SQL LAYER, containing the ExecuteDataSet and database connection code:
namespace DAL;
public class SqlLayer
// sql connection code
public DataSet ExecuteDataSet(string commandText, SqlParameter[] sqlParameter)
SqlCommand cmd = new SqlCommand(commandText, this.conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddRange(sqlParameter);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
sda.Fill(ds);
return ds;
Now the windows form layer:
using DAL;
namespace BookKeepingSystem
public partial class DisplayDataForm : Form
DisplayData view = new DisplayData();
private void GetData()
view.tblFlag = 3;
DataTable dt = view.GetData(view.tblFlag);
dgvDisplayData.DataSource = dt;
public DisplayDataForm()
InitializeComponent();
private void DisplayData_Load(object sender, EventArgs e)
GetData();
private void btnExit_Click(object sender, EventArgs e)
Application.Exit();
When I run the code I got the error:
"Unhandled exception has occurred in your application...
Procedure or function 'PROC_SELECT_TABLES' expects parameter @TBL_FLAG, which was not supplied"
I can not figure what is missing with my code. Please can any one point out please.
Thank You!!!

Try something like this for starting -- do just this procedure to see if it works first.
private DataTable GetDataTable(SqlConnection conn1)
SqlDataAdapter daS1 = new SqlDataAdapter();
daS1.SelectCommand = new SqlCommand();
daS1.SelectCommand.Connection = conn1;
if (conn1.State == ConnectionState.Closed) conn1.Open();
daS1.SelectCommand.CommandType = CommandType.StoredProcedure;
daS1.SelectCommand.CommandText = "yourStoredProcedureName";
daS1.SelectCommand.Parameters.Add("@ParamName", SqlDbType.Int, 4);
DataSet DS1 = new DataSet();
daS1.Fill(DS1, "tbl1");
return DS1.Tables["tbl1"];
Note:  in the CommandText part place the name of your stored procedure.  In the Parameter part put the name of your parameter exactly as it is in the actual stored procedure.  Also, (if you have not done this already) make sure your stored
procedure runs OK -- first -- test out your stored procedure in Sql Server Management Studio.  If the procedure runs OK in SSMS, then try it from you app.  Just create a simple form with one button .  Place GetDataTable() code under
the button and call it something like this:
private void button1_Click(object sender, EventArgs e)
int i = GetDataTbl().Rows.Count;
Console.WriteLine("i is {0}", i);
Rich P

Similar Messages

  • Passing Parameter to Stored Procedure from Form

    Hello All,
    I have been stuck while passing a form parameter to a database Procedure.In the query data source arguments I have provided the parameter Value as :parameter.parameter_1...Is it right...
    Can somebody throw some more light on this...
    Regards,
    Kaps

    You can pass the parameters from Forms through the Query Data Source Arguments of this block.
    There are a little example on http://www.Friedhold-Matz.de/appl_plan.htm.
    I used in block B the Query Data Source Arguments property to fill the
    procedure input arguments with the :PARAMTER.P_name of this Form.
    Hope it helps
    Friedhold

  • Whenever I update from Windows 7 get error 1602, iPod shows USB connection to iTunes, but iTunes will not recognize the device. None of the Apple documentation helps.

    Whenever I update from Windows 7 get error 1602, iPod shows USB connection to iTunes, but iTunes will not recognize the device. None of the Apple documentation helps. The Apple Mobile Device driver is loaded and operating. The anti-virus software and firewall are not at fault (were uninstalled, and made no difference). The iTunes on my older machine running Vista does recognize the inoperative iPod (iTunes has detetced an iPod in recovery mode) and allows me to restore the device. Can anyone help to resolve this problem on the Windows 7 PC?

    So yu tried all of this:
    Error 1600, 1601, 1602: Try the following steps to resolve this error:
    Ensure proper USB isolation troubleshooting has been performed, and test with a known-good cable.
    Follow the steps listed for Error 1604.
    This error may be resolved by disabling, deactivating, or uninstalling third-party security, antivirus, and firewall software. See steps in this article for details on troubleshooting security software.
    Error 1604: This error is often related to USB timing. Try changing USB ports, uninstalling and reinstalling USB ports, and other available USB troubleshooting steps (troubleshooting USB connections, device not recognized properly, computer won't recognize a FireWire or USB device). If you are using a dock, bypass it and connect directly to the white Apple USB dock connector cable. If the issue persists on a known-good computer, the device may need service.
    If the issue is not resolved by USB isolation troubleshooting, and another computer is not available, try these steps to resolve the issue:
    Connect the device to iTunes, confirm that the device is in Recovery Mode. If it's not in Recovery Mode,put it into Recovery Mode.
    Restore and wait for error 1604.
    When prompted, click OK.
    Close and reopen iTunes while iPhone remains connected.
    iPhone should now be recognized in Recovery Mode again.
    Try to restore again.
    If the steps above do not resolve the issue, try restoring using a known-good USB cable, computer, and network connection.
    If you had then time for an appointment at ther Genius Bar of an Apple store.

  • Passing dynamic parameter to stored procedure from CR formula?

    Dear all,
    I need to insert in some textboxes the right string based on the desired Language Code.
    I crated a stored procedure in my db.
    CREATE PROCEDURE MY_GET_TRANSLATION
         @TextID nvarchar(8),
         @LangCode int
    This parameters are used as keys to get the Trans field.
    I created a workshop formula: GetTranslation
    Please, can someone suggest the correct statement to call my MY_GET_TRANSLATION  stored procedure passing parameters?
    I would like to call the GetTranslation formula from all my textboxes, passing the specific TextID value
    and visualized the right translated string.
    For example:
    in my TEXT1 textbox, I would like to call the GetTranslation formula passing the parameters
    TextID = "T000001"
    and
    LangCode = 13    (Italian language)
    How can pass dynamic parameters to a formula?
    How can pass dynamic parameters to a stored procedure from a CR formula?
    Regards
        Emanuele

    Dear Jason,
    I'm trying to modify a SAP B1 CR marketing report.
    This CR marketing document is called by SAP B1 automatically passing the Document Number and Document Type.
    The report uses the right SAP B1 tables to read the information of the header and rows of the document.
    The language of the document is contained in a field of the header table
    {MyMarketingDocTable.LanguageID}
    I created a user table named "MyTranslationTable" where I added some strings in different langiages.
    For example:
    TexiID            TextString              LangID
    T00001          Delivery                          8      
    T00001          Consegna                     13       (Italian translation)
    T00002          Invoice                           8
    T00002          Fattura                         13       (Italian translation)
    In the header of the report I'd like, for example, to visualise the string "Consegna" if my document is a delivery in italian language.
    I'd like to implement this method to translate all the textboxes (header, comments, etc.) based on the languageID of my document.
    For each textboxes, in the CR designer statically I know what TextID I want to visualized but dinamically I need to pass to my stored procedure the right language. I'd like my report automatically gets the language at run-time. I don't want that when I press the Print-preview button in SAP B1, the report asks to prompt the languageID.
    It already read the DocNum and DocType and it already filter the SAP B1 tables basing on the DocNum and DocType of the document. In this way it reads the right row in the SAP B1 table and in this way I can read all the fields of this row (also the languageID of the actual document).
    Regards
        Emanuele
    Edited by: Emanuele Croci on Dec 3, 2010 9:03 AM

  • Passing parameter into stored procedure

    Hi guys,
    I have a big problem here passing as a parameter in stored
    procedure.
    If i pass as a parameter in where clause it is working fine.
    Whenever i pass the parameter in order by it was not working..
    How to implement this issue????
    Here i am giving the example for package:
    PACKAGE XTRA.TEST_STATUS
    AS
    TYPE GenericCurTyp IS REF CURSOR;
    PROCEDURE SP_MAIN
    ( insortgroup IN VARCHAR2,GENERAL_CUR IN OUT GenericCurTyp);
    END TEST_STATUS;
    PACKAGE BODY XTRA.TEST_STATUS
    AS
    PROCEDURE SP_MAIN
    ( insortgroup IN VARCHAR2, GENERAL_CUR IN OUT GenericCurTyp
    ) AS
    BEGIN
    OPEN GENERAL_CUR FOR
    select last_name,first_name from applicant Order By insortgroup;
    END SP_MAIN;
    END TEST_STATUS;
    Passing as a parameter i am getting the below details.
    LAST_NAME FIRST_NAME
    ASFSDAF DASDFASF
    Ad DASD
    Adams John
    DANA WITEST
    If i hot code the parameter insortgroup to last_name
    i am getting the below values:
    LAST_NAME FIRST_NAME
    'ANNUNZIO GIANCOLA GABRIEL
    0'BRIEN ARMA
    0120453EZ ESTANISLAO
    082479 ELIZABETH
    Thanks,
    Rao

    CREATE OR REPLACE PACKAGE xtra.test_status
    AS
      TYPE GenericCurTyp IS REF CURSOR;
      PROCEDURE sp_main
        (insortgroup IN     VARCHAR2,
         general_cur IN OUT GenericCurTyp);
    END test_status;
    CREATE OR REPLACE PACKAGE BODY xtra.test_status
    AS
      PROCEDURE sp_main
        (insortgroup IN     VARCHAR2,
         general_cur IN OUT GenericCurTyp)
      AS
        select_statement VARCHAR2 (4000) := NULL;
      BEGIN
        select_statement :=
        'SELECT   last_name,
                  first_name
         FROM     applicant
         ORDER BY ' || insortgroup;
        DBMS_OUTPUT.PUT_LINE (select_statement);
        OPEN general_cur FOR select_statement;
      END sp_main;
    END test_status;

  • Memory leak problem while passing Object to stored procedure from C++ code

    Hi,
    I am facing memory leak problem while passing object to oracle stored procedure from C++ code.Here I am writing brief description of the code :
    1) created objects in oracle with the help of "create or replace type as objects"
    2) generated C++ classes corresponding to oracle objects with the help of OTT utility.
    3) Instantiating classes in C++ code and assigning values.
    4) calling oracle stored procedure and setting object in statement with the help of setObject function.
    5) deleted objects.
    this is all I am doing ,and getting memory leak , if you need the sample code then please write your e-mail id , so that I can attach files in reply.
    TIA
    Jagendra

    just to correct my previous reply , adding delete statement
    Hi,
    I am using oracle 10.2.0.1 and compiling the code with Sun Studio 11, following is the brief dicription of my code :
    1) create oracle object :
    create or replace type TEST_OBJECT as object
    ( field1 number(10),
    field2 number(10),
    field3 number(10) )
    2) create table :
    create table TEST_TABLE (
    f1 number(10),f2 number (10),f3 number (10))
    3) create procedure :
    CREATE OR REPLACE PROCEDURE testProc
    data IN test_object)
    IS
    BEGIN
    insert into TEST_TABLE( f1,f2,f3) values ( data.field1,data.field2,data.field3);
    commit;
    end;
    4) generate C++ classes along with map file for database object TEST_OBJECT by using Oracle OTT Utility
    5) C++ code :
    // include OTT generate files here and other required header files
    int main()
    int x = 0;
    int y = 0;
    int z =0;
    Environment *env = Environment::createEnvironment(Environment::DEFAULT);
    Connection* const pConn =
    env->createConnection"stmprf","stmprf","spwtrgt3nms");
    const string sqlStmt("BEGIN testProc(:1) END;");
    Statement * pStmt = pConn->createStatement(sqlStmt);
    while(1)
    TEST_OBJECT* pObj = new TEST_OBJECT();
    pObj->field1 = x++;
    pObj->field2 = y++;
    pObj->field3 = z++;
    pStmt->setObject(1,pObj);
    pStmt->executeUpdate();
    pConn->commit();
    delete pObj;
    }

  • Calling PLSQL Stored Procedure From HTML Form Submit Button

    Hi there,
    I am having a little difficulty with calling a stored procedure using an html form button. Here is the code I have right now...
    HTP.PRINT('<form action=ZWGKERCF.P_confdelete>');
    HTP.PRINT('<input type=''submit'' value='' Yes '' onClick=''document.getElementById("mypopup").style.display="none"''>');
    HTP.PRINT('</form></div>');Here is the issue - I need to find a way to pass variables to this stored procedure so it know what data to operate on. This stored procedure will delete data for a specific database record and I must pass three variables to this procedure to make it work.
    Lets call them class_number, term, conf These three variables will be passed and the data will be deleted and the person will see a confirmation screen once the delete query has been executed.
    So ideally I would want: ZWGKERCF.P_confdelete(class_number, term, conf) and then the stored procedure would handle the rest!
    Seems pretty simple but I am not sure how to make this happen... My thoughts were:
    Pass the data to this html form (the three fields I need) in hidden variables. Then somehow pass these using POST method to the procedure and read using GET?
    Can someone clarify what the best way to do this is? I have a feeling its something small I am missing - but I would really like some expert insight :-)
    Thanks so much in advance!
    - Jeff

    795018 wrote:
    I am having a little difficulty with calling a stored procedure using an html form button. Here is the code I have right now...
    HTP.PRINT('<form action=ZWGKERCF.P_confdelete>');
    HTP.PRINT('<input type=''submit'' value='' Yes '' onClick=''document.getElementById("mypopup").style.display="none"''>');
    HTP.PRINT('</form></div>');Here is the issue - I need to find a way to pass variables to this stored procedure so it know what data to operate on. This stored procedure will delete data for a specific database record and I must pass three variables to this procedure to make it work. The browser generates a POST or a GET for that form action, that includes all the fields defined in that form. Let's say you define HTML text input fields name and surname for the form. The URL generated for that form's submission will be:
    http://../ZWGKERCF.P_confdelete?name=value1&surname=value2The browser therefore submits the values of the form as part of the URL.
    The web server receives this. It sees that the base URL (aka location) is serviced by Oracle's mod_plsql. It passes the URL to this module. This module builds a PL/SQL block and makes the call to Oracle. If we ignore the additional calls it makes (setting up an OWA environment for that Oracle session), this is how the call to Oracle basically looks like:
    begin
      ZWGKERCF.P_confdelete( name=> :value1, surname =>  :value2 );
    end;Thus the PL/SQL web enabled procedure gets all the input fields from the HTML form, via its parameter signature. As you can define parameter values with defaults, you can support variable parameter calls. For example, let's say our procedure also have a birthDate parameter that is default null. The above call will still work (from a HTML form that does not have a date field). And so will the following URL and call that includes a birth date:
    URL:
    http://../ZWGKERCF.P_confdelete?name=value1&surname=value2&birthdate=2000/01/01
    PL/SQL call:
    begin
      ZWGKERCF.P_confdelete( name=> :value1, surname =>  :value2, birthdate => :value3 );
    end;There is also another call method you can use - the flexible 2 parameter interface. In this case the PL/SQL procedure name in the URL is suffixed with an exclamation mark. This instructs the mod_plsql module to put all input field names it received from the web browser into a string array. And put all the values for those fields in another string array. Then it calls your procedure with these arrays as input.
    Your procedure therefore has a fixed parameter signature. Two parameters only. Both are string arrays.
    The advantage of this method is that your procedure can dynamically deal with the web browser's input - any number of fields. The procedure's signature no longer needs to match the HTML form's signature.
    You can also defined RESTful mod_plsql calls to PL/SQL. In which case the call format from the web browser looks different and is handled differently by mod_plsql.
    All this (and more) is detailed in the Oracle manuals dealing with mod_plsql - have a search via http://tahiti.oracle.com (Oracle Documentation Portal) for the relevant manuals for the Oracle version you are using.
    Alternatively, simply download and install Oracle Apex (Application Express). This is a web development and run-time framework and do all the complexities for you - including web state management, optimistic locking, security and so on.

  • Passing parameter in stored procedure

    Hi, I am really new to using Oracle stored procedure. I have just tested a sample stored proc which should return multiple rows without passing any parameter.
    here is the stored proc I wrote
    create or replace procedure get_address
    as
    cur_table sys_refcursor;
    begin
    open cur_table for
    select * from address_table order by addr_id;
    end;
    when I execute it, I get a message "Procedure Created"
    then I executed the stored proc
    exec get_address;
    I again get a message "PL/SQL procedure successfully completed" and I do not see the records at all.
    so I decide to rewrite to the stored proc as such
    create or replace procedure get_address(cur_table out sys_refcursor)
    as
    begin
    open cur_table for
    select * from address_table order by addr_id;
    end;
    everthing is good so far.
    now when execute it
    exec get_address;
    I am getting the following error:
    "PLS-00306: wrong number or types of arguments in call to 'TESTCODEPROC'"
    I have searched so many places, but there is no document talks about this issue. I hope someone can help me to over come this. I need to call this stored proc from .NET 2.0 reporting viewer which is embedded in asp.net page.
    Thank you.

    so I decide to rewrite to the stored proc as such
    create or replace procedure get_address(cur_table out
    sys_refcursor)
    as
    begin
    open cur_table for
    select * from address_table order by addr_id;
    end;
    everthing is good so far.
    now when execute it
    exec get_address;
    I am getting the following error:
    "PLS-00306: wrong number or types of arguments in
    call to 'TESTCODEPROC'"
    From what you wrote I can assume that you have used SQL server before. Oracle does not automatically return the last opened cursor from a stored procedure like the query result, so you cannot just call exec get_address; (or just execute the procedure from .NET code). You will have to pass the cursor parameter and fetch it as an output parameter value in .NET, then use it to get the data reader etc.
    On the other hand, you can just execute the statement directly. I see a lot of folks coming from SQL server world using stored procedures like crazy even for things that are naturally suited to queries and views. Oracle view allows you to apply the same security restrictions you can put onto a stored procedure, and if you use statement caching and bound variables, you get precompilation benefits as well with a view. Using a view instead of a procedure in this case will require less code both in the database and in .NET, and will give you a more flexible interface in terms of retrieved columns and ordering.
    gojko adzic
    http://gojko.net

  • Pass a date parameter to Stored Procedure

    Hello friends,
    Can you help to pass a date parameter to Stored procedure from JSP. This is my code:
    In Oracle 9i I have this:
    PROCEDURE SP_EDORES(
    pfechaini IN hist_pol_reclama.hrc_fecha_contabilidad%Type, <-- This is a date field
    pfechafin IN hist_pol_reclama.hrc_fecha_contabilidad%Type, <-- This is a date field
    p_recordset OUT PKG_REP_CIERRE.cursor_type) AS
    In JSP have this:
    CallableStatement stmt = (CallableStatement)conn.prepareCall( "begin PKG_REP_CIERRE.SP_EDORES(?,?,?); end;" );
    stmt.registerOutParameter(3,oracle.jdbc.driver.OracleTypes.CURSOR);
    stmt.setDate(1,Date.valueOf("01-06-2005"));
    stmt.setDate(2,Date.valueOf("30-06-2005"));
    ResultSet rset = (ResultSet)stmt.getObject(3);
    while (rset.next()) {
    %>
    <TR>
    <TD ALIGN=CENTER> <%= rset.getString(1) %> </TD>
    <TD ALIGN=CENTER> <%= rset.getString(2) %> </TD>
    <TD ALIGN=CENTER> <%= rset.getString(3) %> </TD>
    <TD ALIGN=CENTER> <%= rset.getInt(4) %> </TD>
    </TR>
    <%
    The Stored Procedure returns de Result set, however I think does not recognized the date format because I need it with this format dd-mm-yyyy.
    Thanks in advance

    to use Date you will need the oracle package.
    u can try this other solution: use String, not Date
    CallableStatement stmt = (CallableStatement)conn.prepareCall( "begin PKG_REP_CIERRE.SP_EDORES(?,?,?); end;" );
    stmt.registerOutParameter(3,oracle.jdbc.driver.OracleTypes.CURSOR);
    stmt.setString(1,"01-06-2005");
    stmt.setString(2,"30-06-2005");
    ResultSet rset = (ResultSet)stmt.getObject(3);
    while (rset.next()) {
    %>
    if this don't work you can change your PL/SQL to get Strings and do the conversion with TO_DATE in the sql statement.

  • Passing UDT TABLE of VARCHAR as an Input parameter in Stored procedure call from java

    I have following Type defined at the schema: ident_arr IS TABLE OF VARCHAR2(100) which is type of one of the input parameters. I am able to create oracle.sql.ARRAY object to map it with this UDT before calling my stored procedure from java. When I execute my stored procedure, I get the following error:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'P_PV_WCC_INSERT'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    I have already checked all other parameter types.

    Hello,
    Thank you, guys, for advice. I should have explained calling context before, but what I basically need to do is to see if procedure(arg1, list(record(arg2, arg3))) returns true.
    I see array binding wouldn't fit there nicely. Internal procedure calls would be proc(next(arg1), next(arg2), next(arg3)) - if all these return true, external call should also return true. I would need to make a list of repeating values of arg1 and separate list(record(arg2, arg3)) into separate lists. I would also need to record whether the internal call returns true to deduce whether external call returns true.
    As I see no better way yet, I'll make Oracle procedure proc(arg1, arg2, arg3) and implement a loop in .NET side. If I optimize for performance, I'll probably pack the array of records into string and pass it for Oracle side to parse.
    Regards,
    Aurimas Pranskevicius

  • Call Stored Procedure from Forms 6i -- Urgent Plz...

    Dear All,
    I am first writing a stored procedure as:-
    CREATE OR REPLACE FUNCTION
    good_hire
    (birthdate_in IN DATE,
    reqsal_in IN NUMBER)
    RETURN BOOLEAN
    IS
    too_young BOOLEAN :=
    ADD_MONTHS
    (SYSDATE, -216) >
    birthdate_in;
    too_expensive BOOLEAN :=
    reqsal_in > fin.dept_bal;
    BEGIN
    RETURN NOT (too_young
    OR too_expensive);
    END;
    Now in my forms also i have the same function,which i defined in in my program unit i.e., with the same name good_hire,but with different parameters.
    If I want to call this stored procedure(good_hire)in my form
    I am writing this code in the pre-Insert trigger.
    IF good_hire
    (:newemp.birthdate,
    :newemp.proposed_sal)
    THEN
    SELECT empseq.NEXTVAL
    INTO :newemp.empno
    FROM dual;
    ELSE
    RAISE FORM_TRIGGER_FAILURE;
    END IF;
    Notice that i am sending bind variables from my form to the
    stored procedure. Now my question :
    1) Can i pass bind variables to the stored procedures from
    forms or is there any other way i can access the
    stored roceures from forms(Expecting a detailed answer) and
    from which triggers can I access the stored procedures(like pre-
    Insert here)?
    2) If at all I have the same parameters in my program unit
    function and with the same name good_hire, I know that the code
    in the pre-Insert trigger will call only the function in my
    program unit and not the stored procedure, but if I like to
    call my stored procedure instead of the local function good_hire
    then what should I do?
    2)As I said before if i have different parameters, for the
    stored procedure good_hire and local function good_hire and If
    I call good_hire from my pre-insert trigger .. Is it that the
    Forms will decide and call the Local function or stored
    procedure depending on the parameter list?
    I hope all my points are very clear.
    I am expecting the best and detailed answer for my
    Queries, I also hope these Quests will clear the doubts of many
    members in our esteemed group.
    Thnx in Advance...
    Regards
    siree....

    Dear Siree,
    Oh!! how many Questions? Each how much big??
    Ok First of all the answer to your first question.
    You can use the Stored procedures in the same way as the Forms procedures. You can pass bind variables to the stored procedures as well. You can also use the stored procedures in any triggers, I think there are no restrictions for that. The only thing is you should be connected to database while compiling the trigger where you are calling the stored procedure.
    Answer to your second question.
    You cannot direct Forms (I don't know about version 10g), untill 9i, you cannot tell forms to take the stored procedure and leave the local procedure. It will always take the local procedure, once a procedure is called. If not found locally then only it will go for the Stored procedures.
    For your third question.
    As I told you b4 forms searches for the procedure being called locally first, if locally present, does not go to the stored procedure. If declared by different paramaters in the stored procedure and it is called, then it will throw error (as it first searches for the name locally and if found will take up the one present locally and since that procedure is with different parameter, will throw up error). It is after all a stupid machine and can't think like us.
    Regards,
    Senthil .A. Perumal

  • Problem passing OUT parameters form based on stored procedure to another form?

    Hello,
    I am unable to pass parameters of type OUT from a form based on a stored procedure to another form.
    However, I am able to pass parameters of the type IN to the other form.
    This is the code that I have under the heading
    On successful submission of a form, execute this PL/SQL block or PL/SQL procedure:
    declare
    v_partno varchar2(100);
    v_partdesc varchar2(200);
    blk varchar2(10):='DEFAULT';
    v_names varchar2(1000);
    v_values varchar2(1000);
    begin
    v_partno:=p_session.get_value_as_varchar2
    (p_block_name=>blk,p_attribute_name=>'A_PART_NO');
    v_partdesc:=p_session.get_value_as_varchar2
    (p_block_name=>blk,p_attribute_name=>'A_PART_DESC');
    v_names := '_moduleid:_show_header:pnumber:pdescription';
    v_values := '1325575336:YES:' || LTRIM(TO_CHAR(v_partno)) || ':' || LTRIM(TO_CHAR(v_partdesc)) ;
    PORTAL.wwa_app_module.link (
    p_arg_names => PORTAL.wwv_standard_util.string_to_table2(v_names),
    p_arg_values => PORTAL.wwv_standard_util.string_to_table2(v_values));
    end
    Info:
    1. Passing PART_NO (IN parameter) and PART_DESC (OUT paramter) to another form.
    2. After hitting the submit button, the second form comes up, but with only the PART_NO(type IN) field completed. The PART_DESC(type OUT) field did not get passed to the second form.
    3. The corresponding fields in the second form are pnumber & pdescription.
    4. FYI - I can see all the OUT parameters correctly, if I don't try to pass control to the second form.
    5. Portal 9.0.2 ( the version that ships with IAS 9.0.2)
    Any help would be greatly appreciated. I have been stuck here for a while now!
    Dev

    Re: Error
    Passing OUT parameter to another form.
    You cannot retrieve the value of the OUT parameter from the session object because after executing your procedure,
    the value passed out using the OUT parameter is not loaded in the session object.
    But you can still achieve what you are trying in the following way.
    Let's assume that your procedure has the following str :-
    procedure proc1 (p_in in varchar2,
    p_out out varchar2)
    is
    begin
    /* your processing statements
    end;
    Say, the name of the field, in the 2nd form, where you need to pass the out parameter value is VALUE_FROM_OUT.
    1> Edit the form on procedure proc1
    2> Select the submit button in the left frame and for the PL/SQL button handler choose Submit action.
    3> In the adjacent textarea, comment out the doSubmit statement and use code given below :-
    declare
    l_p_in varchar2(32767);
    l_p_out varchar2(32767);
    l_url varchar2(2000);
    begin
    l_p_in := p_session.get_value_as_varchar2(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_P_IN');
    execute immediate
    'begin <schema>.proc1(:b_in,:b_out); end;'
    using in l_p_in, out l_p_out;
    l_url := 'http://<host>:<port>/pls/<dad>/<portal-schema>.wwa_app_module.link?p_arg_name=_moduleid&p_arg_values=<module_id>&p_arg_names=VALUE_FROM_OUT&p_arg_values='||
    <portal-schema>.wwv_standard_util.url_encode(l_p_out);
    <portal-schema>.wwa_app_module.set_target(l_url,'CALL');
    end;
    NOTE :
    ======
    In the code given above, replace
    <schema> with the schema name that owns the procedure proc1
    <host> with webserver host
    <port> with the port of your webserver
    <dad> with the portal dad
    <portal-schema> with the name of the portal-schema
    <module_id> with the module of the 2nd form i.e. where you need to pass the value of the out variable.
    You will have to grant execute privilege on procedure proc1 to your application schema,
    if the procedure proc1 lies in a schema other than the application schema.
    4> Finish editing the form.

  • How can i pass the  parameter for strored procedure from java

    dear all,
    I am very new for stored procedure
    1. I want to write the strored procedure for insert.
    2. How can i pass the parameter for that procedure from java.
    if any material available in internet create procedure and call procedure from java , and passing parameter to procedure from java

    Hi Ram,
    To call the callable statement use the below sample.
    stmt = conn.prepareCall("{call <procedure name>(?,?)}");
    stmt.setString(1,value);//Input parameter
    stmt.registerOutParameter(2,Types.BIGINT);//Output parameter
    stmt.execute();
    seq = (int)stmt.getLong(2);//Getting the result from the procedure.

  • Parameter length limition passing to java stored procedure! help

    hi:
    i am working with java stored procedure to do some resource consuming work. i have to pass a long string (varch2) or bytes(log raw) which is larger than 32k which is the limitation
    set by oracle.
    is there a walk around?
    another question:
    i have to call java stored procedure from session beans ( weblogic app server) and how can i make sure the code
    in session beans and that in java stored procedures to be in
    the same transaction?
    regards
    daniel wang

    Hi Daniel,
    In answer to your first question: use a CLOB (for the long string)
    and a BLOB (for the long raw). Do a search for CLOB and BLOB at the
    Technet site:
    http://technet.oracle.com
    There are lots of resources including documentation and sample code.
    In answer to your second question: first, let me say that the J2EE
    forum is more suitable for that question (I haven't looked yet, but
    you may have posted there as well!). Anyway, you need to set an
    appropriate transaction attribute in your "ejb-jar.xml" descriptor
    file for your session bean. If you want to make sure that the
    session bean and java stored procedure participate in the same
    transaction, I suggest using "Required", as in:
    <trans-attribute>Required</trans-attribute>
    Hope this helps.
    Good Luck,
    Avi.

  • Is it possible to pass TABLE as the output parameter in stored procedure

    Hey Experts,
      Is it possible to pass TABLE as the output parameter in stored procedure.
    eg
    create procedure spGetData
    @tableName as TABLE(intValue INT NOT NUL)
    as 

    You can use OPENQUERY or OPENROWSET, as mentioned above, to make stored procedure results table like. There are
    some limitations with these methods:
    http://technet.microsoft.com/en-us/library/ms188427.aspx
    In OPENQUERY this-sql-server-instance can be used instead of a linked server name. It requires setting data accces server option:
    exec sp_serveroption @server = 'PRODSVR\SQL2012'
    ,@optname = 'DATA ACCESS'
    ,@optvalue = 'TRUE'
    LINK: http://www.sqlusa.com/bestpractices/select-into/
    Kalman Toth Database & OLAP Architect
    SELECT Video Tutorials 4 Hours
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

Maybe you are looking for

  • Service Enhancements ESR - Integration Builder

    Hello, I made some enhancements of standard services in the ESR. In the ABAP backend I created the corresponding proxys. But when I try to to configure the enhanced services in the Integration Builder I only get the standard services. How can I refer

  • Best Security Settings for Mac Newbie

    Hello I'm new Mac user (OS X 10.9) and am still trying to get to grips with Apple's OS. Hopefully this question won't have been asked too many times before! Sorry In 'settings' - 'security & privacy', how should I configure it? It's just me using the

  • Best way to move db to a schema?

    Hello, In our SQL Server 2008 environment, we have many parent databases and each parent database has many child databases. As part of a database consolidation project, I plan to merge each parent db and its child dbs into one db. All parent dbs have

  • Selecting specific values

    Hi, thank you for viewing my discussion. I have two pdf forms, Order Form and Invoice Form. On the Order Form I have a submit button that submits an FDF file. I then will open the FDF file with the Invoice Form and it populates the form fields. Howev

  • HT203747 Help! I am getting an error to use FaceTime on my computer!

    Every time I try to sign in to FaceTime on my MacBook, I keep getting this pop up - "Customer Code: 2141-7200-4404". There is a number to call, but unfortunately every time I call, it is after hours! Can someone please help?!