How to run execute immediate with variables

Hi friends,
How to run execute immediate with variables in v_stmt below?
I don't know how to declare value I have here.
Set serveroutput on;
DECLARE
   i        VARCHAR (20);
   v_stmt   VARCHAR2 (100);

   CURSOR c
   IS
      SELECT sqlid FROM temp1;


BEGIN
   OPEN c;

   LOOP
      FETCH c INTO i;
      EXIT WHEN c%NOTFOUND;
      DBMS_OUTPUT.put_line (i);
      v_stmt := 'select * from table(dbms_xplan.display_cursor('&i',null))'
      execute immediate v_stmt;
   END LOOP;

   CLOSE c;
END;
/
Regds,
Kunwar.

You must first use a variable binding (named ': v' in the SQL statement in my example):

set serveroutput on;
DECLARE
   i        VARCHAR (20);
   v_stmt   VARCHAR2 (100);

   CURSOR c
   IS
       -- modified for a quick test
      SELECT sql_id FROM v$sql where child_number > 2;

BEGIN
   OPEN c;

   LOOP
      FETCH c INTO i;
      EXIT WHEN c%NOTFOUND;
      DBMS_OUTPUT.put_line (i);
      v_stmt := 'select * from table(dbms_xplan.display_cursor(:v,null))';
      execute immediate v_stmt using i;
   END LOOP;

   CLOSE c;
END;
/

However because your SELECT statement returns multiple lines, you need to adapt your code to process all rows returned (as already suggested in first response to your message).

Instead of using the PL/SQL, I recommend you to generate a SQL file using only SQL, and then run the generated SQL file.
For example:

