Passing object as a parameter

Hi all

I have a procedure that takes an OBJECT as a parameter. I use SQL Developer and also have SQL * more.


The type is


create or replace
TY_RAILROAD_OPERATOR THAT the OBJECT TYPE
(
RRX_RAILROAD_OPERATOR_CD VARCHAR2 (6 BYTE),
RRX_RAILROAD_OPERATOR_NM VARCHAR2 (60 BYTE),
RRX_RAILROAD_OPERATOR_DSC VARCHAR2 (2000 BYTE),
STATUS CHAR (1 BYTE),
DATE OF LAST_UPDATE_DT,
LAST_UPDATE_USER VARCHAR2 (60))



procedure set_Railroad_Operator (p_TY_Railroad_Operator IN TY_Railroad_Operator, p_Railroad_Operator_Id OUT NUMBER) IS

v_Railroad_Operator_Id NUMBER;

BEGIN
..
.
.
I run the procedure. How should I pass parameters?

I would like to test the procedure, and I have no idea how to do to test it.

Any help is appreciated.


Thanks in advance
N

sample:

SQL> CREATE OR REPLACE TYPE ty_railroad_operator AS OBJECT(
  2     rrx_railroad_operator_cd    VARCHAR2(6 BYTE),
  3     rrx_railroad_operator_nm    VARCHAR2(60 BYTE),
  4     rrx_railroad_operator_dsc   VARCHAR2(2000 BYTE),
  5     status                      CHAR(1 BYTE),
  6     last_update_dt              DATE,
  7     last_update_user            VARCHAR2(60)
  8  );
  9  /

Type created.

SQL> CREATE OR REPLACE PROCEDURE set_railroad_operator(
  2     p_ty_railroad_operator   IN       ty_railroad_operator,
  3     p_railroad_operator_id   OUT      NUMBER
  4  )
  5  IS
  6     v_railroad_operator_id   NUMBER := 10;
  7  BEGIN
  8     DBMS_OUTPUT.put_line(p_ty_railroad_operator.rrx_railroad_operator_cd);
  9     DBMS_OUTPUT.put_line(p_ty_railroad_operator.rrx_railroad_operator_nm);
 10     DBMS_OUTPUT.put_line(p_ty_railroad_operator.rrx_railroad_operator_dsc);
 11     DBMS_OUTPUT.put_line(p_ty_railroad_operator.status);
 12     DBMS_OUTPUT.put_line(p_ty_railroad_operator.last_update_dt);
 13     DBMS_OUTPUT.put_line(p_ty_railroad_operator.last_update_user);
 14  END;
 15  /

Procedure created.

SQL>
SQL> DECLARE
  2     v_ty_railroad_operator   ty_railroad_operator
  3        := ty_railroad_operator('OP_CD', 'OP CODE NAME', 'OP CODE DESC', 'S',
  4                                SYSDATE, 'OP CODE USER');
  5     a                        NUMBER(10);
  6  BEGIN
  7     set_railroad_operator(p_ty_railroad_operator => v_ty_railroad_operator,
  8                           p_railroad_operator_id => a);
  9  END;
 10  /
OP_CD
OP CODE NAME
OP CODE DESC
S
15-JUN-10
OP CODE USER

PL/SQL procedure successfully completed.

SQL> 

Tags: Database

