How to replace run immediately in 11g?

Hi, package and I need not not to use run immediately. There are a few plsql dynamic generation and sql stored in global lists. Any other possibility to execute without run immediately? TNX for help.

Edited by: 982676 2013-01-18 01:11

Dynamic code is dynamic. It must be run dynamically. And THIS should be the concern and not what dynamic execution interface is used.

Regarding the interfaces to execute dynamic PL/SQL code:
-immediate execution
-ref Cursor
-DBMS_SQL

Tags: Database

Similar Questions

  • How to pass a sequence of 'help' to run immediately

    How can I place a sequence.nxlval as a parameter using, here is my code looks like

    sql_string is-> insert into some_tab (col1, col2,...) (select col1: passed_seq,...) where the... (I want to insert values in sequence for col2)


    and I call it like


    passed_seq: = "seq_". some_dynamic_num |'. nextval' (in my PB will be sequences with the string formed as seq_10.nextval)

    EXECUTE IMMEDIATE sql_string using passes_seq;

    If I do like this I get

    Error: - 1722:ORA - 01722: invalid number seq_10.nextval

    Published by: DIVI on 8 January 2013 07:40

    >
    So is there another way to solve my problem, where queries are already formed and stored in a table in the form of data in the column, and I need to run those from different sequences in different scenarios.
    >
    Yes - you change applications to use a placeholder for the sequence you need (e.g. [SEQ_GOES_HERE]) when you need to run it you create a PL/SQL block into a VARCHAR2 variable, then use run immediately on the variable.

    If your stored query would look like this

    sql_string is -> insert into some_tab (col1,col2, ....) (select col1,[SEQ_GOES_HERE],......) where .... 
    

    Load the good seq.nextval in a variable, and then replace "[SEQ_GOES_HERE]" in the query with this value.

  • How can I create VI with inputs that run immediately when the update?

    I'm using LabView for controlling stepper motors. I would create a VI with a front panel that has 4 arrows, 2 per engine. My goal is to be able to run the VI and then press a button to move the engine.

    I created separate VI for each funcition of engines - one vi to set current operations, to determine the current travel, another to move up by a certain amount and so on. Work of these vi and I can move and adjust engines, but only by running separate VI.

    How can I combine them into a single VI and make them run to the pressure of a button or the change of a property? An example would be to establish a new current holding company and place the operation current vi run immediately and send the order to the engine. Then continue to press the arrow keys without having to hit 'run' on an another vi.

    Thank you very much


  • Oracle 11G copy a table to help to run immediately

    I want to copy the contents of a table in another aid to run immediately.

    It keeps fails with the following error

    ORA-00903: invalid table name
    ORA-06512: at "TABLE_COPY", line 6
    ORA-06512: at line 8 level



    create or replace
    procedure TABLE_COPY)
    Table1 varchar2,
    Varchar2 TABLE2)
    is
    Start
    run immediately 'insert'. TABLE2. "(select * from ' |) TABLE1 |') ' ;
    end;

    Published by: user9213000 on January 24, 2013 07:38

    user9213000 wrote:
    I want to copy the contents of a table in another aid to run immediately.

    It keeps fails with the following error

    ORA-00903: invalid table name
    ORA-06512: at "TABLE_COPY", line 6
    ORA-06512: at line 8 level

    create or replace
    procedure TABLE_COPY)
    Table1 varchar2,
    Varchar2 TABLE2)
    is
    Start
    run immediately 'insert'. TABLE2. "(select * from ' |) TABLE1 |') ' ;
    end;

    Published by: user9213000 on January 24, 2013 07:38

    Standard when boards (ab) use of EXECUTE IMMEDIATE is to compose the SQL statement in a single VARCHAR2 variable
    Then print the variable before passing to EXECUTE IMMEDIATE.
    COPY the statement & PASTE in sqlplus to validate its correctness.

  • Run immediately produced confusing errors

    I have a procedure that removes the selected rows of a table based on a dynamic WHERE condition. The column values are of type VARCHAR2. Using SQL Developer debug mode, I put the finger on the line of boredom to the Execute Immediate statement that produces a ' ORA-00907: lack the right parenthesis "error with or the other of these channels:

    v_sql: = ' DELETE FROM schema.table WHERE (column1 = "Value1" GOLD column1 = "Value2" GOLD column1 = "Value3" ") AND (column2 ="value4")';
    v_sql: = ' REMOVE FROM schema.table WHERE column1 ("Value1", "Value2", "value3") AND column2 IN ("value4")';
    Immediately run v_sql;

    Still in PL/SQL, the same lines running without error:

    DELETE FROM schema.table WHERE (column1 = 'value1' OR column1 = 'value2' GOLD column1 = 'value3') AND (column2 = 'value4');
    REMOVE FROM schema.table WHERE column1 IN ('value1', 'value2', "value3") AND column2 IN ("value4");

    I can even run the same instructions in an anonymous block without error:

    Set serveroutput on
    DECLARE
    v_cnt NUMBER;
    v_sql varchar2 (2000);
    BEGIN
    v_sql: = ' REMOVE FROM schema.table WHERE column1 ("Value1", "Value2", "value3") AND column2 IN ("value4")';
    Immediately run v_sql;
    Run immediately "select count (*) table" in v_cnt;
    dbms_output.put_line (v_cnt);
    Rollback;
    Run immediately "select count (*) table" in v_cnt;
    dbms_output.put_line (v_cnt);
    END;
    /
    I must be blind because neither dynaminc SQL statement needs an another right parenthesis. I even added one to test (same error ORA-00907!). I even tried this

    v_sql: = "DELETE FROM schema.table WHERE ((column1 = '' valeur1 '') OR (column1 = 'value2'))';"

    (same error ORA-00907!)

    I even tried to run the same without parentheses (ORA-00900: invalid SQL statement error). I guess the problem is the single quotes.

    Just for fun I tried that as well

    EXECUTE IMMEDIATE chr (39) | v_sql | Chr (39);

    and, as I suspected, I got the error "invalid SQL statement.

    I even tried this

    EXECUTE IMMEDIATE chr (39) | v_sql;

    and of course I got an ' ORA-01756: not correctly completed string "error.

    When I tried this

    EXECUTE IMMEDIATE v_sql | Chr (39);

    the same error "missing right parenthesis" surfaced.

    I've never had this problem with the Execute Immediate statements before. Unless someone can offer a penny to buy a clue, looks like I have no choice but to make the Immediate Execute in a loop FORALL to each WHERE condition using a variable binding for the value of the column.

    Your procedure changed a bit:
    Removed options CHR (39) and 'DELETE FROM' has been added at the beginning of your v_sql variable.

    CREATE OR REPLACE PROCEDURE delete_rows_proc (
       p_table        IN   VARCHAR2,
       p_schema       IN   VARCHAR2,
       p_columns      IN   VARCHAR2,
       p_col_values   IN   VARCHAR2,
       p_col_delim    IN   VARCHAR2,
       p_val_delim    IN   VARCHAR2
    )
    AS
    /*
    generic procedure to delete selected rows from a table
    
    INPUT PARAMETERS:
    1) P_TABLE (required): table name
    2) P_SCHEMA (required): schema name
    3) P_COLUMNS (required): a delimited string of character type column names
    4) P_COL_VALUES (required): a delimited string of column values
    (must match P_COLUMNS in delimited sequence and number);
    5) P_COL_DELIM (required): column delimiter for P_COLUMNS and P_COL_VALUES;
    must be a keyboard character delimiter that DOES NOT appear elsewhere in the column values;
    6) P_VAL_DELIM (required): column value delimiter for P_COL_VALUES;
    must be a keyboard character delimiter that DOES NOT appear elsewhere in the column values;
    must be different from P_COL_DELIM
    
    NOTE: if P_COLUMNS is not null then P_COL_VALUES cannot be null
    
    example of P_COLUMNS and P_COL_VALUES:
    P_COLUMNS = 'column1#column2'
    P_COL_VALUES = 'value1,value2#value4'
    P_COL_DELIM = '#'
    P_VAL_DELIM = ','
    deletes rows WHERE ((column1 = 'value1') OR (column1 = 'value2') AND (column2= 'value4')
    */
       v_sql              VARCHAR2 (4000);
       v_where_clause     VARCHAR2 (3900);
       v_from_clause      VARCHAR2 (200);
       v_col              VARCHAR2 (50);
       v_txt              VARCHAR2 (1000);
       i_col_delim_cnt1   INTEGER         := 0;
       i_col_delim_cnt2   INTEGER         := 0;
       x_loop_cnt         INTEGER         := 0;
       y_loop_cnt         INTEGER         := 0;
       delim_txt          VARCHAR2 (1000);
       i_delim_cnt        INTEGER         := 0;
       i_cnt              INTEGER;
       e_delim_not_eq     EXCEPTION;
    
       FUNCTION assemble_or_str (v_col IN VARCHAR2, v_txt IN VARCHAR2)
          RETURN VARCHAR2
       IS
          v_return   VARCHAR2 (1000) := '';
       BEGIN
          IF LENGTH (v_col) > 0
          THEN
    -- add opening parenthesis
             v_return := v_return || '(';
          END IF;
    
          FOR i IN 1 .. i_delim_cnt + 1
          LOOP
             v_return :=
                   v_return
                || '('
                || v_col
                || ' = '
                || CHR (39)
                || get_delimited_text (v_txt, p_val_delim, i)
                || CHR (39)
                || ')';
    
             IF i < i_delim_cnt + 1
             THEN
                v_return := v_return || ' OR ';
             END IF;
          END LOOP;
    
          IF LENGTH (v_return) > 0
          THEN
    -- add closing parenthesis
             v_return := v_return || ')';
          END IF;
    
    --dbms_output.put_line('v_return=' || v_return);
          RETURN v_return;
    -- e.g., v_return = '((column1 = 'value1') OR (column1 = 'value2'))''
       END;
    BEGIN
       IF p_columns IS NOT NULL AND p_col_values IS NOT NULL
       THEN
    -- count the column delimiter in both parameters
          i_col_delim_cnt1 :=
                LENGTH (p_columns)
                - LENGTH (REPLACE (p_columns, p_col_delim, ''));
          i_col_delim_cnt2 :=
               LENGTH (p_col_values)
             - LENGTH (REPLACE (p_col_values, p_col_delim, ''));
    
          IF i_col_delim_cnt1 = i_col_delim_cnt2
          THEN
    -- if both strings have the same # of column delimiters
    -- assemble the where clause
             IF i_col_delim_cnt1 = 0
             THEN
    -- for single column
    -- find how many delimited values are in P_COL_VALUES
                i_delim_cnt :=
                     LENGTH (p_col_values)
                   - LENGTH (REPLACE (p_col_values, p_val_delim, ''));
    
                IF i_delim_cnt > 0
                THEN
    --dbms_output.put_line('i_delim_cnt = ' || i_delim_cnt);
    -- for single column with multiple column values
                   v_where_clause := assemble_or_str (p_columns, p_col_values);
                ELSE
    -- for single column with single column value
                   v_where_clause :=
                        p_columns || ' = ' || CHR (39) || p_col_values
                        || CHR (39);
                END IF;
             ELSE
    -- for multiple columns
                x_loop_cnt := i_col_delim_cnt1 + 1;
    
                FOR x IN 1 .. x_loop_cnt
                LOOP
    -- for each column
                   v_col := get_delimited_text (p_columns, p_col_delim, x);
                   v_txt := get_delimited_text (p_col_values, p_col_delim, x);
    --dbms_output.put_line('loop '||x||': vcol='||v_col);
    --dbms_output.put_line('loop '||x||': v_txt='||v_txt);
                   i_delim_cnt :=
                        LENGTH (v_txt)
                        - LENGTH (REPLACE (v_txt, p_val_delim, ''));
    
                   IF i_delim_cnt > 0
                   THEN
                      v_where_clause :=
                                 v_where_clause || assemble_or_str (v_col, v_txt);
                   ELSE
                      v_where_clause :=
                            v_where_clause
                         || '('
                         || v_col
                         || ' = '
                         || CHR (39)
                         || v_txt
                         || CHR (39)
                         || ')';
                   END IF;
    
                   IF x < x_loop_cnt
                   THEN
                      v_where_clause := v_where_clause || ' AND ';
                   END IF;
                END LOOP;
             END IF;
          ELSE
    -- if i_col_delim_cnt1 i_col_delim_cnt2
    -- raise exception
             RAISE e_delim_not_eq;
          END IF;
       END IF;
    
    -- assemble the dynamic SQL statement
       v_from_clause :=
                      (CASE p_schema
                          WHEN NULL
                             THEN ''
                          ELSE p_schema || '.'
                       END) || p_table;
       v_where_clause :=
           (CASE
               WHEN v_where_clause IS NULL
                  THEN ''
               ELSE ' WHERE ' || v_where_clause
            END
           );
       v_sql := 'DELETE FROM ' || v_from_clause || v_where_clause; -- Added 'DELETE FROM '
       DBMS_OUTPUT.put_line (v_sql);
    
    -- test clauses separately
    -- EXECUTE IMMEDIATE 'DELETE FROM '|| v_from_clause;
    -- EXECUTE IMMEDIATE 'DELETE FROM '|| v_from_clause || v_where_clause;
       EXECUTE IMMEDIATE v_sql;
    
       EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM ' || p_table
                    INTO i_cnt;
    
       DBMS_OUTPUT.put_line ('i_cnt = ' || i_cnt);
       ROLLBACK;
    
       EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM ' || p_table
                    INTO i_cnt;
    
       DBMS_OUTPUT.put_line ('i_cnt = ' || i_cnt);
    --commit;
    EXCEPTION
       WHEN e_delim_not_eq
       THEN
          DBMS_OUTPUT.put_line
             ('ERROR: delimiter number mismatch! A column delimiter was found in the P_COLUMNS string and/or the P_COL_VALUES string; however, the number of column delimiters between the two string does not match. Process cannot be completed.'
             );
    -- WHEN OTHERS THEN
    -- DBMS_OUTPUT.PUT_LINE('Error in DELETE_ROWS_PROC procedure!');
    -- DBMS_OUTPUT.PUT_LINE(SQLERRM);
    END delete_rows_proc;
    /
    
    SQL> SELECT * FROM TABLE1
      2  /
    
    COLUMN1                                            COLUMN2
    -------------------------------------------------- -------------------------------------------------
    value1                                             value3
    value2                                             value3
    value3                                             value3
    value4                                             value3
    value1                                             value4
    value2                                             value4
    value3                                             value4
    value4                                             value4
    
    8 rows selected.
    
    SQL> exec DELETE_ROWS_PROC('TABLE1', 'SCOTT', 'COLUMN1#COLUMN2', 'value1,value2#value4', '#', ',')
    DELETE FROM SCOTT.TABLE1 WHERE ((COLUMN1 = 'value1') OR (COLUMN1 = 'value2')) AND (COLUMN2 = 'value4
    i_cnt = 6
    i_cnt = 8
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    I hope this helps.

    Kind regards
    JO

    Edit: Deleted a wrong comment

  • Portege R500 - how to replace the SSD?

    Hello

    1. I have trouble using the recovery CD. The computer to read the CD once and give me an error message that it cannot partition the SSD drive. Ask me to restart the PC. Then I insert the CD change once again, the sequence of boot on the CD, but now, the computer does not recognize the recovery CD. Now, the freezing of the PC after start.

    2. I have a legal windows vista CD I tried to install in the PC but I'm not a clean install because the computer does not read the CD

    3. I tried the CD in another computer. I insert the CD to reboot and the computer immediately went to the wizard of microsoft vista.

    4. I tested the CD rom and it works.

    5. I believe that the solid state SSD laptop drive has failed.

    I opened my laptop to check what I need to buy the brand SSD. However, is the first time that I change a SSD drive and I don't know where he is and how to replace. So, if someone can answer with the steps of how to do to replace the SSD I will appreciate it.

    Thank you
    Nils.

    Hello!

    In my opinion, it could also be a problem with the CD/DVD drive. I mean you have tried another drive and the computer laptop doesn t read this disc too.
    So for me it sounds like this drive is also defective.

    But as Akuma said you should also check the SATA Mode in the BIOS.

    I think the best way would be to contact you nearest ASP. They can check a defective hardware for laptop parts and Exchange. If your laptop is under warranty, repairs are free.
    The ASP s list that you can find here:
    http://EU.computers.Toshiba-Europe.com-online decision-making supported Downloads & => Download drivers

    Good bye

  • How to replace a bad IDE disk with a USB Flash drive system - and have all the functionality of XP Pro SP3

    How to replace a bad IDE disk with a USB Flash drive system - and have all the functionality of XP Pro SP3
    Given a PC without hard disk...
    How can you use a flash drive instead?
    So, indeed, the USB key works as an SSD...
    I saw online options that gives partial functionality of the system... and an option that is more than $100 (more than the system's worth)...
    None of these options are acceptable in the circumstances.
    It is an effort to create a machine for a particular use, built from a recycled pc for which hard drive was removed and destroyed by the original owner...
    The criterion is that it must work just like it was a mechanical drive running xp pro sp3 with all updates, etc...
    Thanks for any help.

    You can not install XP on a Flash as his unsupported drive. Your only two options are a traditional hard drive or Solid State Drive (SSD).

    J W Stuart: http://www.pagestart.com

  • I need help with a problem of file softdub.dll any answers or how to replace it?

    I need help with a problem of file softdub.dll all the answers, or how to replace it?  Yes, it's a problem of Vista vs itunes and apparently I lost? This file somehow.  I have no idea how blessed remedy.  I tried all the normal fixes / easy I know, but I am a novice at best.  so please, be gentle and try to guide me through a response.  Please, I beg you!

    Hello

    Did you download and save iTunes on the desktop > then right-click > select run as administrator to install?

    If you don't have anything done, see if this information helps you.

    "Not to install iTunes or QuickTime for Windows"

    http://support.Apple.com/kb/HT1926

    «Remove and reinstall iTunes, QuickTime, and other software components for Windows Vista or Windows 7»

    http://support.Apple.com/kb/HT1923

    If the advice already given does not, please contact Apple for assistance.

    "iTunes support-how to use iTunes.

    http://www.Apple.com/support/iTunes/

    "Contact iTunes Support.

    http://www.Apple.com/support/iTunes/contact/

    Or ask in the community Apple iTunes:

    https://discussions.Apple.com/community/iTunes

    See you soon.

  • I can not write the new message of Windows Live Essentials due to the demand of Silverlight.configuration.exe freeze my computer. How to replace this command?

    Silverlight.config.exe. appears again msg then causes a gel

    I can not write the new message of Windows Live Essentials due to the demand of Silverlight.configuration.exe freeze my computer.  How to replace this command?

    Hi JaphetMorales.

    (1) did you change on your computer before this problem?

    (2) what operating system is installed on your computer?

    What version of the operating system Windows am I running?

    http://Windows.Microsoft.com/en-us/Windows7/help/which-version-of-the-Windows-operating-system-am-i-running

    You can uninstall and reinstall Silverlight and then check.

    http://www.Microsoft.com/getSilverlight/get-started/install/uninstall-win.aspx

    See also:

    http://support.Microsoft.com/kb/977116

  • How can I run the malicious software removal tool?

    My apologies in advance if this seems trivial, but all the articles I have read on the forums refer to download (easy bit) and run the MSRT tool, but are rare on how to actually run it. Or if it runs automatically as part of Windows Defender?  I'm sure the answer will be obvious, but for now I'm stuck! Any help is appreciated. Thank you. JOCK McSQUIGGLE

    It's nothing to do with Windows Defender.

    It is a completely separate program.

    http://www.Microsoft.com/downloads/details.aspx?FamilyId=AD724AE0-E72D-4F54-9AB3-75B8EB148356&displaylang=en

    Instructions

    1. Click on the button download on this page to start the download.
    2. Do one of the following:
      • To start the installation immediately, click run.
      • To save the download to your computer for installation at a later time, click Save.
      • To cancel the installation, click Cancel.
      • If you save it, you double-click on it to run it like anything else.

    Mick Murphy - Microsoft partner

  • How can I run chkdsk f to repair a corrupted file winmail.exe

    How can I run chkdsk f to repair a corrupted file winmail.exe?

    Thank you

    Don

    Hello

    Try this: instead of this:

    Run the sfc/scannow command.

    http://support.Microsoft.com/kb/929833

    Use the (SFC.exe) System File Checker tool to determine which file is causing the problem and then replace the file. To do this, follow these steps:

    1. Open an elevated command prompt. To do this, click Start, click principally madeprograms,Accessories, right-clickguest, and then clickrun as administrator. If you are prompted for an administrator password or a confirmation, type the password, or clickallow.
    2. Type the following command and press ENTER:
      sfc/scannow

      The sfc/scannow command analyzes all protected system files and replaces incorrect versions with appropriate Microsoft versions

    How to analyze the entries in the log file generating the program Checker (SFC.exe) resources of Microsoft Windows in Windows Vista

    http://support.Microsoft.com/kb/928228#appliesTo

    If SFC detects the main problems it can't fix you may need to borrow a Microsoft dvd vista not an acer, HP etc. recovery disk and do a repair installation

    read the below tutorial on how to perform a repair installation

    http://www.Vistax64.com/tutorials/88236-repair-install-Vista.html

    ______________________________________________________

    and read this;

    How to run the check disk at startup in Vista or Windows 7

    http://www.Vistax64.com/tutorials/67612-check-disk-Chkdsk.html

  • How to replace the battery of the HP G72 laptop internal

    How to replace the battery internal HP G72 laptop?

    Hello

    You see a warning like "Pprimary battery (internal) (601)"?  If so, this refers to your main battery of notebooks, not the cell of RTC.  Further details on this on the document here.

    As a double check, you can still download and run the test utility of battery pack available on the next page and see if this indicates a problem with your battery.

    http://h20239.www2.HP.com/TechCenter/battery/battery_ts.htm

    Kind regards

    DP - K

  • How to replace the name of the column with variable

    Hello

    I have a PLSQL problem please.

    I have a table like this:

    IDENT LIBL_1 MONT_1 LIBL_2 MONT_2 LIBL_3 MONT_3 LIBL_4 MONT_4

    1               A          10               B               10          C               30               VIDE          0

    2               A          30               C               12          VIDE          0                 VIDE          0

    3               B          11               C               41          D               63               E               15

    ...

    I have a code like this:

    DECLARE

    x number;

    varchar2 column (20);

    CURSOR c_DPLT_TT_ICARE_FILL IS

    SELECT IDENT,

    LIBL_1,

    MONT_1,

    LIBL_2,

    MONT_2,

    LIBL_3,

    MONT_3,

    LIBL_4,

    MONT_4

    FROM MyTable;

    --

    l_mylist c_mycursor % ROWTYPE;

    BEGIN

    FOR l_mylist in c_mycursor LOOP

    x: = 1;

    the following: = "LIBL_" | x;

    WHILE ((l_mylist.colonne <>'EMPTY') OR (x < = 4)) LOOP

    -CODE-

    ...

    -CODE-

    x: = x + 1;

    the following: = "LIBL_" | x;

    END LOOP;

    END LOOP;

    The thing I want to do is to replace the name of column LIBL_1, LIBL_2... with a variable like this: = "LIBL_1" then value: = l_mylist.colonne to get the value of the LIBL_1.

    I tried manyu command but I can't find the solution. I even try an immediate execution but it seems that the list of cursor is unknown in the statement immediately execute.

    Anyone has a solution please?

    Thank you very much.

    user6390927 wrote:

    Hello

    I have a PLSQL problem please.

    I have a table like this:

    IDENT LIBL_1 MONT_1 LIBL_2 MONT_2 LIBL_3 MONT_3 LIBL_4 MONT_4

    1               A          10               B               10          C               30               VIDE          0

    2               A          30               C               12          VIDE          0                 VIDE          0

    3               B          11               C               41          D               63               E               15

    ...

    I have a code like this:

    DECLARE

    x number;

    varchar2 column (20);

    result mytable.libl_1%type;

    CURSOR c_DPLT_TT_ICARE_FILL IS

    SELECT IDENT,

    LIBL_1,

    MONT_1,

    LIBL_2,

    MONT_2,

    LIBL_3,

    MONT_3,

    LIBL_4,

    MONT_4

    FROM MyTable;

    --

    l_mylist c_mycursor % ROWTYPE;

    BEGIN

    FOR l_mylist in c_mycursor LOOP

    x: = 1;

    the following: = "LIBL_" | x;

    run immediately 'select'. the following: ' from mytable where ident =: b ' as a result using l_mylist.ident;

    WHILE ((result <> 'EMPTY') OR (x)<= 4)="" )="">

    -CODE-

    ...

    -CODE-

    x: = x + 1;

    the following: = "LIBL_" | x;

    END LOOP;

    END LOOP;

    The thing I want to do is to replace the name of column LIBL_1, LIBL_2... with a variable like this: = "LIBL_1" then value: = l_mylist.colonne to get the value of the LIBL_1.

    I tried manyu command but I can't find the solution. I even try an immediate execution but it seems that the list of cursor is unknown in the statement immediately execute.

    Anyone has a solution please?

    Thank you very much.

    Asuming LIBL_x columns have the same type or a base at least type

    then the changes above can help you.

    In addition, you can write your cursor loop in a loop "for i in (select...)."

    you don't need to write that match the code, but it is cosmetic.

    See you soon

    Karlheinz

  • ONE ERROR: run immediately (p_sql) return to p_id;

    Has written a simple procedure:

    procedure p_test)
    P_ID number,
    p_sql in varchar2
    *)*
    is
    Start
    run immediately (p_sql) return to p_id;
    end;

    Now, test it:

    declare
    P_ID number;
    p_sql varchar2 (2000): = ' insert into test1 (pk, str) values (1, "aaa")';
    Start
    pkg_utility.sp_save_without_blob (p_id, p_sql);
    dbms_output.put_line ('p_id' | p_id);
    end;


    The problem:
    Without the 'back in p_id' statement, the sql code can be run successfully. But with the "p_id return', an error occurred:

    ORA-20999: unexpected error when insert into test1 (pk, str) values (1, 'aaa')
    ORA-01006: there is no bind variable


    What I've done wrong? and how do I solve the problem?


    Thank you for helping.

    You're not saying 'what' you try to return.

    See the examples in the doc of PL/SQL
    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/Collections.htm#BABHDGIG
    >
    Example 5-52, using the RETURN IN the Clause with a Record

    DECLARE
    RECORD IS of TYPE EmpRec (last_name, employees.last_name%TYPE,
    salary employees.salary%TYPE);
    method EmpRec;
    emp_id NUMBER: = 100;
    BEGIN
    UPDATE employees SET salary = salary * 1.1
    WHERE employee_id = emp_id
    RETURN last_name, salary INTO method;
    DBMS_OUTPUT. PUT_LINE
    ("Just give a stimulus to ' | emp_info.last_name |)
    ', which now makes | emp_info.salary);
    ROLLBACK;
    END;
    /

  • using where clause with value to hardcode in run immediately

    Dear Experts, I use below in the stored procedure make exception.

    RUN IMMEDIATELY "REMOVE CC. TB WHERE COL ='HG ";

    When the collar is varchar2 (30) DC. TB

    Please guide how to use above the statement in the stored procedure


    Thank you

    DBA wrote:
    Dear Experts, I use below in the stored procedure make exception.

    RUN IMMEDIATELY "REMOVE CC. TB WHERE COL ='HG ";

    When the collar is varchar2 (30) DC. TB

    Please guide how to use above the statement in the stored procedure

    Thank you

    Why you use dynamic SQL? DELETE statement is a DML statement and its valid inside a PL/SQL block.

    So, you can remove the immediate execution and write your DELETE statement directly.

    begin
      delete from cc.tb where col = 'HG';
    end;
    

Maybe you are looking for