The procedure with parameter output from test object type

I have the sub object created with spec and body type.

I need to test the procedure seen ino parameter object type.

could you please help me test the procedure!

create or replace type typ_obj_test as object
(
   a_date   date,
   a_type   varchar2(10),
   a_status varchar2(2),
   descr    varchar2(10),
   a_id     number(10),
   constructor function typ_obj_test(a_date   date
                                    ,a_type   varchar2 default null
                                    ,a_status varchar2 default null
                                    ,descr    varchar2 default null
                                    ,a_id     number default null) return self as result
);
/
create or replace type body typ_obj_test is
   constructor function typ_obj_test(a_date   date
                                    ,a_type   varchar2 default null
                                    ,a_status varchar2 default null
                                    ,descr    varchar2 default null
                                    ,a_id     number default null) return self as result is
      v_test varchar2(1);
      v_id   number(10);
   begin
      self.a_date   := a_date;
      self.a_type   := a_type;
      self.a_status := a_status;
      self.descr    := descr;
      self.a_id     := a_id;
      return;
   end;
end;
/
create or replace procedure p_obj_test(p_obj_param in out typ_obj_test) is
begin
   dbms_output.put_line('Checking the object type' || p_obj_param.a_date || '@' || p_obj_param.a_type || '@' || p_obj_param.a_status || '@' ||
                        p_obj_param.descr || '@' || p_obj_param.a_id);
end;
/

You seem to be missing a table that could hold the object. See the next topic, especially the line # 43:

Connected to:
Oracle Database 11g Release 11.2.0.3.0 - 64bit Production

SQL> create or replace type typ_obj_test as object
  2  (
  3    a_date  date,
  4    a_type  varchar2(10),
  5    a_status varchar2(2),
  6    descr    varchar2(10),
  7    a_id    number(10),
  8    constructor function typ_obj_test(a_date  date
  9                                      ,a_type  varchar2 default null
10                                      ,a_status varchar2 default null
11                                      ,descr    varchar2 default null
12                                      ,a_id    number default null) return self as result
13  );
14  /

Type created.

SQL> create or replace type body typ_obj_test is
  2    constructor function typ_obj_test(a_date  date
  3                                      ,a_type  varchar2 default null
  4                                      ,a_status varchar2 default null
  5                                      ,descr    varchar2 default null
  6                                      ,a_id    number default null) return self as result is
  7        v_test varchar2(1);
  8        v_id  number(10);
  9    begin
10        self.a_date  := a_date;
11        self.a_type  := a_type;
12        self.a_status := a_status;
13        self.descr    := descr;
14        self.a_id    := a_id;
15        return;
16    end;
17  end;
18  /

Type body created.

-- Create a Nested table type array of above object type
SQL> create or replace type nt_typ_obj_test as table of typ_obj_test;
  2  /

Type created.

-- Keep in out parameter's type as the nested table type
-- modified the proc to do loop so that multiple records can be passed via object type
SQL> create or replace procedure p_obj_test(p_obj_param in out nt_typ_obj_test) is
  2  begin
  3  for i in p_obj_param.first..p_obj_param.last
  4  loop
  5    dbms_output.put_line('Checking the object type' || p_obj_param(i).a_date || '@' || p_obj_param(i).a_type || '@' || p_obj_param(i).a_status || '@' ||
  6                          p_obj_param(i).descr || '@' || p_obj_param(i).a_id);
  7  end loop;
  8  end;
  9  /

Procedure created.

--Call the procedure
SQL> set serveroutput on
SQL> declare
  2  i_nt_typ nt_typ_obj_test ;
  3  begin
  4  i_nt_typ:=nt_typ_obj_test(typ_obj_test(sysdate,'A','Y','Descr',23),typ_obj_test(sysdate,'X','Z','ewe',55));
  5  p_obj_test(i_nt_typ);
  6  end;
  7  /
Checking the object type26-MAR-15@A@Y@Descr@23
Checking the object type26-MAR-15@X@Z@ewe@55

PL/SQL procedure successfully completed.

SQL>

Tags: Database

