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;
/

Tags: Database

Similar Questions

  • run a string using to run immediately

    Hi experts,

    How can I run a string using to run immediately

    f.g. I want to execute the statement given below, but it gives "ORA-00900: invalid SQL statement" error:

    run immediately "select id from enterpriseuser";

    Thank you very much

    You must run as below:

    SQL> declare
      2  v_test pls_integer;
      3  begin
      4  execute immediate 'select 2 from dual' into v_test;
      5  dbms_output.put_line('v_test ' || v_test);
      6  end;
      7  /
    v_test 2    
    
  • 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

  • run immediately fails with the error

    The following code generates the error and I can not understand what the problem is:

    SET SERVEROUTPUT ON;

    declare

    Val number (21);

    s_sql varchar2 (2000);

    Start

    s_sql: = q '{select last_number in the Vale of all_sequences where sequence_owner = 'SST' and sequence_name = "ADDRESS_SEQ"}';

    Dbms_output.put_line ('sql 1 ' | s_sql);

    run immediately s_sql;

    end;


    Error report:

    ORA-00905: lack of keyword

    ORA-06512: at line 7

    00905 00000 - 'lack the key word'

    * Cause:

    * Action:

    select last_number SQL 1 in val all_sequences where sequence_owner = 'SST' and sequence_name = "ADDRESS_SEQ."

    The error is strange since

    Select last_number in the all_sequences where sequence_owner = 'SST' and sequence_name = "ADDRESS_SEQ."

    is a valid instruction

    Although I see no need for SQL dynamic in this case, in general, you must provide the vatiable to receive the value of the select statement outside the immediate execution.  More like:

    s_sql: = q '{select last_number in the all_sequences where sequence_owner = 'SST' and sequence_name = "ADDRESS_SEQ"}';

    execute immediate s_sql in val

    John

  • run immediately and the set of query results

    Hi gurus,

    I want to create a series of paintings on the fly using run immediately.
    the table_names are stored in another table work_table.


    run immediately (select 'create table' | table_name |) '(id int)' of
    * (select table_name in work_tables)); *


    This will raise error.

    ORA-06550: line 1, column 18:
    PLS-00103: encountered the symbol "SELECT" at the expected in the following way:

    (en) - + new case mod not null < an ID >
    < between double quote delimited identifiers of > < a variable binding >


    instead of using a cursor to run one by one is the lines an alternative solution?

    Thank you very much
    Charles

    May not know why you want to do it in a single statement, anyway:

    SQL> select * from work_tables;
    
    TABLE_NAME
    ------------------------------
    x1
    x2
    
    SQL> declare
      2  str varchar2(32000);
      3  begin
      4    for r in (select table_name from work_tables) loop
      5      str := str || 'execute immediate ''create table ' || r.table_name || '( id int )''; ' ;
      6    end loop;
      7
      8    execute immediate 'begin '||str||' end;';
      9
     10  end;
     11  /
    
    PL/SQL procedure successfully completed.
    
    SQL> desc x1
     Name                                                        Null?    Type
     ----------------------------------------------------------- -------- ------------------------------
     ID                                                                   NUMBER(38)
    
    SQL> desc x2
     Name                                                        Null?    Type
     ----------------------------------------------------------- -------- ------------------------------
     ID                                                                   NUMBER(38)
    

    Max
    http://oracleitalia.WordPress.com

    Published by: Massimo Ruocchio, February 18, 2010 15:03

  • run immediately - stop running on "no data found".

    run immediately v_sql
    in v_georaster
    using p_prin_id;

    On an exception "no data found", execution seems to stop. No error is thrown. If I wrap an exception/begin/end block around I can catch the error.

    11 GR 1 material patch7

    What is this problem fixed in 11 GR 2?

    itsme1234 wrote:
    Select wma_test.insert_coin (double);

    If you call your function in a SQL statement. In this case, it throws an error like "0 rows returned" is a valid state for a SQL statement.

    If you want no_data_found to throw an error when it is called from a SQL statement, you must trigger a different error - user-defined would be best.

  • 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


  • Error running Visual C++ Library. He said that something is trying to access my computer?

    "My laptop works on Vista.  I get a message warning that a program is trying to access my computer and fix it in unusual ways on my C drive. It comes from the library of Visual C++ from Microsoft and reports a runtime error. When I try to make the X it told me to wait, and when he finished my screen go empty. I took the battery out and restart with the power cable the same pop-up window. (I've got press din't ok cause someone else did and it dint work) Error running Visual C++ Library.  I get a message warning that a program is trying to access my computer in an unusual way on my C drive. It comes from the library of Visual C++ from Microsoft and reports a runtime error. When I try to turn the x he go wait for me and then my screen is white. I took the battery out and restart with the power cable the same pop-up window. How can I fix this please.

    Hi Macyiorge,

    ·         Did you do changes on the computer before the show?

    Follow these methods.

    Method 1: Follow these steps:

    Step 1: Start the computer in safe mode and check if the problem persists.

    Step 2: If the problem does not persist in safe mode, perform a clean boot to see if there is a software conflict as the clean boot helps eliminate software conflicts.

    Note: After completing the steps in the clean boot troubleshooting, follow the link step 7 to return the computer to a Normal startupmode.

    Method 2: You can reinstall Visual C++ Library Runtime components.

    You can uninstall all existing Microsoft Visual C++ Redistributable Package and install the latest Microsoft Visual C++ 2010 Redistributable Package and check if it helps.

    Step 1: To uninstall the package:

    a. open programs and features.

    b. in the list, find the Package redistributable Microsoft Visual C++ and click on it.

    c. right click top and select Uninstall.

    d. restart the computer.

    Step 2: Download and install the latest package and see if it helps.

    http://www.Microsoft.com/downloads/en/details.aspx?FamilyId=A7B7A05E-6DE6-4D3A-A423-37BF0912DB84&displaylang=en

    For reference:

    What is a runtime error?

  • I'm trying to install Office note 8.1 but get this error message immediately after you enter the serial number and authentication code.

    Remark Office OMR

    I've been remark office omr 8.1 installed on 32-bit windows vista (intel pentium DC) for the last year laptop. Now plan to move it to a more recent hardware and the OS.

    I'm trying to install Office note 8.1 on Windows 7 Home Basic 64 bit (on laptop AMD E450 DC base). But am getting this error message immediately after you enter the serial number and authentication code. I tried to install different versions of the .net Framework (from 1.1 to 4), but nothing seems to solve the problem.

    I even tried to install it in mode compatibality. but no luck.

    Here is the error message (between BEGIN and END lines)

    -BEGIN-

    An error occurred instantiating the object of authentication. Please restart your computer, and they run the Setup again.
    Error number = 2147219705

    Error = description

    ------ END--------

    Appreciate any help

    Thank you

    SJ

    Just for the follow-up of this: I have sent comments, and they responded in 20 minutes with:

    Please contact the Support of the note.  I'm sorry that you are experiencing this error, but it seems by the error message that you install note on a Windows 7 computer.  This error is caused by a Microsoft security update that was released in July 2011 for Windows 7 and caused upward to change our software.  Here is access to our Download Center for you to install the version 8.4 of note.  You will use your current serial number, license key and authentication code.
    They then provided a link to their Download Center where I could download 8.4
    E - mailer to * address email is removed from the privacy * and they will answer you. They have great customer service.
  • How do printerhead cleaning: HP Photosmart C4250 All In One error?

    I have a HP Photosmart C4250 All In One error?  Installed new ink cartridges, seemed to work fine, now

    upper half of the page is nice and dark, but half lower is pale.  How can I run a clean up for this?  Maybe the

    Black print head dry or partially stopped upward.

    Kathy

    Hi Kathy,

    You can run a print head cleaning routine for your computer.  The link below is a document that explains the troubleshooting steps.  You must go to:

    Second step: run the clean print cartridges utility

    http://support.HP.com/us-en/document/c00896992

    Hope this helps at & solves your problem.

  • procedure call to run immediately

    Hi Please help me call the procedure to run immediately.

    I am trying to execute the procedure for several tables.

    the same procedure on the SQL prompt works very well as shown below.

    EXECUTE PROC1 ('BC_COALMINE');

    Start

    for rec in (select table_name

    from all_tables

    where table_name like '% BC_.

    )

    loop

    run immediately 'execute proc1 (rec.table_name);

    end loop;

    end;

    I get an error invalid SQL ORA-900.

    concerning

    EXECUTE is a SQL Plus command. In PL/SQL, you can simply call the procedure. And you need not EXECUTE IMMEDIATE. You can make a static call to the procedure. Like this.

    Start

    for rec in (select table_name

    from all_tables

    where table_name like '% BC_.

    )

    loop

    PROC1 (Rec.table_name);

    end loop;

    end;

  • Error running query database

    I have a web application written in CF8 with Oracle 11 g as primary server. This application has been used very often for over 6 years. Currently, I'm moving to CF10 and you only a small code change CF. When I ran the new application in my test server, everything seems to work fine except when it calls an Oracle Package. This action generates an error: error running database query the strange thing is all work before and after the call to the procedure, I tested using cfabort this Package Oracle still works in the production server (CF8), but not when it is called by CF10. My question is: are there changes for CF10 when you call a procedure? or is there any fix that I don't know? The code is as follows: SELECT box trim (to_char (SYSDATE, 'DAY')) WHEN 'MONDAY' then '1' another '2' end HAVE double TodaysDate

    SELECT Count (other_id) AS NoRecFound FROM gl_dup_ids_ssns WHERE Trim (create_date) =

    SELECT Count (other_id) AS NoRecFound FROM gl_dup_ids_ssns WHERE (create_date) = CF Trim codes to stop the process and email admin

    Error performing query of database appears when it hit to run cfstoredproc. The codes are exactly the same that in CF8, this model has not been changed. Exceptions 14:03:53.053 - database Exception: in /home/space/users/www/GL/glproc.cfm: line 93 runtime error query database.

    I found the answer! In case someone out there also face the same question. In Administrator, Datasource Advance, go down and find: authorized SQL where there are checkboxes for Select, Update, Delete, Insert and one of them is to store the process checkbox. My box was not checked that's why ColdFusion is unable to call a stored procedure. I checked and recorded and I'm good to go.

  • 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.

  • 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.

  • Error running VDR: Trouble reading files, error-3942 (delete Snapshot failed)

    Hello

    I currently have a problem with my VDR backups. as indicated in the title, the error I get is "error running VDR: Trouble reading files, error-3942 (delete Snapshot failed)".

    Background

    We are currently running VMware Vsphere version 4.0.0 on VDR version 1.1.0.707. We have a task of backup running in Vsphere that takes a snapshot of every night of the VM. It is then wrapped on tape for the archive.

    Question

    All of the virtual machine is backup successfully except one. I get the error message is as above: "error running VDR: Trouble reading files, error-3942 (delete Snapshot failed)".

    The backup task completed successfully, and the virtual machine can be restored from a backup. However, the virtual machine always has a snapshot and in addition, the virtual disk to the virtual machine is still attached to the host.

    The current will of this issue that we use is:

    (1) stop the VDR Server

    (2) remove the attached hard disk

    (3) to take a snapshot of the virtual machine

    (4) delete all snapshots.

    I would like to find a solution to the underlying cause, as the current will is tedious and time consuming.

    Another note, the logic unit number that the virtual machine is currently has a block size of 2 MB while all other virtual machines have a block size of 1 MB...

    If you need any additional info, feel free to ask.

    See you soon,.

    http://www.VMware.com/support/VDR/doc/vdr_120_releasenotes.html#upgrade

Maybe you are looking for

  • Intel L440GX + board

    I installed two identical processor (pentium mhz 3 600 l2 512) work in this Council and I get an error 810e processor 1 disabled frb level 3 timer. I followed the instructions give intel (cpu test again), but I still get this error. I flashed the jur

  • Satellite A300 (PSAJ0E) - update after the BIOS, I can't start

    Hello I have an A30, and I tried a bios update to 4.2 which is the latest version for my model. BIOS update went well spent, that it prompted me to restart the laptop once the process is complete, but after this, I was not able to start. I made the s

  • Satellite L500 sound quality is very low

    Bought sucessfully above and upgraded to Windows 7 to XP.However, the sound is terrible - hail. This is applicable to the CD, DVD, and especially when you listen to audio books and it is impossible to listen to the radio. Have tried to change the set

  • Download iTunes 12.3.1 on Windows 7

    Since the new update became available, I get a message asking if I want to download the new version of iTunes.  I always click Yes but the update does not download.  Is it possible to download it from the web and install it?

  • Formatting the HARD drive before doing a clean install.

    I will do a clean install with my windows Visa but first told me to format my hard drive. Is that when you go to computer management > disk management, but then I have no idea what to do? It says Disk 0, and then Compaq and recovery. Laughing out lou