Dynamic query using no PL/SQL. Is this Possible?

Hello world

According can the innery query result, we have a different external query I want to know if it is possible with the PL/SQL.

Example:

It's my inner query:

with q1 as
(select
cases where x > 500 then 0
1 other
end value
Of
Table 1)

This is where I stopped, I want to just run either of these queries according to the value.
I know that I can do using PL/SQL, but I want to know if we can do it with pure SQL

Something like that to happen:
What value = 0: run this query: select * from table2
What value = 1: run this query: select * from table2, table3 join using (col1)

Thank you.

VK

Sure. A bit far from updated him->

satyaki>
satyaki>
satyaki>select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE    10.2.0.3.0      Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production

Elapsed: 00:00:01.82
satyaki>
satyaki>
satyaki>select k.deptno,
  2         k.empno,
  3         k.ename,
  4         k.job,
  5         k.mgr,
  6         k.hiredate,
  7         k.sal,
  8         k.comm,
  9         null dname,
 10         null loc
 11  from emp k
 12  where &eid = 0
 13  union all
 14  select *
 15  from (
 16         select *
 17         from emp
 18         join dept
 19         using (deptno)
 20       )
 21  where &eid = 1;
Enter value for eid: 0
old  12: where &eid = 0
new  12: where 0 = 0
Enter value for eid: 0
old  21: where &eid = 1
new  21: where 0 = 1

    DEPTNO      EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM DNAME          LOC
---------- ---------- ---------- --------- ---------- --------- ---------- ---------- -------------- -------------
        10       9999 SATYAKI    SLS             7698 02-NOV-08      55000       3455
        10       7777 SOURAV     SLS                  14-SEP-08      45000       3400
        30       7521 WARD       SALESMAN        7698 22-FEB-81       1250        500
        20       7566 JONES      MANAGER         7839 02-APR-81       2975
        30       7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400
        30       7698 BLAKE      MANAGER         7839 01-MAY-81       2850
        10       7782 CLARK      MANAGER         7839 09-JUN-81       4450
        20       7788 SCOTT      ANALYST         7566 19-APR-87       3000
        10       7839 KING       PRESIDENT            17-NOV-81       7000
        30       7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0
        20       7876 ADAMS      CLERK           7788 23-MAY-87       1100

    DEPTNO      EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM DNAME          LOC
---------- ---------- ---------- --------- ---------- --------- ---------- ---------- -------------- -------------
        30       7900 JAMES      CLERK           7698 03-DEC-81        950
        20       7902 FORD       ANALYST         7566 03-DEC-81       3000

13 rows selected.

Elapsed: 00:00:00.32
satyaki>/
Enter value for eid: 1
old  12: where &eid = 0
new  12: where 1 = 0
Enter value for eid: 1
old  21: where &eid = 1
new  21: where 1 = 1

    DEPTNO      EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM DNAME          LOC
---------- ---------- ---------- --------- ---------- --------- ---------- ---------- -------------- -------------
        10       9999 SATYAKI    SLS             7698 02-NOV-08      55000       3455 ACCOUNTING     NEW YORK
        10       7777 SOURAV     SLS                  14-SEP-08      45000       3400 ACCOUNTING     NEW YORK
        10       7782 CLARK      MANAGER         7839 09-JUN-81       4450            ACCOUNTING     NEW YORK
        10       7839 KING       PRESIDENT            17-NOV-81       7000            ACCOUNTING     NEW YORK
        20       7566 JONES      MANAGER         7839 02-APR-81       2975            RESEARCH       DALLAS
        20       7876 ADAMS      CLERK           7788 23-MAY-87       1100            RESEARCH       DALLAS
        20       7788 SCOTT      ANALYST         7566 19-APR-87       3000            RESEARCH       DALLAS
        20       7902 FORD       ANALYST         7566 03-DEC-81       3000            RESEARCH       DALLAS
        30       7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0 SALES          CHICAGO
        30       7521 WARD       SALESMAN        7698 22-FEB-81       1250        500 SALES          CHICAGO
        30       7698 BLAKE      MANAGER         7839 01-MAY-81       2850            SALES          CHICAGO

    DEPTNO      EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM DNAME          LOC