Similar Questions

  • Using the procedure with multiple output variables in a query

    Hello

    We have a process that takes time, which returns 4 variables as out parameters:
    procedure calc_values(id in number, val1 out number, val2 out number, val3 out number, val4 out number) is
    The id uniquely identifies a product in our database.

    I would use it in a query (or view), in the form
    select s.id, val1, val2, val3, val4 from something s, product_table p
    where s.id = p.id
    I tried the following approach, but I'm kinda stuck

    define the type
    define an array of this type
    write a wrapper function that calls this procedure and returns the results as a table
    * the PivotTable in columns
    * join this with the product table

    It's like I'm on the wrong track, I'm struggling to retrieve the id of the product table in the wrapper function.

    Is there a better approach for this? I'm on oracle 10g

    Thank you!

    Rob

    Below is my interpretation of what you were asked to do. I don't really know what you want to do or what you need to do.

    CREATE TYPE prod_vals_def
    AS OBJECT
     (VAL1      NUMBER,
      VAL2      NUMBER,
      VAL3      NUMBER,
      VAL4      NUMBER
    );
    
    create or replace
    TYPE   prod_vals_tab
    AS TABLE OF prod_vals_def;
    
    CREATE FUNCTION pvals (p_prod_id  NUMBER)
    RETURN prod_vals_tab PIPELINED
    AS
    
      TYPE         ref0 IS REF CURSOR;
      cur0         ref0;
      out_rec      prod_vals_def
                := prod_vals_def(NULL,NULL,NULL,NULL);
    
    BEGIN
      -- CASE replacing SELECT against table I'm not going to create
      CASE p_prod_id
        WHEN 1 THEN
          out_rec.val1 := 1;
          out_rec.val2 := 2;
          out_rec.val3 := 3;
          out_rec.val4 := 4;
        WHEN 2 THEN
          out_rec.val1 := 2;
          out_rec.val2 := 3;
          out_rec.val3 := 4;
          out_rec.val4 := 5;
        WHEN 3 THEN
          out_rec.val1 := 3;
          out_rec.val2 := 4;
          out_rec.val3 := 5;
          out_rec.val4 := 6;
        WHEN 4 THEN
          out_rec.val1 := 4;
          out_rec.val2 := 5;
          out_rec.val3 := 6;
          out_rec.val4 := 7;
        ELSE
          out_rec.val1 := 0;
          out_rec.val2 := 0;
          out_rec.val3 := 0;
          out_rec.val4 := 0;
      END CASE;
      PIPE ROW(out_rec);
    END pvals;
    
    WITH s_tab AS
      (SELECT 1 AS prod_id FROM dual
       UNION ALL
       SELECT 2 AS prod_id FROM dual
       UNION ALL
       SELECT 3 AS prod_id FROM dual
       UNION ALL
       SELECT 4 AS prod_id FROM dual
      )
    SELECT s.prod_id, p.val1, p.val2, p.val3, p.val4
    FROM   s_tab s,
           TABLE(pvals(s.prod_id)) p
    
    PROD_ID  VAL1     VAL2     VAL3     VAL4
    -------- -------- -------- -------- --------
    1        1        2        3        4
    2        2        3        4        5
    3        3        4        5        6
    4        4        5        6        7     
    
  • In tabular form button to start the procedure with parameter

    I have a column in my table presentation that calls a procedure.
    I got this works with dynamic action related to a jquery selector.

    Now this procedure (called dynamic action) takes a parameter. I need to pass the value of the column, the ID of the line. (it is the value in the column that appears as a button)

    How to use this value in my procedure?
    I tried to pass this value in the column link attributes to a page element, but this action is performed after the dynamic action is called.

    Thanks for som advice!

    jstephenson wrote:
    You should be able to try something like this: javascript:callMyPopup(#ROWNUM#). I do it on a column derived in tabular form. Inside of my callMyPopup I have also to retrieve a value from one of the other fields on the line. You should be able to check your html code to get the correct f0X id. Here's a piece of the callMyPopup function
    If (bow<>
    {
    psearch = document.getElementById('f05_000'+pRow).value;
    }
    ElseIf (bow<>
    {
    psearch = document.getElementById('f05_00'+pRow).value;

    I hope this helps.

    Thank you

    Jeff

    In fact, instead of these cases the conditions you can use an existing table:

    document.wwv_flow. F05 [Prow], which gives you the item. You can then access any property of this element you want. ID, value, name etc.

    Trent

  • execution of the procedure with refcursor as output parameter

    Hi I have the package following a procedure with parameter as refcursor OUT.
    Here is an example of sample with the same structure with name in the other table, handling exceptions in my dev environment
    CREATE OR REPLACE PACKAGE TEST_PACK
      IS
    Type refCursor  is  REF CURSOR;
    PROCEDURE TEST_PROC (out_data out refCursor);
    END;
    
    
    CREATE OR REPLACE PACKAGE BODY TEST_PACK 
     IS
     Procedure test_proc (
            out_data out refCursor
                ) is
        --
        v_sql varchar2(4000);
       
        --
        begin
    
               v_sql := 'select
                        * from emp';
                       
            DBMS_OUTPUT.PUT_LINE ( 'Select Query is: '||v_sql );
    
            open out_data for v_sql;
    
            Exception
                when others then
                    DBMS_OUTPUT.PUT_LINE ( 'Error '|| SQLCODE ||','||SQLERRM );
    
       END;   
    end ;
    When I try to execute this procedure with the followig block
    DECLARE
       TYPE my_newcursor IS REF CURSOR;
       test_cur   my_newcursor;
      out_text      VARCHAR2 (4000);
    BEGIN
       TEST_PACK.test_proc(TEST_CUR) ;
       LOOP
          FETCH test_cur INTO out_text;    
          EXIT WHEN test_cur%NOTFOUND;
          dbms_output.put_line('Value of refcur is:'||out_text);
       END LOOP;
         CLOSE test_cur;  
    END;
    I get the following error
    ORA-00932: inconsistent datatypes: expected - got -
    ORA-06512: at line 8
    Could you please help me where I am doing wrong

    Thank you

    You must extract your data to an appropriate data type.

    (and note there is no need to declare your own ref cursor type as Oracle provides sys_refcursor at the end)

    for example

    SQL> set serverout on
    SQL>
    SQL> create or replace procedure test_proc(out_data out sys_refcursor) is
      2    v_sql varchar2(4000);
      3  begin
      4    v_sql := 'select * from emp';
      5    DBMS_OUTPUT.PUT_LINE ( 'Select Query is: '||v_sql );
      6    open out_data for v_sql;
      7  end;
      8  /
    
    Procedure created.
    
    SQL>
    SQL> declare
      2    rc     sys_refcursor;
      3    empRec emp%rowtype;
      4  begin
      5    test_proc(rc);
      6    loop
      7      fetch rc into empRec;
      8      exit when rc%notfound;
      9      dbms_output.put_line('Employee: '||empRec.empno||' - '||empRec.ename);
     10    end loop;
     11    close rc;
     12  end;
     13  /
    Select Query is: select * from emp
    Employee: 7369 - SMITH
    Employee: 7499 - ALLEN
    Employee: 7521 - WARD
    Employee: 7566 - JONES
    Employee: 7654 - MARTIN
    Employee: 7698 - BLAKE
    Employee: 7782 - CLARK
    Employee: 7788 - SCOTT
    Employee: 7839 - KING
    Employee: 7844 - TURNER
    Employee: 7876 - ADAMS
    Employee: 7900 - JAMES
    Employee: 7902 - FORD
    Employee: 7934 - MILLER
    
    PL/SQL procedure successfully completed.
    
    SQL>
    

    Why do you use a slider ref anyway?

    {: identifier of the thread = 886365}

  • How the parameter of the procedure with the default table type?

    Hello!

    How the parameter of the procedure with the default table type?
    For example:
    type varchar2lType is table of varchar2(50) index by binary_integer;
    create or replace procedure test1
       (
        s1  varchar2(50)
        sa2 Varchar2Type
       )
    as
    begin
       dbms_output.put_line('yyxxyyy!');
    end;
    /
    Published by: bullbil on 16.01.2012 06:35

    If he should really be an associative array for some reason any (can't think why, but just for fun...) you could declare a dummy array in the packet header and specify as the default:

    create or replace package wr_test
    as
       type varchar2ltype is table of varchar2(50) index by pls_integer;
       g_dflt_varchar2l_tab varchar2ltype;
    
       procedure testit
          ( p_testarray varchar2ltype default g_dflt_varchar2l_tab );
    end wr_test;
    
    create or replace package body wr_test
    as
       procedure testit
          ( p_testarray varchar2ltype default g_dflt_varchar2l_tab )
       is
       begin
          dbms_output.put_line('p_testarray contains ' || p_testarray.count || ' elements');
       end testit;
    
    end wr_test;
    

    It is a bit of a hack, because it relies on a global variable that is exposed. A more orderly approach would overload the procedure so that a version does not have the table and another argument:

    create or replace package wr_test
    as
       type varchar2ltype is table of varchar2(50) index by pls_integer;
    
       procedure testit;
    
       procedure testit
          ( p_testarray varchar2ltype );
    
    end wr_test;
    
    create or replace package body wr_test
    as
    
       procedure testit
       is
          v_default_array varchar2ltype;
       begin
          testit(v_default_array);
       end testit;
    
       procedure testit
          ( p_testarray varchar2ltype )
       is
       begin
          dbms_output.put_line('p_testarray contains ' || p_testarray.count || ' elements');
       end testit;
    
    end wr_test;
    
  • A stored procedure with input &amp; output parameter as XML

    Hello

    I have a requirement in which I need to have a stored procedure accepts with huge XML from Java and MS a process all the records in the XML file and return the output with a few messages inside XML.

    CurrentY, I have a stored procedure to process the xml code stored in the Oracle database.

    I am using the following SQL statement to read data from the XML column.
    select xmltest1.id,xmltest1.name 
      from xmltest,
           XMLTABLE(
              XMLNamespaces(default 'syncpsna/schemas'),
              '/XMLTestRequest/insert/row'
                    PASSING xmltest.data_xml
                    COLUMNS
                    "ID" number(10) PATH 'id',
                    "NAME" varchar2(50) PATH 'name') xmltest1
    where xmltest.id = 2;
    I want to run similar queries to retrieve data from the XML passed as parameter of entry of JAVA.

    If I could get some examples to read the XML and return the xml to the calling program.

    Concerning

    I can run the query to extract the different sections in the xml file when the XML is stored in a table column. How can do the same thing on XML passed as an input parameter.

    Pretty much the same path, using the clause of PASSAGE.
    Assuming that the input XML is passed as parameter 'p_inputXML', you can do:

    SELECT x.id
         , x.name
    FROM XMLTable(
           XMLNamespaces(default 'syncpsna/schemas'),
           '/XMLTestRequest/insert/row'
           PASSING p_inputXML
           COLUMNS
             "ID"   number(10)   PATH 'id',
             "NAME" varchar2(50) PATH 'name'
         ) x
    ;
    
  • Comparing a constant string with the procedure VARCHAR2 parameter

    Hello.
    I had a strange behavior of PL/SQL (propably I don't know something I should). I have a procedure:
    PROCEDURE przetworzLinie(P_LINIA VARCHAR2) IS
    BEGIN
      if not (nvl(pv_swde_section,'...') = 'SO') then
        CASE (p_linia)
          WHEN 'SN;' THEN      pv_swde_section := 'SN';
          WHEN 'SP;' THEN      pv_swde_section := 'SP';
          WHEN 'ST;' THEN      pv_swde_section := 'ST';
          WHEN 'SO;' THEN      pv_swde_section := 'SO';
          ELSE  NULL;
        END CASE;
      end if;
    -- (...)
    END;
    The procedure is called breast:
    procedure importuj(p_plik varchar2) is
      linia VARCHAR2(1000);
    begin
      pv_plik := p_plik;
      pv_plikID := otworzPlik(pv_plik);
      loop
        linia := czytajlinie(swde_file);     -- calls UTL_FILE.read_line and return a line from file
        exit when instr(linia, 'SWDEX') = 1; -- end of SWDE file
        przetworzLinie(linia);
      end loop;
    end importuj;
    The strange thing is that this procedure przetworzLinie never change the pv_secton_swde package variable, because the expresion:
    WHEN 'SN;'
    is always FALSE, even when p_linia contains "SN;" string.

    I solved this problem by replacing
    CASE (p_linia)
    with
    CASE (substr(p_linia,1,3))
    Please explain to me, why CASE (p_linia) is malfunctioning.
    Thanks in advance :)

    Published by: sandrine Sep 2, 2010 08:59

    P.s., database is 10.2.0.3.0 (64-bit)

    Check the length of the parameter p_linia and maybe a few extra spaces are added.

  • Procedure with input output and num_array sys_refcursor

    Hello

    I have to write a procedure with input of type of parameter num_array which will forward a list of IDs to the procedure and the output is sys_refcursor that will pass the id with the other columns in the table to the list of identifiers.

    operating system is the table with the id, os_name column with more than a few columns.

    create table os

    (identification number,

    OS_name varchar2 (30),

    .. .few more columns);

    I spend the os_name with id through the sys_refcursor.

    So I created the following procedure.

    num_array is a type of data defined by the user that is created as follows:

    create or replace type num_array in the table to the number;

    /

    create or replace procedure get_os_lang_dtls (num_array, id_os sys_refcursor id_num)

    is

    Start

    / * oses is the main table with id, os_name with other columns

    / * oses_gtt is the temporary table with id number data type varchar2 os_name * /.

    for indx in 1.id_num.count

    loop

    insert into os_gtt

    SELECT id, os_name

    of the operating system

    where id = id_num (indx);

    end loop;

    commit;

    Open the id_os for

    Select * from os_gtt;

    end;

    /


    I created a global temporary table with the column id and os_name.

    Insert in this table by using the id of i / p and setting os_name recovery operating system for this id in the loop.


    Then I open the exit sys_refcursor.


    Could someone please suggest me a better way to write the same logic?


    Thanks in advance

    No need of the TWG or anything too flashy here.

    Since you have a SQL type, you should be able to get away with...

    open out_ref_cursor for
    select 
    from os, table(cast(id_num as num_array)) nu
    where os.id = nu.column_value;
    

    A couple of notes apart from that. ID is not a great name for a column, why not OS_ID to be online with your OS_NAME? Second, always try to avoid use of the TWG, they are handy once in awhile, but not required nearly as often as find you them.

    A "rebate" in the casting of tables like that and their use in SQL is the cost based optimizer usually (depending on version) has no idea of how to do to optimize the query (it has no statistics on the table as it does on a table). In General, if you know that you have X items in this table, it is better to say Oracle. You can use the CARDINALITY indicator to tell Oracle about the number of lines, you expect your table to have on average. The default proposal is going to be your block size, so assuming that 8 k (standard) the estimate is going to be like 8000 items... probably not close to reality.

    See you soon,.

  • Synchronize the tiara with video output. Tiara and c#

    Hello

    I'm a c# programmer and I have a problem I can not find a solution.

    My company built some kind of sync-multi-video-reader.-in other words, he can play a number of videos in a window of synchronously.

    Question No. 1: with the videos, there are data files, that are already in the .tdms format. We need these files to read in DIAdem synchronously with our video player. How can I do?

    question No. 2: I can do it with c#?

    OmerK,

    I think that the best way to do what you ask, it's a script of DIAdem to ensure as reading for the data file and the beginning of an external video player at the same time. There is an object property in DIAdem which returns the starting position for the playback cursor: http://zone.ni.com/reference/en-XX/help/370858K-01/scriptview/properties/view_property_startpos_itoc...

    You can use the IPM Toolbox to create a DLL that interfaces directly with your external video player or calls in a "man in the Middle" C program to manage the communication between the two programs. Here is a link to a help file on the GPI toolkit: http://zone.ni.com/reference/en-XX/help/370858K-01/genshell/genshell/gpi/

    Once the timestamp between the two programs is synchronized, you must start the reading of data files and the video at the same time. From the perspective of tiara, you can use the command of reading of the cursor object: http://zone.ni.com/reference/en-XX/help/370858K-01/scriptview/methods/view_method_play_itocursormast... From the hearing of two at the same time and the same timestamp should cause their playback in sync, assuming that the video data file and read the same speed (read speed of data file can be configured in DIAdem as well).

    Of course, this will not allow you to capture the cursor and slashing through the data file and maintain synchronization. You can use an event in the script of DIAdem to catch the movement of the cursor and update your timestamp on this basis: http://zone.ni.com/reference/en-XX/help/370858K-01/scriptview/properties/view_property_oncursorchang...   However, it will be difficult to synchronize continuously between the programs because of performance problems (communication should occur quickly enough to avoid the jitter between the video file and data).

    The answer here is that it's a command to keep the DIAdem reading synchronized with another application, and while it might be possible to start at the same time, it will be difficult to keep the two synchronized records.

  • make sure that the procedure, called pl/sql from apex DURATION

    Hi gang,.

    I was wondering what the thoughts of the people where assuring him a packaged procedure is called in a session of runtime Apex, as opposed to sql * more or elsewhere.

    For example, how apex_mail.send to validate and output the following if executed from sql * more:
    ORA-20001: this procedure must be called from a session of the application.

    A simple call to check v ('APP_USER') wouldn't is not null enough?

    See you soon,.

    ScottWE

    Hello

    I think you could use the APEX_CUSTOM_AUTH.IS_SESSION_VALID function
    http://download.Oracle.com/docs/CD/E14373_01/apirefs.32/e13369/apex_auth.htm#BABHDFII

    Example of

    CREATE OR REPLACE PROCEDURE my_procedure(p_poaram1 VARCHAR2)
    AS
    BEGIN
    IF APEX_CUSTOM_AUTH.IS_SESSION_VALID THEN
     -- do stuff here when session is valid
    
    ELSE
     raise_application_error(20001,'Session is not valid');
    END;
    

    BR, Jari

  • Event of the timer with parameter

    Hi guys,.

    I've implemented a BPM inputs 3 times with 3 timers. I need set the TimeDate of the Timer event with three entries. How can I do? I tried with create a DataObject object with three attributes when, before the activities of the timer, I attribute the entries for the data objects and on the Date of the time, I inserted the phrase with the attributes of data object, but it does not work!

    I also tried to insert three string as inputs (instead time) and then I insterted a transformation before the activities of the timer, but it does not work too...

    Please help me!

    Thank you

    I solved insertion-'2 h' in the expression of timer... So now, the question is: why the DateTime input increased by 2 hours? I'll open a topic...

    Thank you

  • How to perform the procedure with parameters of type collection

    Hello

    I have the setting as the procedure
     PROCEDURE addGroup (
        Id IN NUMBER,
        sId IN NUMBER,
        gIds IN NUMBERLIST)
    CREATE OR REPLACE TYPE NUMBERLIST AS TABLE NUMBER;
    /





    could you help me by asking this type as a parameter the procedure...

    Thank you

    This is the type:

    SQL> create or replace type NUMBERLIST is table of number;
      2  /
    
    Type created.
    

    This is the procedure:

    SQL> create or replace PROCEDURE addGroup (
      2      Id IN NUMBER,
      3      sId IN NUMBER,
      4      gIds IN NUMBERLIST)
      5  is
      6  begin
      7    null;
      8  end;
      9  /
    
    Procedure created.
    

    And you call it this way:

    SQL> declare
      2  n numberlist := numberlist(1,2,3,4);
      3  begin
      4    addGroup(1,2,n);
      5  end;
      6  /
    
    PL/SQL procedure successfully completed.
    

    Max
    [My Italian blog Oracle | http://oracleitalia.wordpress.com/2010/01/23/la-forza-del-foglio-di-calcolo-in-una-query-la-clausola-model/]

  • calling a procedure with nested table as input param type

    Hello

    I have a guy like that table.

    create or replace type table_type like table of the varchar2 (4000);

    I have a procedure like this.

    proc_temp (v_table_type, table_type)

    Start

    key code...

    end;


    I have a table like this.

    tab_test_data

    --------------------

    ABCD

    efghd

    MNOP

    XYXX

    I want to move this data in table tab_test_data as param of entry while calling this proc could you please tell me how the procedure that calls the statement will be the writtern.

    I try like this.

    ----------------------------

    declare

    TABLE_TYPE v_table;

    Start

    proce_temp (v_table); - here, I want to pass data to the table as entry

    end;

    /

    You already have the data in a table (tab_test_data), then why don't you just use the table inside the proce_temp? Why should I set a collection type and pass it as a parameter? Collections use the expensive PGA memory. If the application that you build this way may have some serious scalability issues.

    Sort of a technical solution would be like this. You can use BULK COLLECT.

    declare
    TABLE_TYPE v_table;
    Start
    Select to bulk column_name fired in v_table
    of tab_test_data;

    proce_temp (v_table);
    end;
    /

  • RAW - the procedure input parameter data type

    Hello

    I created a procedure (Pasted below). Getting error on execution, please help me to overcome the error.

    BEGIN

    Log ('6B6C6D', 6 August 12 COM ','.) TESt', 'OH', 'TUE', 'NOTRANSACT', '< ACORD > < SignonRq >', '000000E0LN1D000029FNSRRGTest', '000009N1D000029FNJ9OITest');

    END;

    ERROR

    Error report:
    ORA-06550: line 3, column 1:
    PLS-00306: wrong number or types of arguments in the call to the 'LOG '.
    ORA-06550: line 3, column 1:
    PL/SQL: Statement ignored
    06550 00000 - "line %s, column % s:\n%s".
    * Cause: Usually a PL/SQL compilation error.
    * Action:


    /************************ Procedure *************************/

    create or replace PROCEDURE log
    / * Object: StoredProcedure [dbo]. [LogTransactionBegin] Script Date: 06/07/2012 05:37:06 * /.
    (
    v_GUID IN RAW by DEFAULT NULL,
    v_STRT_TM in TIMESTAMP DEFAULT NULL,
    v_PRTN_NM IN VARCHAR2 DEFAULT NULL,
    v_ST_CD in CHAR NULL by DEFAULT,
    v_LN_OF_BUS IN VARCHAR2 DEFAULT NULL,
    v_TRN_TYP IN VARCHAR2 DEFAULT NULL,
    v_REQ_XML IN XMLTYPE DEFAULT NULL,
    v_INNR_RQUID IN VARCHAR2 DEFAULT NULL,
    v_OUTR_RQUID IN VARCHAR2 DEFAULT NULL
    )
    AS
    BEGIN
    INSERT INTO trn_log
    (GIRO_TRN_LOG_ID, STRT_TM, PRTN_NM, ST_CD, LN_OF_BUS, TRN_TYP, REQ_XML, INNR_RQUID, OUTR_RQUID)
    VALUES (v_GUID, v_STRT_TM, v_PRTN_NM, v_ST_CD, v_LN_OF_BUS, v_TRN_TYP, v_REQ_XML, v_INNR_RQUID, v_OUTR_RQUID);

    END;

    Please see the following commented lines:

    BEGIN
    
      Log(
        '6B6C6D'                       -- this is not a RAW
      , '06-Aug-12'                    -- this is not a TIMESTAMP
      , 'COM.TESt'
      , 'OH'
      , 'AUT'
      , 'NOTRANSACT'
      , ''            -- this is not an XMLType (not even valid XML)
      , '000000E0LN1D000029FNSRRGTest'
      , '000009N1D000029FNJ9OITest'
      );
    
    END;
    

    Use the correct data types and their manufacturers (if necessary).
    For example, you can build a RAW from a string with the HEXTORAW() function. An XMLType can be built by the XMLType() constructor or the XMLParse() function, etc.

  • a stored procedure with parameter

    Hi all

    Here is the code example
    declare 
             in_dt date  := '1-feb-2010' ;
     col1 ...;
     col2 ...;
     col3 ...;        
    begin 
     
      select e.* 
      into col1,
            col2,
            col3
      from table_xyz e 
      where e.start_dt  = in_dt;
       
    end;
    
     
    How to convert the code above in stored procedure in accepting "in_dt" as a parameter and pass the result the displayed value (output) setting OUT tell 'cur_out' (parameter)


    Thank you very much!!! I really appriciate it!
    variable cv refcursor;
    
    DECLARE
      P_DT DATE;
    
    BEGIN
      P_DT := '10-oct-2005';
      scott.foo ( P_DT, :CV );
     END;
    /
    print cv
    

    REF CURSOR is when a program using Mickeysoft ODBC or Mickeysoft .NET needs a result set.

    You don't need them in pure PL/SQL
    Of course, you do not read further documentation and you ask me to ignore documentation.
    I hate that!
    I want to teach people how do fish not spoon feed them.

    -----------
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for