Similar Questions

  • How to run a procedure with the object as OUTPUT parameter

    Hello

    I have a procedure and it composed of 2 parameters, there is an input parameter and it's some ID (NUMBER datatype) and 2nd parameter is an output parameter and it an object type. I want to run this procedure, but not able to do the same thing. Can someone please suggest me how to run a procedure that got the object as output parameter.

    Thank you very much in advance for your support.

    Example:

    SQL> create or replace type t_obj as object (ename varchar2(10), deptno number);
      2  /
    
    Type created.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace procedure myproc (p_empno in number, obj out t_obj) is
      2  begin
      3    select t_obj(ename, deptno)
      4    into obj
      5    from emp
      6    where empno = p_empno;
      7* end;
    SQL> /
    
    Procedure created.
    
    SQL> set serverout on
    SQL> declare
      2    v_obj t_obj;
      3  begin
      4    myproc(7788, v_obj);
      5    dbms_output.put_line(v_obj.ename||','||v_obj.deptno);
      6  end;
      7  /
    SCOTT,20
    
    PL/SQL procedure successfully completed.
    
  • Pass the object as a parameter to a method by dragging to the user interface

    Hello

    I use datacontrol webservice to call "Webservice secure." A datacontrol method and he fell in the UI, it passes an object (for example, the SOAHeader object) as an input parameter and returns "String" as an output. So, here I created a passing and java class as an object to the method. When I deployed the application in the Android emulator, clicking on this method as a button, his throws me an error message * "" HTTPStatusCode 500: the server encountered an unexpected condition which prevented him from meeting demand "*." I tried to configure the debugger to get log for remote deployment, after that the application itself is not opening in the emulator. So how can I find the exact reason of this error message?

    Here, I had some doubts,
    (1) is the right way to pass the object as an input method parameter?
    (2) how can I call web service secured via 'Webservice datacontrol' in ADF Mobile. I searched in google and received a link by Sonia "http://andrejusb.blogspot.be/2012/11/adf-mobile-secured-web-service-access.html", but not understanding on "* adfCredentialStoreKey *", what is it? and how do I use it? I have defined strategies for security, as mentioned, is - it enough to call Web services secure without giving name of user and password? Bit confused, can someone please tell me more about access to the secure of webservice webservices datacontrol.
    (3) I tried to configure the option of debugging (as mentioned in the developer's guide) to get the log of remote deployment. I changed * "java.debug.enabled = true" * in cvm.properties. Once this configuration, can't open this mobile application through the emulator. What could be the reason?


    Concerning
    REDA

    Take a look at this:
    https://blogs.Oracle.com/Shay/entry/calling_web_service_with_complex

  • How to pass the object as a parameter in AS3?

    I get the impression that the non-static objects passing is not allowed in AS3. I never had a problem with that in AS2. Am I correct in this understanding?

    If Yes, do you know what is considered a best practice regarding pass non-static objects as parameters? Is not a good practice? Thank you!

    Ooops nevermind, I got the argument name of past typed exactly as the name of the class, that was the problem.

    function(passed:passed) = boo boo

  • How to pass 'SIGNAL' object as a parameter of QML

    Hi all

    I'm in a fundamental need for the object that caused the SIGNAL to occur,

    E.g. by a signal "onClicked" (in QML) of the button if I call a method of CRACK or Q_INVOKABLE, then what I have

    the purpose of the call?

    As,

    Button {}

    text: 'Add container ".

    onClicked: {}

    injection.playSound ();

    }

    }

    The code is taken from the tutorial. As you can see the "injection" is through "setContextProperty" and having

    "playSound" method I want to do something like this

    injection.playSound (' Button object which invoked this incrimination (onClicked) ');

    and the method in the class curresponding will look like.

    Q_INVOKABLE Sub playSound (bb::cascades:Button * buttonObject);

    One? Please help me in this regard.

    RIM, please take a look at these simple things and update documents.

    Kind regards

    Diagne

    In c ++ make your method in the header

    Q_INVOKABLE void playSound(QObject* buttonObject);
    

    In your cpp file

    MyClass::void playSound(QObject* buttonObject) {
    
    // Cast QObject to Button
    Button* myButton = qobject_cast

    In your QML file:

    injection.playSound(idOfYourButton);
    
  • How to pass a number any parameter in a call sequence

    Hello

    I have a sequence that is intended to do the same job for one or more of the same items typed. for example:

    ______________

    subsequenceA:

    (all table elements) ForEach element

    do the work

    ENDFOR

    ______________

    now in my caller, I want to call subsequenceA in several ways:

    subsequenceA (firstElement)

    subsequenceA (PremierElement, DeuxiemeElement)

    subsequenceA (PremierElement, DeuxiemeElement,..., lastElement)

    Is this possible?

    Another question: is it possible to appeal a subsequence in an expression of pre?

    No, calling the subsequences can be done using the step of SequenceCall. At least, it is not easy to make another way (because it requires a lot of knowledge of the TS API).

    Why you not pass the array "such what '... (array parameter)?

    Norbert

  • Failed to create the stored procedure with the object as a parameter

    Hello

    No idea how to create procedures to the current data stored in SQLFire, try to run the command prompt "sqlf" per call "create_proc.sql" as give below error below

    C:\SQLFire10Beta>sqlf
    sqlf version 10.4
    sqlf> connect client 'localhost:1527';
    sqlf> run 'create_proc.sql';
    sqlf> CREATE PROCEDURE INSURANCE.SEARCHCUSTOMER (IN CUST OBJECT) DYNAMIC RESULT SETS 1 LANGUAGE JAVA PARAMETER STYLE JAVA READS SQ
    L DATA EXTERNAL NAME com.xxx.xxx.sqlfire.dao.CustomerSearchProcedure.searchCustomer;
    ERROR 42X01: Syntax error: Encountered "" at line 1, column 47.
    Caused by: SqlException: Syntax error: Encountered "" at line 1, column 47.
            at com.vmware.sqlfire.internal.client.am.Statement.completeSqlca(Statement.java:1838)
    sqlf> sqlf> 


    and I created a class Java as described below:

    public class CustomerSearchProcedure {
     
     public static void searchCustomer (BaseDTO[] customers, ResultSet[] outResults,
       ProcedureExecutionContext context) throws SQLException {
      BaseDTO searchCriteria = customers[0];
      StringBuilder sql = new StringBuilder();
      sql.append("SELECT * FROM INSURANCE.CUSTOMERS WHERE CUST_NAME LIKE '"+searchCriteria.getCustName().trim() + "%'");
      
      Connection cxn = context.getConnection();
      Statement stmt = cxn.createStatement();
      ResultSet rs = stmt.executeQuery(sql.toString());
      outResults[0] = rs;
     } //END OF METHOD
    }


    This procedure is called class using the class StoredProcedure Spring DAO

    You can let me know why am not able to create the procedure?

    FYI, pots can also can be dynamically installed in the system by using the SYS. Table client-side JARS to transport the jar bytes rather than by requiring that the pot be accessible side Server (http://pubs.vmware.com/vfabric5/index.jsp?topic=/com.vmware.vfabric.sqlfire.1.0/deploy_guide/Topics/sysjars_install.html)

  • pass an array as parameter

    is it possible to pass an array as a parameter to the
     PROCEDURE PRINT_REP_WEB  
    It is:
         ADD_PARAMETER(PL_ID, 'P_1',     TEXT_PARAMETER,'G12-303B2','G12-306B','G12-408B','G12-515B1'); 
    and using ' in (: p_1) "report of the query.

    -----
    Forms [32 bit] Version 10.1.2.0.2 (Production)
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    10.1.2.0.2 generator

    has obtained assistance here
    {: identifier of the thread = 2416695}
    {: identifier of the thread = 2412912}

  • Can you pass objects (no strings) to application.onConnect ()?

    Documentation on the parameters for application.onConnect () is below.  It can take a customer 'object' but is ambiguous in the optional parameters (vs channels objects).  I'm guessing that only strings?

    I have an item of value user with a few pieces of info in it that I pass around the client side and he would like the server to be added to its list of users (usersSO).  I guess I'll have to send it upward into pieces then re-create somehow on the server?

    Parameters

    clientObj
    A customer object. This object contains information about the client that connects to the application.
    p1 ..., pN
    Optional parameters passed to the application.onConnect() Manager of the client-sideNetConnection.connect()







    Yes... you think actionscript 1 when you pass arguments to FMS for treatment. No class, no specimen.

    There was noises on AS3 support in a future version of FMS, but I think that at this stage it's just that... noise.

  • Passing object XML in Flash to ASP.

    Hi guys...

    Is it possible to pass a Variable of object/array of Flash XML to ASP?

    If it is, how to obtain and analyze the object/table XML variable in the ASP file?

    I intend to go with ASP to create an external XML file, and then I'll feed XML to Falsh data.
    Incase of additions or Corrections in the data, once again I'll pass the details of flash to ASP and replace the existing XML file.

    Please help me...

    Thanks in advance...

    - ****



    Thanks in advance...

    - ****

    The XML in Flash class has multiple ways to send data to pages of script on the server side. . Send(),. sendAndLoad(), etc..

    If you want the data sent in the form of XML object and not as a pair key/value as a form post, check if you set the contentType to "text/XML" before using the send() or sendAndLoad() controls.

    Read the XML code directly in ASP will require you to use the Request object.

    Set xml_dom = Server.CreateObject ("MSXML2. DOMDocument')
    xml_dom. Load (request)

    Tim

  • How to pass objects in PL SQL packaged procedure as parameters to java

    Hello

    His summer job where I created type next. But when we used inside the package, it does not work...

    create or replace package pack1

    T_n ARRAY TYPE IS NUMBER (10);

    PROCEDURE insrt_pay (p_array IN t_n, p_values OUT NUMBER) IS

    v_cnt NUMBER (10): = 0;

    BEGIN

    BECAUSE me in 1... p_array. COUNTING LOOP

    v_cnt: = v_cnt + (i) p_array;

    END LOOP;

    p_values: = v_cnt;

    END;

    end pack1;

    It is now possible in 12 c:

    JDBC reference information: use of Types of PL/SQL

  • pass an associative array as parameter?

    Hello

    is it possible to create a table associative w/o using a variable to pass it as a parameter to a function?

    As:

    new Array(["ID":"timeout"])

    But it does not work.

    TIA

    Don't know what you're trying to do, but an associative array is an object base type.

    This will create an array containing a single element of the object:

    new Array ({ID: "timeout"}) / / note the braces

  • by passing the array of objects to the procedure

    Hi, I wrote a procedure to accept the array of input objects. It has worked well.

    This is the only setting of entry in my Interior.

    But now, I tried to add a off set the parameter of type varchar2 to my procedure to send a return value, but it gives me an error

    PLS-00410: fields in duplicate in the FOLDER list, TABLE or argument are not allowed.

    Please suggest cant I pass all other arguments when using an array of record or an object as a parameter?

    This is my code
    CREATE OR REPLACE TYPE PREF_OBJ_TYPE as object (
    
     PREF_CD  varchar2(20),
     USR_ID   VARCHAR2(20),
     PROD_CD  VARCHAR2(50),
     DFLT_PREF_VAL_TX VARCHAR2(250),
     USR_PREF_VAL_TX VARCHAR2(250),
     CRE_USR_ID VARCHAR2(20),
     UPDT_USR_ID VARCHAR2(20) );
    /
    
    
    
    
    CREATE OR REPLACE TYPE PREF_ARRAY is table of PREF_OBJ_TYPE;
    
    CREATE OR REPLACE procedure MMM(in_pref PREF_ARRAY,v_err out varchar2 )
    is
    
    v_prod_dim_nb NUMBER;
    v_usr_dim_nb  NUMBER;
    v_count NUMBER;
    v_err varchar2(50);
     
    
    begin
    
    for i in  in_pref.first.. in_pref.last
    
    LOOP
    
    /* Derive the product and user dim numbers */
    
    select prod_dim_nb into  v_prod_dim_nb from prod_dim where prod_cd=in_pref(i).prod_cd ;
    select usr_dim_nb into v_usr_dim_nb from usr_xref where usr_id=in_pref(i).usr_id and sys_id='ACCESS';
    
    
    /* check if the record already exist in usr_prod_pref corresponding to that  user,prod,pref */
    
    select count(1) into v_count from usr_prod_pref_test where prod_dim_nb=v_prod_dim_nb and usr_dim_nb=v_usr_dim_nb and pref_cd=in_pref(i).pref_cd;
    
    if v_count=0 then 
    
    BEGIN
    
    INSERT INTO USR_PROD_PREF_TEST values(v_usr_dim_nb,in_pref(i).pref_cd,v_prod_dim_nb,in_pref(i).DFLT_PREF_VAL_TX,in_pref(i).usr_PREF_VAL_TX,'Active',NULL,
    in_pref(i).cre_usr_id,sysdate,in_pref(i).updt_usr_id,NULL);
    
    
    
    END;
    
    else 
    
    
    
    update USR_PROD_PREF_TEST set USR_PREF_VAL_TX=in_pref(i).USR_PREF_VAL_TX,DFLT_PREF_VAL_TX=in_pref(i).DFLT_PREF_VAL_TX,UPDT_USR_ID=in_pref(i).updt_usr_id,updt_dt=sysdate,cre_usr_id=in_pref(i).cre_usr_id where 
    prod_dim_nb=v_prod_dim_nb and usr_dim_nb=v_usr_dim_nb and pref_cd=in_pref(i).pref_cd;
    
    
    end if;
    
    
    end loop;
    
    commit;
    
    v_err:='abc';
    
    end;
    /
    Published by: raj_fresher on October 9, 2009 06:56

    Why the 6001 number is assigned to the error code? Oracle generates error code right... Why the procedure does not use this number move like to help put
    r_v_errod_cde and r_v_error_msg?

    I don't know who wrote at the beginning of this procedure, but no doubt he wanted to use some 'custom error handling?
    Furthermore, I don't see anything happening with R_V_ERROR_CODE and R_V_ERROR_MSG, or did you leave this part out of your snippet?
    This way of using a WHEN of OTHER (not followed by a RAISE) is considered to be a 'bad practice' / a bug.

  • Can not pass an object of type to the void workflow.

    Hello

    I want to do a log of every action in an external file.

    In an action, I create an object of type FileWriter(). Opening the connection and then returning this object from main workflow.

    In the main workflow, we catch the output of the action in "logFile" variable that is declared as an attribute of type "Any".

    Also, main workflow has a workflow of void. I'm passing 'logFile' object for this void as an input workflow to collect newspapers. But I get an error saying:

    "TypeError: can't call method"writeLine"null".

    So how to send attributes to the void in the form of an object workflow?

    It works for variables of type object, not as a number, String, composite type etc.

    Kind regards

    Shubahda

    Reflection, I think now this behavior is probably normal/expected.

    FileWriter objects are objects that are not serializable/searchable script. I'll check with colleagues who are more familiar with the implementation of the transition from setting how such objects can be manipulated (maybe there's a way to wrap them up other than "Any"), but it will happen after the holidays.

    In the meantime, do you really need to pass objects FileWriter autour? Is it possible to have an action of logging, accepting as inputs the message and (possibly) means the name of the log file, which will open the log file, write the message and close the log file? And call this action in any workflow job/slot-workflow/scripts box where you want to save something. Yes, the log file will be opened/closed frequently (for each log message), but the drop in performance should not be so great.

  • How to pass a single form filed with the second shape parameter

    Hi all,
    I get the custom form a requirment.already one, just added the button when the button on a new form opens, this form with a logical filed.here is the first form a single block dat filed pass the second shape parameter


    Kind regards
    Sandrine

    994418 wrote:
    Hi, HAMID

    Hi stephane
    Good here we solve you your problems. If you share the solution other people can get the same kind of help from you.

    Also when you check the option add any thread as a response, if it solved * [SOLVED] * to the left of your subject line.

    Hamid

    Mark correct/good to help others to get the right answers. *

Maybe you are looking for