---------- ---------- ---------- --------- ---------- --------- ---------- ---------- -------------- -------------
        30       7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400 SALES          CHICAGO
        30       7900 JAMES      CLERK           7698 03-DEC-81        950            SALES          CHICAGO

13 rows selected.

Elapsed: 00:00:00.24
satyaki>

Kind regards.

LOULOU.

Tags: Database

Similar Questions

  • I have 3 devices I want to use Photoshop on.  Is this possible without having to pay for 3 different accounts?

    I have 3 devices I want to use Photoshop on.  Is this possible without having to pay for 3 different accounts?

    Hi career,.

    You can stay connected to creative cloud to two devices at the same time.

    If you want to use on the third device, you must disconnect from one of the other two devices so that you can connect to the third.

    Kind regards

    Claes

  • I'm looking to download only the installers of Dreamweaver and Fireworks CS6 without using creative cloud. Is this possible?

    I'm looking to download only the installers of Dreamweaver and Fireworks CS6 without using creative cloud. Is this possible?

    CS6 - http://helpx.adobe.com/x-productkb/policy-pricing/cs6-product-downloads.html

    You can also download the demo version of the software through the page linked below and then use your current serial number to activate it.

    Don't forget to follow the steps described in the Note: very important Instructions in the section on the pages of this site download and have cookies turned on in your browser, otherwise the download will not work correctly.

    CS6: http://prodesigntools.com/adobe-cs6-direct-download-links.html

  • index of dynamic query uses

    I forgot how to use sql and Oracle dynamic index was linked.

    For example I would like to have the query like this:
    open v_search_results for
       'select * from T1, T2, ..., TN
        where T1.Col1 = ....
              and ...
              and TN.ColM like ....
        ';
    (Please note that I have the query as a string inside the symbols apostrophs.)

    Suggest I index on the columns of the tables T1, T2,..., TN.
    These indices are used if someone now opens the cursor "v_search_results" variable to retrieve these data? Or the engine database ignores indexes in dynamic queries?

    Execution plan will not change between static and dynamic SQL. It's all SQL for oracle. If the CBO decides if the use of the Index is the right thing to do so it will use.

  • BlackBerry 10 Calling of contacts using the phone? Is this possible?

    So, what don't get me?  I use the phone, use the phone contacts icon, select my contacts but I can't understand how to call this contact... the number indicates the contact but I can't find an option to compose...

    I can go to Contacts and select the contact and then select call, but why not in the app phone itself?

    My lamp has done, why not not new/latest smartphone?

    Someone please give me advice on what I'm missing...

    Nevermind... instead of a long press or button, just type... Oh...

  • LJ m1120MFP and MacOS 10.7.3 - How to use the scanner? Is this possible?

    Scanner is not located in the system. Printer works fine. The driver version is 1.3.0.261

    Just to add, the product indeed no longer scan while using Lion, you will find also listed by the document of support for HP below:

    http://h20000.www2.HP.com/bizsupport/TechSupport/document.jsp?&objectID=c02925114#A2

    To work around the problem, try checking any 3rd party scanning solution like Vuescan, that support the scanner.

    It will be useful,

    Shlomi

  • Need help tuninng a dynamic query

    Hello

    We have following question

    Select s.* s bose_sites.registration_crm_serial_number

    R2 bose_sites.registration_crm_serial_number left on join

    s.serialnr = r2.shipserialnr

    where s.shipserialnr is null

    and (r2.serialnr = ' 052378332000138AE' or (s.serialnr =)

    (( "052378332000138AE" and s.shipserialnr is null))

    which takes about 40 seconds to execute with the values highlighted in bold being dynamic values

    If anyone can help reduce the run time on this request.

    There are indexes created on table

    INDEX_NAME INDEX_TYPE

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

    IDX_REG_CRM_SER_NUM_CPC NORMAL

    IDX_REG_CRM_SER_NUM_SHIPDATE NORMAL

    IDX_REG_CRM_SER_NUM_PARENT_ID NORMAL

    IDX_REG_CRM_SER_NUM_ID NORMAL

    is it possible that we can capture a dynamic query using DBMS_SQLTUNE

    all suggestions will be useful.

    Hello

    You have one table here

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

    Schema name: SYS

    SQL ID: cf2875zz4q4nd

    SQL text: select s.* bose_sites.registration_crm_serial_number s

    R2 bose_sites.registration_crm_serial_number left on join

    s.serialnr = r2.shipserialnr

    where s.shipserialnr is null

    and (r2.serialnr = '052378332000138AE' or (s.serialnr =

    S.shipserialnr and "052378332000138AE" is null))

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

    then why don't you go for a simple query

    HTH

  • Sort on dynamic query problem!

    Hello

    I have a dynamic query written in pl/sql, when I check "Sort" for each field in the report attribute, error message resurrected as "ORA-01785: ORDER BY item must include the number of an expression in the SELECT list.
    If I do not check sort, it works very well. In my applications, I need all the fields sorted by user, how do I solve this problem?

    My query as below:

    declare
    Ask varchar2 (2000): = "select";
    s_class varchar2 (1000);
    cursor c1 is select * from demo_preference;
    Start
    for c1_val looping c1
    If c1_val.login is not null then
    query: query = | » ' || 'login ' | ',';
    end if;
    If c1_val.id is not null then
    query: query = | » ' || 'id ' | ',';
    end if;
    .......
    end loop;
    query: = SUBSTR (query, 1, length (query)-1);

    s_class: = ' (NVL (: P2_class, "%" |)) ''null%'') = ''%'' || "zero percent" OR
    EXISTS (SELECT 1 FROM apex_collections WHERE collection_name = "P2CLASSCOL" AND class = c001))';

    query: query = | » ' || ' from ming.reg_report_view1 where '.
    || ' ' || s_class;
    Return (Query);
    end;

    Maybe the internal column used when you clicked the sort is not indicated in the report. Try to use aliases when you build the query string, it might help apex internally to identify a column even if its order is changed to another user. After all, the order of the columns in the code is dynamic and I assume that even the number of displayed columns can vary that could sort on a column that is identified by a number not valid.

    How about somewhere, displaying the report query so that you know what is the exact query processing, it could give you the best information on the problem.

    If the problem persists, use a collection that is extracted these record using the same query string, then replace the report to view the collection and then set the sort column on. This way Summit could get confused about which columns are being sorted and it would just sort on a c001... C050 column as if it were a string (Yes problems with the number of sort columns when you do this).

  • How to map Dynamic Query columns on variables of forms.

    Dear all,
    This is a correct code for executing a dynamic query and display data.
    In this program that I have defined variables ("BOLD" of police) later I binds these with the query (in the second code "BOLD").

    How I can map a column in the query, in which case I don't know that the surveyed fields type?



    GetData PROCEDURE IS
    EXEC_SQL connection_id. PORT;
    cursorID EXEC_SQL. CURSTYPE;
    sqlstr VARCHAR2 (1000);

    loc_ename VARCHAR2 (30);
    loc_eno NUMBER;
    loc_hiredate DATE;

    nIgn PLS_INTEGER;

    BEGIN
    connection_id: = EXEC_SQL. DEFAULT_CONNECTION;
    cursorID: = EXEC_SQL. OPEN_CURSOR (connection_id);
    --
    -assuming empno is a primary key for the table emp, where clause ensures
    -only 0 or 1 row is returned
    --
    sqlstr: = "select ename, empno, hiredate from emp;
    -sqlstr: = sqlstr. 'where empno =' | input_empno;

    EXEC_SQL. PARSE (connection_id, cursorID, sqlstr, exec_sql. V7);
    -EXEC_SQL. Bind_variable (connection_id, cursorID, ': bn', input_empno);

    EXEC_SQL. DEFINE_COLUMN (connection_id, cursorID, 1 loc_ename, 30);
    EXEC_SQL. DEFINE_COLUMN (connection_id, cursorID, 2, loc_eno);
    EXEC_SQL. DEFINE_COLUMN (connection_id, cursorID, 3, loc_hiredate);

    --
    -do execute_and_fetch after the analysis of the statement and calling bind_variable and
    -If necessary define_column
    --

    nIgn: = EXEC_SQL. EXECUTE_AND_FETCH (connection_id, cursorID);
    IF (nIgn = 0) THEN
    TEXT_IO. Put_line ('not Rec');
    ELSE IF (nIgn = 1) THEN
    TEXT_IO. Put_line ('found an employee');

    END IF;
    --
    -get the values of this line
    --
    WHILE (EXEC_SQL. FETCH_ROWS (connection_id, cursorID) > 0) LOOP
    -nRows: = nRows + 1;
    EXEC_SQL. COLUMN_VALUE (connection_id, cursorID, 1, loc_ename);
    EXEC_SQL. COLUMN_VALUE (connection_id, cursorID, 2, loc_eno);
    EXEC_SQL. COLUMN_VALUE (connection_id, cursorID, 3, loc_hiredate);

    MESSAGE(loc_ename||) e '|| loc_eno | » '|| loc_hiredate);

    END LOOP;
    END IF;
    END;

    If you want to use EXEC_SQL and a dynamic query with unknown data types, but the known table name,
    Then you can declare a rowtype variable
    for example;

     NOT TESTED ---A ROUGH IDEA
    m_emp_row employee_master%rowtype;
    m_col_cnt number := 0;
    So when you define collumn, create a procedure to find the column name and its width if it is varchar2 with respect to the column name .
       Find the column details from the user_tab_columns table ...
    ---------------------------------------------------------------------------------------------------------------------------------------------------
      while m_col_cnt < 3 loop
           m_col_cnt  := m_col_cnt +1;
           proc_find_col_name_width(p_qry ,p_col_no=>m_col_cnt , p_col_name,p_col_width);
    
          If p_col_name = 'EMPCODE' then
             EXEC_SQL.DEFINE_COLUMN(connection_id, cursorID, m_col_cnt , m_emp_row.empcode , p_col_width);
          elsif p_col_name ='EMPNAME' then
             EXEC_SQL.DEFINE_COLUMN(connection_id, cursorID, m_col_cnt , m_emp_row.empname , p_col_width);
           -----
            -------
           end if;
      end loop;
    
    ---------------------------------------------------------------------------------------------------------------------------------------------------
    --Your procedure will look like this
     procedure proc_find_col_name_width(p_qry  varchar2,p_col_no number, p_col_name out varchar2,p_col_width out number) is 
    
     m_col_name varchar2(30);
     Cursor c1 is
     Select  data_length
     from user_tab_columns
     where table_name = 'yr_tab_name'
     and column_name = m_col_name;
     m_lastpos number ;
     m_nxtpos number ;
     Begin
      m_lastpos := instr(p_qry,',',1,p_col_no-1);
      m_nxtpos := instr(p_qry,',',1,p_col_no);
      If m_lastpos = 0 then --- if only one col
         m_col_name := substr(p_qry,instr(upper(P_QRY),'SELECT') + 6, instr(upper(P_QRY),'FROM') -1);
      else
           If m_nxtpos = 0 then ---if last column
                 m_nxtpos := instr(upper(P_QRY),'FROM') -1;
           end if;
    
        m_col_name := substr(p_qry,m_lastpos+1,m_nxtpos);
      End if;
      m_col_name := ltrim(rtrim(m_col_name));
      open c1;
      fetch c1 into p_col_width;
      close c1;
      p_col_name := m_col_name;
    END;
    

    same thing you must apply when retrieving values using exec_sql.column_value
    concerning
    Dora

    Published by: Dora on December 7, 2009 12:20

    Published by: Dora on December 7, 2009 12:20

  • Dynamic query with wildcard

    Hello

    I have a table1 as below

    ID (NUMBER), keyword (VARCHAR2)
    ----------------------------------------------------
    1, HAS
    2, B
    3, C

    Another table2

    Name (VARCHAR2)
    --------------------------
    Alice
    Bob
    Jack

    I need to write a stored procedure to check if the 2 mactched of the char keyword table1 table name. How to write the dynamic query in my PL/SQL in a stored procedure so that I can generate query similar to

    SELECT * from table2 where name like '%x %' where I need to replace X by the tank in table1

    Help, please.

    Thanks in advance,
    Marry

    I need to write a stored procedure to check if the 2 mactched of the char keyword table1 table name

    You could simply join the tables:

    SQL> with table1  as
    (
     select 1 id, 'A' keyword from dual union all
     select 2 id, 'B' keyword from dual union all
     select 3 id, 'C' keyword from dual
    ),
    table2 as (
     select 'Alice' name from dual union all
     select 'Bob' name from dual union all
     select 'Jack' name from dual
    )
    --
    --
    select * from table1, table2 where name like '%' || keyword  || '%'
    
            ID KEYWORD NAME
    ---------- ------- -----
             1 A       Alice
             2 B       Bob  
    
    2 rows selected.
    
  • How to display dynamic menu with the parent and the child using c# and sql server

    Hello

    Can you tell me

    What is menu given Dynamics example

    How can u use my dynamic menu added project in c#

    This menu is display with only the data from sql database.

    Menu with the help of a parent node and a child.

    check the element all in sql server and adding one by a dynamic menu.

    Hello

    Thank you for writing to Microsoft Communities.

    I recommend you post your query in the following forum.

    http://social.msdn.Microsoft.com/forums/en/category/SQLServer/

    Hope this information is useful.

  • Using mod pl/sql to create a dynamic form

    We have a backend application that creates questionnaires. The questions for this are created by an administrator and put in a MySQL database. This administrator can use a number of types of possible questions (like OPEN, MULTIPLE and RANGE). These questionnaires are then presented to the outside world using Web services.

    I'm currently building an Apex application that will accomplish this dynamically built form in the frontend.
    For this I used some PL/SQL procedures. A to collect data from Web services and put in temporary tables and another to return the data of these temporary tables using the cursor for loops and dynamically build the form using the htp package.

    It all works very well. Can I open a page of the Apex and it will show me the form with all the fields, as I expect. However, the problem with recording of data entered in this form.
    In the 'old' days when I created something like this using only modPL/SQL, I would have just a procedure with a parameter name_array and value_array to receive all the data. But in this case, when I try to do, I get a 404 error, because my form is between the apex #OPEN_FORM # and #CLOSE_FORM #...

    A brief overview of my code:
    -Page HTML apex with a region of PL/SQL calling the procedure p_get_form ('P1_PARAMETER');
    -p_get form with a call to p_get_webservice_data and the code to generate the form:
    htp.formopen('p_save_form');
    --
    --
    htp.formsubmit;
    htp.formclose;
    -p_save_form with name_array OWA settings. VC_ARR, value_array OWA. VC_ARR

    Can someone help me with this problem?

    Hello

    You should put the code in a process of PL/SQL (using point 'On Submit - after calculations' and Validations process) on the page. I have a full version of this, but he tried here: [http://apex.oracle.com/pls/otn/f?p=16338:3]

    Have you created a branch on your page?

    Andy

  • The value of a menu drop-down can be used in a SQL query?

    I use JDeveloper11g to develop a web application that displays data from a database table. To do this, I created the business of Table (entity) component that represents one of the tables in the database. I then use a component panelCollection to display the data in the tables.

    Assuming that the SQL of this entity is as follows:
    SELECT test.field1 FROM test WHERE test.field2 = :MyVariable
    I can sort the value : MyVariable equal to the value selected by a user of a component of selectOneChoice ?

    http://www.YouTube.com/watch?v=LAWSfO-7xR8

    http://www.YouTube.com/watch?v=VfBG3TcCEmI

  • Dynamic action using the datePicker in APEX5.0

    I want to use dynamic action with dates in APEX 5.0 picker such that after the selection of start_date and end_date interactive report should display data for the selected date range.

    I first created an interactive report in the APEX and then created a page with date elements pickers.ln my database table, I have a column name time_stamp, who is with the date format varchar2 data type YYYY-MM-DD - HH24:MI:SS.

    Looks like my request for interactive report below:

    Select * from table1 where time_stamp between to_char(to_date(:p1_item,'YYYY-MM-DD-HH24:MI:SS'),'DD-MM-YY') and to_char(to_date(:p2_item,'YYYY-MM-DD-HH24:MI:SS'),'DD-MM-YY')

    (where p1_item and p2_item are the page numbers for the selectors of dates), the 'Mask of Format' attribute for the selectors of dates, I put to JJ-MM-AA. Now, I need to define a dynamic action to run my SQL query of interactive report based on the selected start_date and end_date arguments. I need to know more about the steps to create such dynamic action and look for the detailed steps to what attributes must be defined to achieve this.

    Help, please.

    Thank you

    Mukul

    I did notice that the column time_stamp was varchar2. You can use this query:

    select *
      from table1
    where to_date(time_stamp, 'YYYY-MM-DD-HH24:MI:SS') between to_date(:p1_item, 'DD-MM-YY')
      and to_date(:p2_item, 'DD-MM-YY')
    

    And if you remove it your selectors of dates format mask then you could be simpler:

    select *
      from table1
    where to_date(time_stamp, 'YYYY-MM-DD-HH24:MI:SS') between :p1_item
      and :p2_item
    

    You have need of other attributes.

  • Need to check delays in update of 1000 lines using the PL/SQL procedure.

    Hi all

    I'm new to PL/SQL. I need your help to build a procedure that executes the following statement and follows the time of update of 1000 rows. This is to check the performance of the database. I need to print the timestamp of start before the update and end timestamp after update. I need to do for the 1000 lines. The statement that will be used in the procedure is:

    SELECT

    'UPDATE XXAFL_MON_FACTS_F SET TASK_WID =' | NVL (TO_CHAR (TASK_WID), 'NULL') |', EXECUTION_PLAN_WID =' | NVL (TO_CHAR (EXECUTION_PLAN_WID), 'NULL').

    ', DETAILS_WID =' | NVL (TO_CHAR (DETAILS_WID), 'NULL') |', SOURCE_WID =' | NVL (TO_CHAR (SOURCE_WID), 'NULL') |', TARGET_WID = ' | NVL (TO_CHAR (TARGET_WID), 'NULL').

    ', RUN_STATUS_WID =' | NVL (TO_CHAR (RUN_STATUS_WID), 'NULL') |', SEQ_NUM =' | NVL (TO_CHAR (SEQ_NUM), 'NULL') |', NAME = "' | NVL (TO_CHAR (NAME), 'NULL').

    "', NO_POSITION =" ' | NVL (TO_CHAR (INSTANCE_NUM), e ') | " ', INSTANCE_NAME = "' | NVL (TO_CHAR (INSTANCE_NAME), 'NULL').

    "', TYPE_CD =" ' | NVL (TO_CHAR (TYPE_CD), e ') | " ', STATUS_CD = "' | NVL (TO_CHAR (STATUS_CD), e ') | " ', START_TS =' | NVL (TO_CHAR (START_TS), 'NULL').

    ', END_TS =' | NVL (TO_CHAR (END_TS), 'NULL') |', DURATION = ' | NVL (TO_CHAR (DURATION), 'NULL') |', STATUS_DESC = "' | NVL (TO_CHAR (STATUS_DESC), 'NULL').

    "', DBCONN_NAME =" ' | NVL (TO_CHAR (DBCONN_NAME), e ') | " ', SUCESS_ROWS =' | NVL (TO_CHAR (SUCESS_ROWS), 'NULL').

    ', FAILED_ROWS =' | NVL (TO_CHAR (FAILED_ROWS), 'NULL') |', ERROR_CODE = ' | NVL (TO_CHAR (ERROR_CODE), 'NULL') |', NUM_RETRIES =' | NVL (TO_CHAR (NUM_RETRIES), 'NULL').

    ', READ_THRUPUT =' | NVL (TO_CHAR (READ_THRUPUT), 'NULL') |', LAST_UPD = ' | NVL (TO_CHAR (LAST_UPD), 'NULL') |', RUN_STEP_WID = "' | NVL (TO_CHAR (RUN_STEP_WID), 'NULL').

    "', W_INSERT_DT = ' | NVL (TO_CHAR (W_INSERT_DT), 'NULL') |', W_UPDATE_DT = ' | NVL (TO_CHAR (W_UPDATE_DT), 'NULL').

    ', START_DATE_WID =' | NVL (TO_CHAR (START_DATE_WID), 'NULL') |', END_DATE_WID = ' | NVL (TO_CHAR (END_DATE_WID), 'NULL') |', START_TIME =' |

    NVL (TO_CHAR (START_TIME), 'NULL') |', END_TIME =' | NVL (TO_CHAR (END_TIME), 'NULL'). "WHERE INTEGRATION_ID ="' | INTEGRATION_ID | " « ; »  OF XXAFL_MON_FACTS_F;

    The above query creates instructions of update that must be executed 1000 times and the time required to update the 1000 lines should be followed.

    Thanks in advance!

    Code horribly wrong!

    Why this approach?

    Dynamic SQL is almost NEVER needed in PL/SQL. And if you think it's necessary and taking into account what is displayed as being problems here, you have a 99% chance of being wrong.

    This 1% where dynamic SQL is necessary, he will WITH bind variables to create shareable SQL, decrease memory requests, decrease the likelihood of a fragmented shared reel and decrease the burning CPU cycles on hard analysis.

    An example below. Your approach is the 1st. One that is slower than the correct approach to 37 (x_!) ...

    SQL> create table t ( n number );
    
    Table created.
    
    SQL>
    SQL> var ITERATIONS number;
    SQL> exec :ITERATIONS := 100000;
    
    PL/SQL procedure successfully completed.
    
    SQL>
    SQL>
    SQL> TIMING START "INSERTs using Hard Parsing"
    SQL> declare
      2          i      integer;
      3  begin
      4          for i in 1..:ITERATIONS
      5          loop
      6                  execute immediate 'insert into t values ('||i||')';
      7          end loop;
      8          commit;
      9  end;
    10  /
    
    PL/SQL procedure successfully completed.
    
    SQL> TIMING SHOW
    timing for: INSERTs using Hard Parsing
    Elapsed: 00:02:00.33
    SQL>
    SQL> TIMING START "INSERTs using Soft Parsing"
    SQL> declare
      2          i      integer;
      3  begin
      4          for i in 1..:ITERATIONS
      5          loop
      6                  execute immediate 'insert into t values ( :1 )' using i;
      7          end loop;
      8          commit;
      9  end;
    10  /
    
    PL/SQL procedure successfully completed.
    
    SQL> TIMING SHOW
    timing for: INSERTs using Soft Parsing
    Elapsed: 00:00:06.06
    SQL> drop table t;
    
    Table dropped.
    
    SQL> create table t( n number );
    
    Table created.
    
    SQL>
    SQL>
    SQL> TIMING START "INSERTs using a single parse and repeatable statement handle "
    SQL> declare
      2          i      integer;
      3  begin
      4          for i in 1..:ITERATIONS
      5          loop
      6                  insert into t values ( i );
      7          end loop;
      8          commit;
      9  end;
    10  /
    
    PL/SQL procedure successfully completed.
    
    SQL> TIMING SHOW
    timing for: INSERTs using a single parse and repeatable statement handle
    Elapsed: 00:00:04.81
    SQL>
    