spool edx.sql
set serveroutput on
declare
v_stmt varchar2(100);
v_q char(1):='''';
begin
dbms_output.put_line('spool edx.log');
for s in (select sql_id from v$sql where child_number >2)
 loop
  dbms_output.put_line('select * from table(dbms_xplan.display_cursor(' || v_q || s.sql_id || v_q || ',null));');
 end loop;
 dbms_output.put_line('exit');
end;
/
spool of

This generates a file similar to:

spool edx.log
select * from table(dbms_xplan.display_cursor('5rygsj4dbw6jt',null));
select * from table(dbms_xplan.display_cursor('5rygsj4dbw6jt',null));
select * from table(dbms_xplan.display_cursor('5rygsj4dbw6jt',null));
select * from table(dbms_xplan.display_cursor('fsbqktj5vw6n9',null));
select * from table(dbms_xplan.display_cursor('6q42j0018w7t8',null));
select * from table(dbms_xplan.display_cursor('a5mmhrrnpwjsc',null));
select * from table(dbms_xplan.display_cursor('3c1kubcdjnppq',null));
select * from table(dbms_xplan.display_cursor('3c1kubcdjnppq',null));
select * from table(dbms_xplan.display_cursor('9gkq7rruycsjp',null));
select * from table(dbms_xplan.display_cursor('f0wj261bm8snd',null));
select * from table(dbms_xplan.display_cursor('ab3swhv5g138y',null));
select * from table(dbms_xplan.display_cursor('6vgvyh4xw9c5g',null));
select * from table(dbms_xplan.display_cursor('ak5crjygnpk60',null));
select * from table(dbms_xplan.display_cursor('9p6bq1v54k13j',null));
select * from table(dbms_xplan.display_cursor('19x1189chq3xd',null));
select * from table(dbms_xplan.display_cursor('7sx5p1ug5ag12',null));
select * from table(dbms_xplan.display_cursor('730vdzhng6m6g',null));
select * from table(dbms_xplan.display_cursor('730vdzhng6m6g',null));
select * from table(dbms_xplan.display_cursor('0v3dvmc22qnam',null));
select * from table(dbms_xplan.display_cursor('0v3dvmc22qnam',null));
select * from table(dbms_xplan.display_cursor('a1zv6wju3ftgv',null));
select * from table(dbms_xplan.display_cursor('7ng34ruy5awxq',null));
select * from table(dbms_xplan.display_cursor('7ng34ruy5awxq',null));
select * from table(dbms_xplan.display_cursor('b2gnxm5z6r51n',null));
select * from table(dbms_xplan.display_cursor('b2gnxm5z6r51n',null));
select * from table(dbms_xplan.display_cursor('g4gp07gt2z920',null));
select * from table(dbms_xplan.display_cursor('1gu8t96d0bdmu',null));
select * from table(dbms_xplan.display_cursor('g00cj285jmgsw',null));
select * from table(dbms_xplan.display_cursor('g00cj285jmgsw',null));
select * from table(dbms_xplan.display_cursor('g00cj285jmgsw',null));
select * from table(dbms_xplan.display_cursor('bn4b3vjw2mj3u',null));
select * from table(dbms_xplan.display_cursor('38243c4tqrkxm',null));
select * from table(dbms_xplan.display_cursor('2abjfnvy5rkyg',null));
select * from table(dbms_xplan.display_cursor('350f5yrnnmshs',null));
select * from table(dbms_xplan.display_cursor('350f5yrnnmshs',null));
select * from table(dbms_xplan.display_cursor('3s1yukp05bzg6',null));
select * from table(dbms_xplan.display_cursor('3s1yukp05bzg6',null));
select * from table(dbms_xplan.display_cursor('1tgukkrqj3zhw',null));
exit

PL/SQL procedure successfully completed.

Edited by: P. Forstmann March 20, 2013 19:06

Edited by: P. Forstmann March 20, 2013 19:33

Tags: Database

Similar Questions

  • use of execute immediate with variables

    Hello

    I want to update a table with immediate execution, but I need to use the variable to run immediately. I typed a code, but the code below does not work and I m getting the error ORA-00936. Something wrong with this code?

    WHILE v_acu_payment_amount > 0

    LOOP

    BEGIN

    SELECT emplid, amount_past_due

    IN v_emplid, v_vade_tutari

    OF vade_temp

    WHERE the sira = v_sirano AND emplid IN (r1.emplid);

    END;

    v_acu_payment_amount: = v_acu_payment_amount - v_vade_tutari;

    Dbms_output.put_line ('paymentamount2' | v_acu_payment_amount);

    IF v_acu_payment_amount > 0

    THEN

    EXECUTE IMMEDIATE "update vade_temp set AMOUNT_PAST_DUE = to_number('||) 0

    || ') where sira = to_number (')

    || v_sirano

    || ')';

    ON THE OTHER

    Temp: = v_acu_payment_amount * (-1);

    Dbms_output.put_line (temp);

    EXECUTE IMMEDIATE "update vade_temp set AMOUNT_PAST_DUE = to_number (')"

    || Temp

    || ') where sira = to_number (')

    || v_sirano

    || ')';

    END IF;

    COMMIT;

    v_sirano: = v_sirano + 1;

    END LOOP;

    Kind regards

    Gunce

    In addition, you have no dynamic SQL for this

    [code]

    WHILE v_acu_payment_amount > 0

    LOOP

    BEGIN

    SELECT emplid, amount_past_due

    IN v_emplid, v_vade_tutari

    OF vade_temp

    WHERE the sira = v_sirano AND emplid IN (r1.emplid);

    END;

    v_acu_payment_amount: = v_acu_payment_amount - v_vade_tutari;

    Dbms_output.put_line ('paymentamount2' | v_acu_payment_amount);

    IF v_acu_payment_amount > 0

    THEN

    UPDATE vade_temp

    SET amount_past_due = 0

    WHERE the sira = v_sirano;

    ON THE OTHER

    Temp: = v_acu_payment_amount * (-1);

    Dbms_output.put_line (temp);

    UPDATE vade_temp

    SET AMOUNT_PAST_DUE = temp

    where sira = v_sirano;

    END IF;

    COMMIT;

    v_sirano: = v_sirano + 1;

    END LOOP;

    [/ code]

    But if you need dynamic sql statements, then you should use bind variables as

    ...

    EXECUTE IMMEDIATE "UPDATE vade_temp SET amount_past_due =: b1 WHERE sira =: b2' using 0, v_sirano;"

    ...

    HTH

  • How to run JavaFX jar with JRE7 on MAC OS Lion 10.7.5?

    I created a jar of JavaFX application bundled with ANT on Windows 8 OS, 64-bit computer. I have 1.7.0_09 JavaFx2.0 and Java installed on my Windows O.S.
    <target name="CreatingJars" depends="Compiling" description="generate the distribution" >
                        <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"      
                                 uri="javafx:com.sun.javafx.tools.ant" classpath="${env.JAVA_HOME}/lib/ant-javafx.jar"/>
                                 
                              <mkdir dir="${WorkingFolder}/temp/libs"/>
                             <copy todir="${WorkingFolder}/temp/libs">
                             <fileset file="${WorkingFolder}/CustomJars/ProjectLib.jar">
                             </fileset>
                             </copy>
                             <copy todir="${WorkingFolder}/temp/libs">
                             <fileset dir="${WorkingFolder}/libs">
                             </fileset>
                        </copy>
                        
                        <fx:jar destfile="${WorkingFolder}/${app.name}.jar">
                        <fx:application mainClass="${main.class}"/>
                        <fx:resources>
                             <fx:fileset dir="${WorkingFolder}/temp/"/>
                        </fx:resources>
                             
                        <fileset dir="${WorkingFolder}/build"/>
                        <fileset dir="${WorkingFolder}/resources"/>
                        </fx:jar>
         </target> 
    When I am trying to run this JavaFX application pot on the use of MAC OS Lion 10.7.5

    java-jar application.jar

    He always shows a dialog box "application requires a newer version of Java Run-time" with the download link. Even I downloaded and successfully installed on my Mac, but it always shows me the same window.

    Java-version is still point to 1.6.

    Then I tried Java preferences to point to the current JRE 1.7, but I could find preferences Java Applications-> utilities-> Java-> Java Preferences.

    I would like to know - how to run JavaFX jar with JRE7 on MAC OS Lion 10.7.5? Is their another way to run the JavaFX JAR with JRE7 application?

    Read this article:
    http://blog.hgomez.net/blog/2012/07/20/understanding-Java-from-command-line-on-OSX/
    The article is excellent and you will understand how to set the java runtime for Mac environment.

    Try:

    export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
    java -version
    java -jar application.jar
    

    Also, it's lion not far away, although the lions like kidneys :-)

  • Execute Immediate with DOF and TABLE() - error ORA-22905

    Hello

    I have a problem trying to use a user defined the Type of the Table in a statement Execute Immediate containing a CREATE TABLE statement.

    Is there no work around for this problem?

    The actual code for the SELECT * OF TABLE(:T) is dynamic and slow. That's why I try to avoid to create/fill the table in two steps (as does with MY_TABLE1). Also, in this case, I can't use SELECT * but must specify all the columns (amount variable and over 100 columns).

    CREATE TYPE MY_TABLE_TYPE AS TABLE OF VARCHAR2(30);
    /
    DECLARE
        MT MY_TABLE_TYPE;
    BEGIN
        SELECT * BULK COLLECT INTO MT FROM DUAL;
        -- Two steps
        EXECUTE IMMEDIATE 'CREATE TABLE MY_TABLE1 (A VARCHAR2(30))';
        EXECUTE IMMEDIATE 'INSERT INTO  MY_TABLE1    SELECT * FROM TABLE(:T)' USING MT; -- OK
        -- One step
        EXECUTE IMMEDIATE 'CREATE TABLE MY_TABLE2 AS SELECT * FROM TABLE(:T)' USING MT; -- ERROR ORA-22905   
    END;
    /
    

    byee

    Andrea

    In my view, the error message is incorrect or the less misleading. Bind variables cannot be used in DDL:

    SQL > declare
    2 number of v_var: = 99;
    3. start
    4 run immediately "' create the my_table2 in select table: double T" using v_var; "
    5 end;
    6.
    declare
    *
    ERROR on line 1:
    ORA-01027: bind variable not allowed for data definition operations
    ORA-06512: at line 4 level

    SQL >

    What you could do is use the package variable:

    SQL > CREATE OR REPLACE
    2 PACKAGE PKG1
    3 EAST
    4 MT MY_TABLE_TYPE;
    5 FUNCTION GET_MT
    6 RETURN MY_TABLE_TYPE;
    7 END;
    8.

    Package created.

    SQL > CREATE OR REPLACE
    PACKAGE 2 BODY PKG1
    3 EAST
    4 GET_MT FUNCTION
    5 RETURN MY_TABLE_TYPE
    6 EAST
    7. START
    8 RETURN MT;
    9 END;
    10 END;
    11.

    Package body created.

    SQL > DROP TABLE MY_TABLE1 PURGE
    2.

    Deleted table.

    SQL > DROP TABLE MY_TABLE2 PURGE
    2.
    DROP TABLE MY_TABLE2 PURGE
    *
    ERROR on line 1:
    ORA-00942: table or view does not exist

    SQL > START
    2. SELECT * BULK COLLECT INTO PKG1.MT FROM DUAL;
    3 - two steps
    4 RUN IMMEDIATELY "CREATE TABLE MY_TABLE1 (A VARCHAR2 (30))';"
    5 IMMEDIATELY EXECUTE "INSERT INTO MY_TABLE1 SELECT * FROM TABLE (PKG1." GET_MT)';
    6 - one step
    7 IMMEDIATE EXECUTION "CREATE TABLE MY_TABLE2 AS SELECT * FROM TABLE (PKG1." GET_MT)';
    8 END;
    9.

    PL/SQL procedure successfully completed.

    SQL > select * from my_table1;

    A
    ------------------------------
    X

    SQL > select * from my_table2;

    COLUMN_VALUE
    ------------------------------
    X

    SQL >

    SY.

  • How to run a procedure with parameters in pl/sql collections?

    I created a procedure with parameter from the collection. Can somone help me how to run a procedure in passing the parameters in the collection.
    Package and how to create is successful. But I get the error message when executing the procedure.

    ORA-06550: line 3, column 19:
    PLS-00222: no function with name 'T_TAB' does exist in this scope

    I gave the example of code here. Can someone please help me solve this problem.

    -Spec package

    create or replace package pkg_dist is

    TABLE index IS THE NUMBER of t_tab_num TYPE of PLS_INTEGER;


    procedure prc_test (a t_tab_num IN,
    b IN t_tab_num,
    c IN OUT t_tab_num);
    end pkg_dist;

    -Package body

    create or replace package body is pkg_dist

    procedure prc_test (a t_tab_num IN,
    b IN t_tab_num,
    c IN OUT t_tab_num) is


    Start


    IF (a (16) = 0) then
    (16) c: = 0;
    c (17): = 0;
    c (18): = 0;
    end if;
    c (15): = (14)-(15)-a (16);
    (16) c: = b (16) /b (17);
    c (17): = 50;
    (18) c: = a (16) * 2;

    end prc_test;
    end pkg_dist;

    -executeing procedure

    declare
    TABLE index IS THE NUMBER of t_tab TYPE of PLS_INTEGER;
    x t_tab: = t_tab (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
    y t_tab: = t_tab (0,10,15,20,25,30,35,40,45,50,60,75,100,125,150,200,250,500);
    z t_tab;
    BEGIN
    pkg_dist.prc_test (x, y, z);
    dbms_output.put_line (z (18));
    END;

    Error:
    --------------------------------------------------------------------------------
    ORA-06550: line 3, column 19:
    PLS-00222: no function with name 'T_TAB' does exist in this scope

    My suggestion would be:

    CREATE OR REPLACE PACKAGE pkg_dist IS
    
       PROCEDURE prc_test (a IN SYS.odcinumberlist, b IN SYS.odcinumberlist, c IN OUT SYS.odcinumberlist);
    END pkg_dist;
    
    CREATE OR REPLACE PACKAGE BODY pkg_dist IS
       PROCEDURE prc_test (a IN SYS.odcinumberlist, b IN SYS.odcinumberlist, c IN OUT SYS.odcinumberlist) IS
       BEGIN
          IF (a (16) = 0) THEN
             c (16) := 0;
             c (17) := 0;
             c (18) := 0;
          END IF;
    
          c (15) := a (14) + a (15) + a (16);
          c (16) := b (16) / b (17);
          c (17) := 50;
          c (18) := a (16) * 2;
       END prc_test;
    END pkg_dist;
    /
    
    DECLARE
       x   SYS.odcinumberlist;
       y   SYS.odcinumberlist;
       z   SYS.odcinumberlist;
    BEGIN
       x := sys.odcinumberlist (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
       y := sys.odcinumberlist (0,10,15,20,25,30,35,40,45,50,60,75,100,125,150,200,250,500);
       z := sys.odcinumberlist (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
       pkg_dist.prc_test (x, y, z);
       DBMS_OUTPUT.put_line (z (18));
    END;
    /
    

    See you soon,.
    Manik.

  • Use of EXECUTE IMMEDIATE with XML

    Database version: 10.2.0.3.0 - 64bi

    Hi all

    I have an xml that is stored in a table, xmltype column.
    I target insert tables including column names and xml nodes are the same.
    using the table of all_tab_columns I will generate columns must be passed to xmltable.
    all these data, I'll store them in variables and finally proceed to xmltable as below
    I just want to know using execute immediate is good to use XML?

    SQL_STMT: = 'insert'. table_name | ' ( '|| V_COLUMN_NAME |') ' ;
    SQL_STMT: = SQL_STMT | ' SELECT '. V_XTAB_COLUMN_NAME |
    "FOR TO_XML,
    XMLTABLE(' || v_xpath ||)
    "PASSAGE XML_VALUE
    columns | V_COLUMNS_DATA_TYPE
    ||') XTAB
    WHERE Seq_NO = ' | P_SEQUENCE_NO;

    RUN IMMEDIATELY SQL_STMT;

    Thank you and best regards,
    Ruby

    Hi Ruby,

    I just want to know using execute immediate is good to use XML?

    Sorry, but this question does not make much sense.
    Whether or not dynamic SQL means XML is not relevant, the statement will end up as a cursor in the shared pool independently and be executed or retrieved as any other.

    If I were you, I'd be worried on the statement do not use bind variables, or the need for dynamic SQL in the first place.

    Why should you use dynamic SQL?
    If it's laziness, because there are a lot of columns to write down, then it is a bad reason.

  • EXECUTE IMMEDIATE with DDL

    I'm trying to write a script that will perform the synchronization between two databases, sequence numbers. The only way I know to update the nextval is to change the INCREMENT value, take the nextval, then together, the return to 1 INCREMENT value. If there is an easier way, I'd be interested to hear about it too.

    However, my current problem is the following. Once I determine dynamically what should be the value to INCREMENT BY, I have run this...


    {color: #808080} declare {color}


    {color: #808080} v_idDiff number: = 1; {color}


    {color: #808080} begin {color}


    {color: #808080} run immediately "ALTER SEQUENCE SPHRSBILLING. WORK_UNIT_ID INCREMENT BY: 1 MINVALUE MAXVALUE 999999999999999999999999999 NOCACHE NOCYCLE ALL 0'{color}


    {color: #808080} using v_idDiff;
    {color} {color: #999999} {color: #808080} end; {color}
    {color}
    And I get this...

    {color: #999999} {color: #808080} ORA-01722: invalid number
    ORA-06512: at line 5
    {color}
    {color} If I simplify things for tests and only try to run this...

    {color: #808080} run immediately "ALTER SEQUENCE SPHRSBILLING. WORK_UNIT_ID INCREMENT OF 100 MINVALUE MAXVALUE 999999999999999999999999999 NOCACHE NOCYCLE ALL 0';
    {color}
    Can I get this...

    {color: #808080} ORA-06550: line 1, column 17:
    PLS-00103: encountered the symbol "ALTER SEQUENCE SPHRSBILLING. WORK_UNIT_ID INCREASE OF 100 DIGRAPH"when expecting one of the following values:
    {color}


    {color: #808080}: =. ( @ % ;
    The symbol ': = ' was replaced by 'ALTER SEQUENCE SPHRSBILLING. WORK_UNIT_ID INCREASE OF 100 MINVAL' to continue.
    {color}
    {color: #000000} If I run the ALTAR without being in an EXECUTE IMMEDIATE then it works fine. Ideally, I would like to just pass v_idDiff as a parameter in the ALTAR without the EXECUTE IMMEDIATE, but it does not seem to allow this.

    Can someone help me?

    Thank you

    Ian {color}

    Published by: user7808064 on December 3, 2008 11:06

    Use it and please cache sequence as they are expensive generate

    DECLARE
    v_sql VARCHAR2 (200);
    BEGIN
    v_sql: =.
    'ALTER SEQUENCE SPHRSBILLING. WORK_UNIT_ID INCREMENT OF 100 MINVALUE MAXVALUE 999999999999999999999999999 NOCACHE NOCYCLE ALL 0';

    EXECUTE IMMEDIATE v_sql;
    END;

    Published by: OrionNet on December 3, 2008 14:27

  • How to run a procedure with refcursor to more

    an entry is User_id = CMSH_USER; p_Ot-num =-9999; p_ppst_flag = 'P' and I want to take the trace by running this procedure, and any1 help me, how to run this procedure below and how to use these 5 on refcursor...
     procedure Pr_get_mny(p_ot_Num      IN NUMBER,
                                     p_User_Id      IN VARCHAR2,
                                     p_Ppst_Flag IN VARCHAR2,
                                     Ref_Cur        OUT Ref_Cursor,
                                     CUR_OPT        OUT Ref_Cursor,
                                     CUR_TAXRATE    OUT Ref_Cursor,
                                     CUR_TAXHOLD    OUT Ref_Cursor,
                                     CUR_PENDGAACNT OUT Ref_Cursor
                                     ) IS

    If the goal is to Test, the best tool is SQL

    var ref_cur refcursor
    var cur_opt refcursor
    var cur_taxrate refcursor
    var cur_taxhold refcursor
    var cur_pendgaacnt refcursor 
    
    exec pr_get_mny(-9999,'CMSH_USER','P',:ref_cur,:cur_opt,:cur_taxrate,:cur_taxhold,:cur_pendgaacnt)
    
    print ref_cur
    print cur_opt
    print cur_taxrate
    print cur_taxhold
    print cur_pendgaacnt
    
  • How to convert a SQL with variable

    Can Hello, please how I convert the underside with a dominant

    I need to be able to generate a plan to explain it, I think I should use cast.



    SELECT TO_NUMBER (OIL. REBALANCE_ORDER_ID UNIQUE_ID),
    OIL. ORDER_QTY,
    OIL. ORDER_TYPE,
    OIL. ORDER_SIDE,
    OIL. POSITION_TYPE,
    OIL. AVAILABLE_QTY AVAILABLE_QUANTITY,
    OIL. GROSS_AMOUNT ORDER_AMT,
    OIL.NET_AMOUNT NET_AMOUNT,
    OIL. FEE_AMT FEE_AMOUNT,
    OIL. ACCRUED_INTEREST_AMT ACCRUED_INTEREST
    TABLE (: B6) OIL

    >
    I need to be able to generate a plan to explain it, I think I should use cast.

    SELECT TO_NUMBER (OIL. REBALANCE_ORDER_ID UNIQUE_ID),
    OIL. ORDER_QTY,
    OIL. ORDER_TYPE,
    OIL. ORDER_SIDE,
    OIL. POSITION_TYPE,
    OIL. AVAILABLE_QTY AVAILABLE_QUANTITY,
    OIL. GROSS_AMOUNT ORDER_AMT,
    OIL.NET_AMOUNT NET_AMOUNT,
    OIL. FEE_AMT FEE_AMOUNT,
    OIL. ACCRUED_INTEREST_AMT ACCRUED_INTEREST
    TABLE (: B6) OIL
    >
    You're right - mount the bind as the appropriate type. I have a SQL type named emp_table_type so that it works

    explain plan for select * from table(cast (:e1 as emp_table_type))
    

    The models involved are

    CREATE OR REPLACE TYPE SCOTT.emp_scalar_type as object
      (EMPNO NUMBER(4) ,
       ENAME VARCHAR2(10),
       JOB VARCHAR2(9),
       MGR NUMBER(4),
       HIREDATE DATE,
       SAL NUMBER(7, 2),
       COMM NUMBER(7, 2),
       DEPTNO NUMBER(2)
      )
    /
    
    CREATE OR REPLACE TYPE SCOTT.emp_table_type as table of emp_scalar_type
    /
    
  • 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.
    
  • How to build an equation with variables

    I want to solve an equation below shows zero finder vi by the Newton Raphson:

    z a * b * c * exp(-z/a),.

    a, b, and c are variables

    I can build the equation with constant a, b, c, but how do I build it?

    Thank you very much!

    Use the number to the string functions in the palette of string with the antiderivative of string concatenation to create a formula with your values of a, b and c.  Read the detailed help for more information about limitations on the variable names carefully.  'z' is the only variable in your formula for the detector zero.  Example is LV2009.

    Lynn

  • How to create a matrix with variables

    I have 12 double variables (and not a table) and I wanted to put them all in a 4 x 3 matrix. I tried to use the matrix to build, but I didn't know how I would define which variable would be in every position of the matrix.

    Hi humberto,

    I thought that this would be explained in the tutorials beginning for LabVIEW, offered free of charge on the website of OR:

    Pretty easy, huh!

    Please go through these tutorials. Study the screws coming with LabVIEW example.

    It will help you learn LabVIEW!

  • How reverse "Run As Administrator" with indiv. software?

    A question of NTFS permissions:
    Can someone tell me the best way to clear the "Run As Administrator" status for the software once it has been power in this way, please? I have Firefox for this (for irrelevant reasons), via the dialog window right click on the .exe itself within programs program and regret. Thank you...

    This should make no difference how the software is installed.  It is sometimes useful, but does not add any right to space or special ermissions.  There is no way to 'Cancel', but as I said it makes no difference.  If you encounter a problem with the program, it is NOT the cause.

    If you want to get help from the program, please provide more information (name and version, the problem, ets.) and we will try to help you.

    I hope this helps.

    Good luck1

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How to run the script with parameters such as alarm action .ps1

    Hello

    I know not how to configure alarms, I know that I can point to monitor cluster for changes (via the GUI), but... I have different groups and I would like to set an alarm by vCenter which monitors cluster for changes. Let's call it "RefreshCapacityInfoOnExternalDB".

    So, lets just say. I would like to run my script whenever a virtual computer is added, Reconfigured or ESX host are removed, added in a Cluster. The alarm would launch the .ps1 script written in turn the ability to update external db cluster info.

    Shortly said: ability to cluster values are changed

    What I need is this: run the script-> CapacityInfoRefresher.ps1 < Cluster_name_where_ReconfigEventsTookPlace >

    I guess that, first I need an environment variable (if it exists) that can be used as a parameter for the < Cluster_name_where_ReconfigEventsTookPlace > placeholder script. Right?

    Chapter 16 of the book of LucD & Friends "PowerCli reference" mentions some environment vars but I'm stuck. Anyone using these options?

    THX

    A.S.

    You can set your alarm on the node above in your vCenter tree, this way it will be active for all collections in the vCenter.

    These alarm environment variables are automatically available for your alarm script when it is triggered.

    These environment variables, you will be able to determine to which cluster the alarm was pulled.

    So I don't think that you need to pass this information as a parameter to the script.

    Perrhaps you could share what exactly alarm you want to set and what looks like the script which should trigger alarm.

    And Yes, I use these environment variables in scripts of alarm

  • How to call the property with variable

    Basically, I want to fill a table with data

    photoArray [count] = varLoader.data.nombre;

    the problem is that 'number' is supposed to be a variable is inside a loop and I "number ="peak"+ count;" before him, but it does not work, how do I call?

    table rating to coerce strings to objects:

    photoArray [count] = varLoader.data [number];

    or

    photoArray [count] = varLoader.data ["peak" + count];

Maybe you are looking for

  • Mail not appearing is not in the JUNK e-mail folder

    In Mail on my mac, there are several e-mails. Some of the email accounts do not appear in the junk e-mail folder, so all the unwanted emails for all accounts are not removed at once. Here is a picture. You can see that only 3 accounts five e-mail app

  • "back" button does not return me to the area I have left in the search list

    I use version 7.0.1 of Firefox on a laptop with XP SP3. All known updates have been applied. I use google to search for a topic and a list of results from site. After selecting one of the conclusions, I click on the back button, I went back to the li

  • (E1P43AV) HP Pavilion 17 Notebook can work well with Windows?

    I want to use laptop with windows 7 because I have software that is not supported in Windows 8 AT ALL! I just also dispise Windows 8 and wish to return to the real world in the land of happy Windows 7 where do everything presence and is where I left

  • Smartphones blackBerry sync with Outlook

    Just got my phone yesterday evening.  I tried to sync my Outlook with the phone and no luck.  Tried to find used on how to do it and can't find it.  I really need to get my numbers on the phone.  If you talked about recently, sorry, but can someone d

  • Configuration of a timeout for an IPSEC tunnel

    With a VPN connection from site to site between two Cisco 837 s, is it possible that I can set up the IPSEC tunnel to be razed after a period of inactivity and, then, the tunnel is built again when more traffic is passed?