Work unit and a stored procedure

Is it possible to call a stored procedure in a work unit that runs as part of the validation of the work unit?

We have a backend process where we call a procedure to make a working group that is shared between a TopLink app and a legacy application. When it is called from the TopLink one, we updates made by the procedure to be in the same transaction of data than the rest of the book. Data updates the procedure is not accessed by the application of TopLink, so we are not worried about updated outside TopLink.

Thank you
Matt

Simply run the StoredProcedureCall in the UnitOfWork, it will be in the same transaction as the validation of UnitOfWork. If you don't want it running until the validation, you can use a SessionEvent.

-----
James: http://www.eclipselink.org

Tags: Fusion Middleware

Similar Questions

  • Y at - it a syntax better/more runs to get data to and from stored procedures?

    To test the stored procedure call, I created a simple package

    create or replace package TEST_PROCEDURES as
    
    procedure Test1 (
       arg1 in number,
       arg2 in number,
    
       res1 out number,
       res2 out number);
    
    end;
    
    

    and a page with fields number four (P1_INPUT_2, P1_OUTPUT_1, P1_INPUT_1, P1_OUTPUT_2) and a button excuting the code following PL/SQL:

    declare
      arg1 integer;
      arg2 integer;
      res1 integer;
      res2 integer;
    begin
      arg1 := :P1_INPUT_1;
      arg2 := :P1_INPUT_2;
    
      TEST_PROCEDURES.Test1(arg1, arg2,
                            res1, res2);
                        
      APEX_UTIL.SET_SESSION_STATE('P1_OUTPUT_1', res1);
      APEX_UTIL.SET_SESSION_STATE('P1_OUTPUT_2', res2);
    end;
    
    

    It works, but it looks like a lot of unnecessary code to me. Any suggestions?

    TryingAPEX wrote:

    To test the stored procedure call, I created a simple package

    create or replace package TEST_PROCEDURES as

    procedure (Test1

    in number arg1,

    arg2 in number,

    RES1 number,

    Res2 number);

    end;

    and a page with fields number four (P1_INPUT_2, P1_OUTPUT_1, P1_INPUT_1, P1_OUTPUT_2) and a button excuting the code following PL/SQL:

    declare

    whole arg1;

    Whole arg2;

    integer res1.

    whole Res2;

    Start

    arg1: =: P1_INPUT_1;

    Arg2: =: P1_INPUT_2;

    TEST_PROCEDURES. Test1 (arg1, arg2,

    RES1, res2);

    APEX_UTIL. SET_SESSION_STATE ('P1_OUTPUT_1', res1);

    APEX_UTIL. SET_SESSION_STATE ('P1_OUTPUT_2', res2);

    end;

    It works, but it looks like a lot of unnecessary code to me. Any suggestions?

    Why would you do that? APEX may be referenced in the same way as all the other bind variables (although it is worth noting that their type is always VARCHAR2, so in this case, it will rely on the implicit conversion):

    begin
      test_procedures.test1(:p1_input_1, :p1_input_2, :p1_output_1, :p1_output_2);
    end;
    

    For the previous discussion on this topic, see set manually with PL/SQL session state .

    Always advanced postal code using the functionality of the syntax highlighted in the editor.

  • In a table - looping through the rows and the stored procedure call

    APEX version: 3.2.0.00.27

    Hello

    I searched the forum and tried a few things but could not make it work.

    I have a tabular presentation, developed with the help of the ATD (Cascading LOV - method of tabular presentation - AJAX - ATD )

    What I'm trying to do now:
    -After submit and validations, loop through all the lines and
    -call a stored procedure passing 3 parameters obtained from each of the lines on the form of tables. This procedure will be an update of a database table.

    On the forum, I found that I could do the loop "* FOR i IN 1..." APEX_APPLICATION.g_f03. "LOOP COUNT *" syntax.

    Only for testing purposes, I tried just to view information with the following (On Load - after a footer) process (example of Denes Kubicek == > http://deneskubicek.blogspot.com/2009/05/execute-javascript-throuhg-plsql.html):
    declare
      v_today  varchar2 (200);
    begin
    --  :P40_test := APEX_APPLICATION.g_f03(1);
    --  :P40_test2 := APEX_APPLICATION.g_f04.COUNT;
      :P40_test2 := 100;
    
      v_today := to_char (sysdate, 'dd.mm.yyyy');
    
    --FOR i IN 1.. APEX_APPLICATION.g_f03.COUNT LOOP 
    
      :P40_test := APEX_APPLICATION.g_f02(2);
    
      HTP.p ('<script type="text/javascript">');
      HTP.p (   'alert(''Today is '
              || v_today
    --          || APEX_APPLICATION.g_f04(APEX_APPLICATION.g_f03(i))
              || '.\n'
              || 'end!'');'
             );
      HTP.p ('</script>');
    
    --    :P40_test := APEX_APPLICATION.g_f02(APEX_APPLICATION.g_f02(i));
    
    --END LOOP;
    
    end;
    The foregoing would give me a ' * ORA-01403: no data found * ' message. I tried through various variants of APEX_APPLICATION.g_f0* #*, but still can't get anything to display correctly. In commenting on all the lines referring to APEX_APPLICATION.g_f0x above, the date would be are they displayed fine.

    I tried uncomment the FOR... LOOP and play with the code (defining the process runs "On submit - after calculations" and Validations), I got was a ' * ORA-06502: PL/SQL: digital error or value: character conversion number error * "message.

    Here is the script of the form in a table:
    select 
    "V"."MSLINK",                                       -- hidden (number)
    "V"."INSTALLATION_DATE",                        -- editable date picker
    "V"."MANUFACTURER_INDICATOR",              -- editable (cascading LOV -- text)
    "V"."MODEL_INDICATOR",                           -- editable (cascading LOV -- text)
    "V"."DIAMETER_INDICATOR",                      -- editable (LOV -- number)
    "V"."PURPOSE_INDICATOR",                        -- editable (LOV -- text)
    "V"."VALVE_NUMBER",                                -- shown but not editable -- number
    "V"."MODIFY_DATE",                                  -- shown but not editable
    "V"."MODIFY_USER",                                   -- shown but not editable
    "V"."VALVES_STYLE"."FEATURE"                  -- shown but not editable -- number
    from "#OWNER#"."VALVES" "V"
    Where
      "V"."PROJECT_ID" = :P1_PROJECT_NUMBER AND
      "V"."VALVES_DFLAG" = 0
    Regarding the parameters for the stored procedure, it would the MSLINK, VALVE_NUMBER and the VALVES_STYLE. FEATURE.

    Help, please!
    (Sorry for the long post).

    Thank you

    Tan

    Hi, Tan,

    I have not seen that type of object - I've only used custom types for purposes of test years ago and have never used their within Apex!

    One possibility is that the value of checksum being is based on all of the content of these fields, rather than only the part of the FEATURE. If there are other parts of the object, you could include those items as well.

    Otherwise, as you f01 KP for a record, you will need to retrieve the values of the FUNCTION in your PL/SQL code directly from the table (because the user cannot modify these fields, you can be sure that the values in the table will be still valid).

    Andy

  • Hit and run stored procedure

    Hi there are CF community.

    I'm back with yet ANOTHER question.
    I have a stored procedure in a MSSQL 2000 Dbase that does some work on a few thousand files.
    I want to be able to execute this stored procedure to CF, BUT I don't want the page to just sit and wait
    the proc to finish it right - + 4 minutes and the page would just expire.
    In addition to that I don't want all the data to return.
    The only reason I do not use a SQL planning for this is because the page that activates the proc is one of several pages, chained to each performing different tasks on the volume of original data.
    The page starts the proc and then extends the finish line.
    This task is the final of 3 pages which will be programmed SEE every night.

    ASP.NET is also a possibility that CF is unable to do the job.

    Thanks again. You lot are very useful in regard to my previous XML messages.
    El crabs



    Hi all.

    Found a solution for the release of a large stored procedure without
    the sat page and wait for a response, leading to expire.

    You create a task in MS SQL 2000 Enterprise Manager through the 'jobs' node located under the
    SQL Server Agent, located under the management node in the view tree on the left panel.

    127.0.0.1--> management-> SQL Server Agent-> jobs

    In the right pane, right-click "new work", then fill the small details + a name for the task.
    then, under new, click 'STEP', fill in more details, but especially, check the box of commands with "EXECUTE ". Click all bad them OK the of to finish.

    Take the work once its done then the name you have specified previously and use it in the SQL string on the connection/request object.
    * The following was tested in asp.net, I have not tested in coldfusion, but it still needs to get the same results.

    (script missing from this, but I'm only display this line because it is the most important of them)

    COLDFUSION

    Use msdb exec sp_start_job @job_name = "".

    ASP.NET
    Dim SqlCmd = New SQLCommand("Use msdb exec sp_start_job @job_name = ''", connection)

    This line will be executed, the page will be on the next line without wait until the stored procedure completes. No time-outs, no pain in the neck ect.

    His sloppy in some context, but it works.
    Good looking.

    Enjoy.
    El of crabs.

  • Once a week, I can do a really important work United and the bloody thing freezes and says "not responding".

    I have to open Firefox, then as soon as he opens States "not responding" and then starts to work, then 'glue' on each page/site, that I will. Do United important work and am getting sick of that past, it is grand or garbage and very bloody boring.

    upgrade your Firefox 9 browser and check

  • Create entity objects and view stored procedures.

    Dear all,

    How can I create a vo and eo to the procedure that returns 4 refcursors.

    Kind regards
    David

    Version of the component
    =========     =======
    11.1.1.59.23 ADF business components
    Java (TM) Platform 1.6.0_21
    Oracle IDE 11.1.1.4.37.59.23
    Support versioning 11.1.1.4.37.59.23

    Oracle 10g database.

    I did not write the docs for me it's a documentation error.
    The missing statement should get the result set that was the store at executeQueryForCollection() before (in the data of the user of the qc).

    Check out this http://adfpractice-fedor.blogspot.com/2011/01/adf-bc-programmatically-populated-vo.html here you get a complete sample with the code.

    Timo

  • Difference between function and stored procedure

    Hi guys, I don't understand the exact difference between a function and a stored procedure. I have a lot of google but still. Can someone explain in simple terms. Thank you.

    Hello

    Here is an example of a user-defined function:

    CREATE OR REPLACE FUNCTION     factorial
    (      in_num       IN     PLS_INTEGER
    )
    RETURN     PLS_INTEGER
    DETERMINISTIC
    IS
    BEGIN
         IF  in_num IS NULL
         THEN
              RETURN     NULL;
         ELSIF in_num <= 1
         THEN
              RETURN  1;
         ELSE
              RETURN  in_num * factorial (in_num - 1);
         END IF;
    END     factorial;
    /
    SHOW ERRORS
    

    This function returns an integer. You can use the function (or, more exactly, the integer returned) everywhere where a whole expression is allowed.
    For example

    SELECT     ROWNUM
    ,     factorial (ROWNUM)     AS f
    ,     loc
    ,     SUBSTR ( loc
                , 1
                , factorial (ROWNUM)
                )          AS s
    FROM     scott.dept;
    

    Output:

    `   ROWNUM          F LOC           S
    ---------- ---------- ------------- -------------
             1          1 NEW YORK      N
             2          2 DALLAS        DA
             3          6 CHICAGO       CHICAG
             4         24 BOSTON        BOSTON
    
  • Difference between stored procedure and procedure

    Hello

    could you please let me know what is the difference between the procedure and the stored procedure PL/SQL.

    Thank you.

    Best regards
    Mohan

    Published by: user10469960 on November 21, 2008 18:33

    There is no difference. The two terms are synonymous. Intrinsically, a PL/SQL procedure is stored in the Oracle data dictionary.

    Justin

  • How to migrate from MySQL to Oracle stored procedure

    Hi all

    I've migrated mysql 5.1.42 - enterprise-gpl-advanced DB for oracle sqldeveloper 3.1.07 tool.

    DB objects migrate successfully except stored procedures.

    I checked .sql and files... Capture process not captured SQL stored procedures.

    Could you please suggest where I can check correct error or how to fix this.

    Thanks in advance.

    Hello

    SQL * Developer version you use is an old and you must use the latest version available from this link.

    Oracle SQL Developer

    However, even the v4 version does not support the migration of procedures stored as stated in this link - MySQL

    http://www.Oracle.com/technetwork/developer-tools/SQL-Developer/supportedmigplatforms-086703.html

    You will need to manually convert the MySQL in Oracle format, stored procedures since even the "Scratch Editor" under "tools - migration '-doesn't have an option for MySQL conversion.

    The documentation includes details of the difference between MySQL and Oracle stored procedures-

    Oracle SQL Developer information for the migration of MySQL®

    in chapter Triggers and procedures stored

    Kind regards

    Mike

  • Double games of results returned on stored procedure call

    Hello

    I have a stored procedure created Java and called using the Spring JDBC using StoredProcedure class, stored procedure returns duplicate rows, is this a known problem?

    When I run the stored procedure even in DBVizualiser it not show correctly.

    The class below is used to execute the stored procedure:

    public class CustomerSearchProcedureRunner extends StoredProcedure {
     public CustomerSearchProcedureRunner(JdbcTemplate jdbcTemplate) {
      super();
      this.setJdbcTemplate(jdbcTemplate);
      this.declareParameter(new SqlReturnResultSet(RETURN_RESULTS, new CustomerRowMapper()));
      this.declareParameter(new SqlParameter(CUST_SP_IN_PARAM, Types.VARCHAR));
      this.setSql("{CALL INSURANCE.SEARCHCUSTOMER (?) ON ALL}");
      this.setSqlReadyForUse(true);
      this.compile();
     }
    }
    


    and Java Stored Procedure that runs SQLFire is given below:

    public class CustomerSearchProcedure {
     
     private static final String DOLLAR = "\\$";
     private static final String COLON = ":";
     private static final String CUST_NAME = "CUST_NAME";
     private static final String CUST_NO = "CUST_NO";
     private static final String GENDER = "GENDER";
     
     
     public static void searchCustomer (String customers, ResultSet[] outResults,
       ProcedureExecutionContext context) throws SQLException {
      StringBuilder sql = new StringBuilder();
      StringBuilder whereCondt = new StringBuilder();
      String[] tokens = new String[]{};
      
      if (customers != null && customers.trim().length() > 0) {
       tokens = customers.split(DOLLAR);
      }
      
      sql.append("<global>SELECT * FROM INSURANCE.CUSTOMERS ");
      whereCondt.append("WHERE CUST_PRIMARY IN ('Y', 'N') ");
      // Apply dynamic where condt
      for (int i=0; i < tokens.length; i++ ) {
       String token = tokens[i];
       if (token.startsWith(CUST_NO)) {
        if (whereCondt.length() > 0) {
         whereCondt.append(" AND ");
        }
        whereCondt.append("CUST_NO = " + token.substring(token.indexOf(COLON)+1));
       }
       if (token.startsWith(CUST_NAME))  {
        if (whereCondt.length() > 0) {
         whereCondt.append(" AND ");
        }
        whereCondt.append("CUST_NAME LIKE '"+ token.substring(token.indexOf(COLON)+1).trim() + "%'");
       }
       if (token.startsWith(GENDER)) {
        if (whereCondt.length() > 0) {
         whereCondt.append(" AND ");
        }
        whereCondt.append("GENDER ='"+ token.substring(token.indexOf(COLON)+1).trim() + "'");
       }
      } //End of for
      
      if (whereCondt.length() > 0) {
       sql.append(whereCondt.toString());
      }
      
      Connection cxn = context.getConnection();
      Statement stmt = cxn.createStatement();
      ResultSet rs = stmt.executeQuery(sql.toString());
      outResults[0] = rs;
     } //END OF METHOD
    }
    

    A correction preceding: "for the case on the information in the TABLE of the DataSet to be targeted on each node is also sent for the tag requests will target only this dataset (and avoids duplicates).»

    should read "in the case of on TABLE query Tags will only target the local primary data on the node for tables partitioned, while for replicated tables, it is sent to only one of the lines (and so avoids duplicates in both cases).» WHERE clause to TABLE is not used for cutting data only for the size of the set of nodes to the target.

    The tag prunes yet the query to all of the local primary buckets in all cases (i.e. which WE ALL and on GROUPS of SERVERS) so the comment about and equivalent was incorrect. However, this will always be looking for data in duplicate for replicated tables and TABLE is the only way to avoid it for now.

  • Need help to convert a sql query to a stored procedure

    I have a task to convert a script sql in a stored precedure. The sql with different pr_id test_type are below. And the stored procedure must accept a pr_id and a test_type as an argument. Test type will be 3 for ATI and 2 for TI.  It must return a single value, the greatest distance calculated to fill the value of tap.  It is possible that they will pass a prid, test_type combination that will have all the records in the dsltdr table.

    {
    SELECT pw,
    Round ((DECODE (t.rfltype1, 5, t.rfldist1,)))
    DECODE (t.rfltype2, 5, t.rfldist2,)
    DECODE (t.rfltype3, 5, t.rfldist3,)
    DECODE (t.rfltype4, 5, t.rfldist4,)
    DECODE (t.rfltype5, 5, t.rfldist5,)
    DECODE (t.rfltype6, 5, t.rfldist6,)
    DECODE (t.rfltype7, 5, t.rfldist7,)
    DECODE (t.rfltype8, 5, t.rfldist8,)
    NULL)))
    (- launch_start) * distk * vop, 2) dist
    OF dsltdr t
    WHERE pr_id = 464529581
    AND test_type = 3
    ORDER BY pw CSA;
    }



    SELECT pw,
    Round ((DECODE (t.rfltype1, 5, t.rfldist1,)))
    DECODE (t.rfltype2, 5, t.rfldist2,)
    DECODE (t.rfltype3, 5, t.rfldist3,)
    DECODE (t.rfltype4, 5, t.rfldist4,)
    DECODE (t.rfltype5, 5, t.rfldist5,)
    DECODE (t.rfltype6, 5, t.rfldist6,)
    DECODE (t.rfltype7, 5, t.rfldist7,)
    DECODE (t.rfltype8, 5, t.rfldist8,)
    NULL)))
    (- launch_start) * distk * vop, 2) dist
    OF dsltdr t
    WHERE pr_id = 464528353
    AND test_type = 3
    ORDER BY pw CSA;


    SELECT pw,
    Round ((DECODE (t.rfltype1, 5, t.rfldist1,)))
    DECODE (t.rfltype2, 5, t.rfldist2,)
    DECODE (t.rfltype3, 5, t.rfldist3,)
    DECODE (t.rfltype4, 5, t.rfldist4,)
    DECODE (t.rfltype5, 5, t.rfldist5,)
    DECODE (t.rfltype6, 5, t.rfldist6,)
    DECODE (t.rfltype7, 5, t.rfldist7,)
    DECODE (t.rfltype8, 5, t.rfldist8,)
    NULL)))
    (- launch_start) * distk * vop, 2) dist
    OF dsltdr t
    WHERE pr_id = 464527142
    AND test_type = 2
    ORDER BY pw CSA;


    SELECT pw,
    Round ((DECODE (t.rfltype1, 5, t.rfldist1,)))
    DECODE (t.rfltype2, 5, t.rfldist2,)
    DECODE (t.rfltype3, 5, t.rfldist3,)
    DECODE (t.rfltype4, 5, t.rfldist4,)
    DECODE (t.rfltype5, 5, t.rfldist5,)
    DECODE (t.rfltype6, 5, t.rfldist6,)
    DECODE (t.rfltype7, 5, t.rfldist7,)
    DECODE (t.rfltype8, 5, t.rfldist8,)
    NULL)))
    (- launch_start) * distk * vop, 2) dist
    OF dsltdr t
    WHERE pr_id = 464528984
    AND test_type = 2
    ORDER BY pw CSA;



    >

    SELECT pw,
    Round ((DECODE (t.rfltype1, 5, t.rfldist1,)))
    DECODE (t.rfltype2, 5, t.rfldist2,)
    DECODE (t.rfltype3, 5, t.rfldist3,)
    DECODE (t.rfltype4, 5, t.rfldist4,)
    DECODE (t.rfltype5, 5, t.rfldist5,)
    DECODE (t.rfltype6, 5, t.rfldist6,)
    DECODE (t.rfltype7, 5, t.rfldist7,)
    DECODE (t.rfltype8, 5, t.rfldist8,)
    NULL)))
    (- launch_start) * distk * vop, 2) dist
    OF dsltdr t
    WHERE pr_id = 464529918
    AND test_type = 2
    ORDER BY pw CSA;

    How to start with?

    Thanks in advance.

    I removed the dbms_output statement because it does not seem to turn it on. If you do this from sqlplus
    Make sure that you type "serverout on" and press return.

    declare
    vPW number := 0 ;
    vDistance number := 0 ;
    begin
    sp_dsl_test(3,'12345',vDistance,vPW) ;
    DBMS_OUTPUT.PUT_LINE('Distance = '|| vDistance || ' PW = '|| vPW);
    end;
    

    Published by: FlyingGuy on March 3, 2011 14:24

  • TSQL stored procedure - passing several variables

    Hello

    I have a drop-down list box in a form that allows you to select more than one. When I process the form, I currently use CF to dynamically generate the SQL WHERE clause creating as much as needed AND instructions.

    I migrate to MS SQL 2005 and the stored procedures on the db. I am trying to create a stored procedure that effectively uses tsql to CF was doing previously (creation in the WHERE clause).

    In the code below, I'm passing tank (22) variable called channel. The code below was my first attempt at trying to create the WHERE clause. Most of the code is focused on the extraction on the individual entities 'channel '. Any thoughts on how to get from this would be GREATLY appreciated!

    I need help on the SELECT side, ultimately I select 'regions', of 'Syndicated', WHERE is based on 'channels' past.

    Thank you

    cfwild

    Hello

    It was quite the adventure of trying to understand this. I learned a little about tsql. Here's the final procedure:

    CREATE PROCEDURE dbo.uspSelectSyndicatedRegion
    @TablePrefix as (7).
    Varchar (100) of @Category,.
    @Channel varchar (2000)

    AS
    BEGIN

    SELECT DISTINCT S.Region
    S Union
    JOIN iter_charlist_to_tbl (@Channel, by DEFAULT) M
    WE S.Channel = M.str
    UNION
    SELECT "
    ORDER BY S.Region

    END

  • Run the oracle stored procedure in CF8

    I'm running a procedure like this.

    < cfstoredproc procedure = "GetAction" datasource = "test_DSN" >
    < cfsqltype cfprocparam dbvarname "actionId" = "CF_SQL_INTEGER" = type = "en" value = "1" >
    < name cfprocresult = resultset 'actions' = '1' >
    < / cfstoredproc >

    and my stored procedure in oracle.

    create or replace function GetAction (actionId IN ACTION.ID%TYPE)

    OPERATION RETURN % ROWTYPE

    IS
    actions

    ACTION % ROWTYPE;

    Start

    Select *.

    IN actions

    Action WHERE ID = actionId.

    RETURN operations;

    GetAction end;

    then I get the error message like:
    ORA-01008: not all variables

    Please help me on this.

    Thanx

    If you want to return a result set (result of a query) of your PL/SQL, you will have to do what Daverms suggested and your function to convert a procedure and a cursor reference to return your result set. Your procedure should be contained in a package so that you can declare a ref cursor "globally" to make it accessible by CF.

    Oh, and don't forget to change your parameter for cfstoredproc procedure to add the name of the package for the proc name.

    Phil

  • SQL stored procedure input and output parameters

    Hello Gang,

    My dead end trying to call a stored procedure in SQL Server 2008 with the LV database tool.

    for purposes of experimentation, I've created a small procedure with an input parameter that returns an integer as return value.  It works describing a query, but all attempts at LV produce an error-2147217900 when executing query VI.  I did find examples of that.

    Sending a bunch of parameters to a stored procedure and checking the value of return seems to be pretty common stuff.

    I'll appreciate any help.

    Thank you

    Roger

    Hi Roger,

    There are a few prerequisites which I will list below. If you have not checked these things, so don't hesitate, as your hiccups can be there.

    Prerequisites:

    1. Ensure that you can read from a table in the database to verify that you can access the database (user permissions) and ensure that your login details are correct. Among other things, make sure that the. DSN switches to the correct database. (See the simple example below, SQL Select.vi)
    2. Make sure that your user (if you use SQL authentication) has permissions to run the STORED procedure by running the procedure in SQL Server Management Studio (you seem to have already done this)

    Example by calling a procedure without parameters (attached as SPROC_No_Parameters.vi):

    Example by calling a procedure with parameters (attached as SPROC_Parameters.vi):

    An article on the execution of stored procedures is here:

    http://digital.NI.com/public.nsf/allkb/07FD130746083E0686257300006326C4

    Don't forget to download the example VI since it includes the cases where you want an output parameter of the procedure rather than a table.

    I tested these against two very simple SPROCs and it worked fine (on SQL Server 2005, but 2008 should be the same).  Stored procedures have been:

    CREATE PROCEDURE [dbo]. [GetContacts]

    AS
    BEGIN
    -SET NOCOUNT ON added to avoid additional results sets from
    -interfering with SELECT statements.
    SET NOCOUNT ON;

    -Controls insert for procedure here
    SELECT * FROM Contacts
    END

    and

    CREATE PROCEDURE [dbo]. [MultiplyAges]
    @param1 INT = 1
    AS
    BEGIN
    -SET NOCOUNT ON added to avoid additional results sets from
    -interfering with SELECT statements.
    SET NOCOUNT ON;

    -Controls insert for procedure here
    SELECT (age * @param1) OF Contacts
    END

    I would like to know if these examples work for you or if you have any other questions.  Don't forget to go through this KB article and articles related to it, they should cover other situations.

    Matt

  • Call the stored procedure, and bind parameters by name

    Hello

    I use the Oracle ODBC 12 c driver to pass values from one Interface to our database Oracle 11.2. The Interface software collects data from modbus protocoll and calls a stored procedure. Right now my syntax to call the stored procedure looks like this:

    CALL procedure-name ('STRING', 'Timestamp as String', numValue1);

    It works very well. Now, I have to add a default setting to my procedure. To stay flexible to make other changes, I want to call the procedure and bind the parameters by name. Release 10.2.0.1.0 ISC ODBC Notes:

    Added support for the named parameter, binding the parameters by name. ODBC Oracle driver now allows the application to specify the parameters of a stored procedure by name, in the procedure call. Named parameters are to be used in calls to stored procedures and should not be used in other SQL statements.

    So, it shouldn't be a problem to use named notation, but how do I do this in ODBC? I tried like this, but oracle returns an ora-00936 error of missing expression:

    call procedure-name (paramName1 = > 'STRING',= paramName2 > 'Timestamp as String',paramName3 = > numValue1).


    Thank you for your help.

    Finally, I was able to find the error. The syntax of the statement was very good. The problem was caused by another declaration that I edited before and the error has not attracted Attention immediately.

    Thanks for reading and looking for an answer.

Maybe you are looking for