Maybe you are looking for

  • Toshiba still WT8 - B do not touch entered task

    HY,I'm doing a clean install on my another 2 at the moment, the operating system is installed, but the touchpad do not work and if I go to the file Explorer, I see that only 24 32 GB are free, it's because I installed the system on the extended parti

  • Where is the button drop-down menu to go back to specific pages while I have read recently?

    After "redevelopment" of Firefox 4, I found that I have in the back or forward buttons, but what happened to the drop-down list that allowed select among recently viewed pages I want to return directly to? So far, I'm ABSOLUTELY not impressed with th

  • Older Version Dowload

    Well Yes, I know, they do not recommend with older versions. problem is that this stupid unified message window new versions 100% useless. as in, no need to download and install. So where can I get a version prior to this idiocy?

  • Express toolkit interrupted - replacement?

    Hello Today, I learned that the Toolkit OR express VI development has reached the end of the live August 15 this year. Probably it will not be sent with the coming versions of LabVIEW. What will replace this kit? Is this the end of screw Express? No

  • Missing links after a Malware attack

    XP Pro, IE8, OE6 My old father-in-law of 94 is suspected of by clicking on a link in an email from "Solutions from PC" he received as bait the reader with 'If you can't read this email, click here', followed by the Pandemonium, then ends by "we can f