The execution of a select statement

I want to run a select statement and show extract it result in table view (multiple records) how do?

Add a button to the form created by my suggestions, create a WHEN-BUTTON-PRESS-trigger for her and the code

GO_BLOCK('MYBLOCK');
EXECUTE_QUERY;

Tags: Oracle Development

Similar Questions

  • How to loop through the results of a select statement in a process flow?

    Hello

    I use Warehouse Builder 10 g R2.

    I'm trying to implement a loop in a process stream that runs through the results of a select statement.

    In pl/sql, it would be implemented as a for loop by using a slider, but I simply doesn't work how to do this using the loops in the process flow.

    Someone at - it ideas?

    Thank you
    Liffey

    Liffey,
    Look at this thread
    For or while loop a loop in the process flow

    Kind regards
    Oleg

  • DDL lock on the object in a SELECT statement?

    Environment:

    Oracle 11.2.0.4 EE on Solaris

    My client called me when she was trying to create a new index on a table and the process was just hanging.  Also, she was not able to DELETE an existing index on the same table, which deal with hang them as well.

    After reviewing the advice DBA_DDL_LOCKS, I found a DDL lock on the target of the index table.

    The DDL lock is held by a process doing a SELECT on the table and this process worked for several hours.

    There was no entry in V$ LOCKED_OBJECTS for the table.

    I don't know, yet, what other operations prior to the SELECT statement in the offending process, I have not heard of the user yet.

    I realize a DDL lock is placed on objects to prevent changes while specific operations are directed against this object, i.e. the DROP, UPDATE, compile the PACKAGE, etc.

    Question: Is a select also place a DDL lock on a table at a level that would avoid a new index is created or an existing index having fallen?

    Thank you very much for your comments!

    Any reference to the resolution is greatly appreciated.

    I searched some Concepts Developers Guide, SQL, even Google reference Guide.

    -gary

    > My question is now, this lock persists for the duration of the running query?

    Easy enough to show that it is not.

    Session1:

    SQL> create table foo(bar number);     
    
    Table created.                         
    
    SQL> insert into foo values(1);       
    
    1 row created.                         
    
    SQL> commit;                           
    
    Commit complete.                       
    
    SQL> variable x refcursor
    SQL> variable a number
    SQL> begin
      2  open :X for select bar from foo;
      3  end;
      4  /                                 
    
    PL/SQL procedure successfully completed.
    

    Session 2:

    SQL> drop table foo;
    
    Table dropped.     
    

    Note that I was able to remove the table even if select is still 'in progress' - the cursor is open.

    If you really want to blow your mind, go back to the session 1:

    SQL> begin
      2  fetch :X into :a;
      3  end;
      4  /                                
    
    PL/SQL procedure successfully completed.
    
    SQL> print a                          
    
             A
    ----------
             1       
    

    The picture has gone, but I can always look for him. However, try again:

    SQL> /
    begin
    *
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-00942: table or view does not exist          
    

    Note that the forum software is stupid. is: followed by x. seems it's really important to have a smiley to lovey eyes in a technical forum.

    Edit - and when you format the SQL code, it is removed completely and render invisible... silly.

    I edited my code to use: X and the problem disappeared...

  • normalize the schema of the table in a select statement (without view)

    Hello

    I have a table storing a physical value, mean temperature for different locations every minute. The table schema is as following: timestamp (datetime), rental (string), value (number).

    Do you know a way to have a select statement, return of lines with the following data: timestamp, the value at location1, value of place.2 guests, etc.

    This will help me to create time series in he same diagram in my reporting tool.

    This may be possible with a view, but I don't have access to the database, the best I can do is set my a data source such as a select statement.

    Thank you!

    Brahim

    PS. We use Oracle 10 g R2

    Hello

    8e07ad81-CDAE-4c23-b0fb-b6cd117cf5bc wrote:

    Hello

    I have a table storing a physical value, mean temperature for different locations every minute. The table schema is as following: timestamp (datetime), rental (string), value (number).

    Do you know a way to have a select statement, return of lines with the following data: timestamp, the value at location1, value of place.2 guests, etc.

    This will help me to create time series in he same diagram in my reporting tool.

    This may be possible with a view, but I don't have access to the database, the best I can do is set my a data source such as a select statement.

    Thank you!

    Brahim

    PS. We use Oracle 10 g R2

    What you're asking about is called pivoting.  The ahs Forum FAQ page devoted to this topic: Re: 4. How can I convert rows to columns?

    Since you're using Oracle 10, you cannot use the SELECT... Function PIVOT; You can use GROUP BY and CASE instead.

    Do ' t worry not about creating views.  What you can do with views, you can also do it using a WITH clause in your query.

    If you get stuck, please post some sample data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also to publish the results you want from this data, as well as your best attempt to query a specific question.

    Explain, using specific examples, how you get the results desired from data provided.

    See the FAQ forum: Re: 2. How can I ask a question on the forums?

  • can I get an exact part of the data in a select statement

    Hi... good afternoon...

    I want to extract the records from a table by the select statement. but I don't want to go as it's the folder. I want to go look for a particular part of the eacg folder in this column.

    for example...

    table_name = tab1
    column_name = col1

    the col1 contains datas as * 'customer research-cs', 'get client-gc', 'customer delete-cd' * etc etc...

    now, while writing the select query, I want to get the descriptive result as get the customer, customer, customer search remove... .that is I don't want the symbols...

    is it possible to achieve this?

    PLSS suggest...

    You mean like these ways to do...

    SQL> ed
    Wrote file afiedt.buf
    
      1* select substr('customer search-cs',1,length('customer search-cs')-3) from dual
    SQL> /
    
    SUBSTR('CUSTOME
    ---------------
    customer search
    
    SQL> ed
    Wrote file afiedt.buf
    
      1* select regexp_substr('customer search-cs','^[^-]*') from dual
    SQL> /
    
    REGEXP_SUBSTR('
    ---------------
    customer search
    
    SQL>
    
  • can we write the function in a select statement?

    I have function and there Out parameter, so in this case I can write a select statement to my function to retrieve the value?

    user11195165 wrote:
    I have function and there Out parameter, so in this case I can write a select statement to my function to retrieve the value?

    Never mind that it's bad! for a function to have an OUT parameter. That's not how the functions should be designed and written.

    It's like with a knife like a spoon to eat porridge. Of course, it can work in a way. But why? A knife was never designed to be a spoon - and while it may work of porridge to eat, you'll have a hell of a time trying to use it to eat the soup. So, use the right tool.

    In other words, a function is the wrong tool for the job. Use a procedure.

  • How to add an imaginary line in the result of the value of a SELECT statement.

    Hello all-

    I have requirment to add an imaginary line in the result set of a SELECT statement.

    For example lets say it is a pay table having the following columns:

    Number of Payment_id
    status varchar2 (10)
    number amount
    date of payment_date

    so here's the data: -.

    Payment_id status amount payment_date
    applied 1 100 12/07/2008
    2 Reversed 200 01 / 06/2009
    Applied 3 300 01 / 07/2009


    Here is my SQL

    Select * form payment where payment_date > = 01/01/2009

    The output will be

    2 Reversed 200 01 / 06/2009
    Applied 3 300 01 / 07/2009

    My desired output is less than

    2 Reversed 200 01 / 06/2009
    Applied 3 300 01 / 07/2009
    reversed-200 2, 01 / 06/2009-(Dummy Row)

    Third line here is the imaginary line that I add when the status is "reversed".

    I would be very grateful for any help on this...

    Thank you
    Gerard

    Cartesion join against a shadow table is a useful method to create a fictitious line:

    with my_tab as (select 1 cust_id, 1 Payment_id, 'Applied' Status, 100 Amount, to_date('12/07/2008', 'mm/dd/yyyy') payment_date from dual union all
                    select 1 cust_id, 2 Payment_id, 'Reversed' Status, 200 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
                    select 1 cust_id, 3 Payment_id, 'Applied' Status, 300 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
                    select 2 cust_id, 1 Payment_id, 'Applied' Status, 100 Amount, to_date('12/07/2008', 'mm/dd/yyyy') payment_date from dual union all
                    select 2 cust_id, 2 Payment_id, 'Reversed' Status, 200 Amount, to_date('01/05/2009', 'mm/dd/yyyy') payment_date from dual union all
                    select 2 cust_id, 3 Payment_id, 'Applied' Status, 300 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
                    select 2 cust_id, 4 Payment_id, 'Reversed' Status, -400 Amount, to_date('01/06/2009', 'mm/dd/yyyy') payment_date from dual union all
                    select 2 cust_id, 5 Payment_id, 'Applied' Status, 500 Amount, to_date('01/07/2009', 'mm/dd/yyyy') payment_date from dual),
                    --- end of mimicking your table
          dummy as (select 'Reversed' col1, 1 rn from dual union all
                    select 'Reversed' col1, 2 rn from dual)
    select mt.cust_id,
           mt.payment_id,
           mt.status,
           decode(dummy.rn, 2, -1*mt.amount, mt.amount) amount,
           mt.payment_date
    from   my_tab mt,
           dummy
    where  mt.status = dummy.col1 (+)
    order by mt.cust_id, mt.payment_id, dummy.rn nulls first;
    
    CUST_ID     PAYMENT_ID     STATUS     AMOUNT     PAYMENT_DATE
    1     1     Applied     100     07/12/2008
    1     2     Reversed     200     06/01/2009
    1     2     Reversed     -200     06/01/2009
    1     3     Applied     300     06/01/2009
    2     1     Applied     100     07/12/2008
    2     2     Reversed     200     05/01/2009
    2     2     Reversed     -200     05/01/2009
    2     3     Applied     300     06/01/2009
    2     4     Reversed     -400     06/01/2009
    2     4     Reversed     400     06/01/2009
    2     5     Applied     500     07/01/2009
    

    Published by: Boneist on January 7, 2009 23:10
    NB. You may need to mess around with the order if that is not in the order you want. You did not mention what the rules were for all orders expected, so I composed my own * {;-)

    Also, I added a (cust_id) identifier to differentiate different types of payments, as is usually the case. Remove unless it is not applicable to your case.

  • the combination of two select statements to increase the maintainability and performance

    Hi SQL Experts,

    I use the Version of Oracle 11g DB and got both of the statements below.

    My mind can´t get his head around it how and if these two can be combined.

    They look like they could, but I can't figure out how... and I don't mean with a UNION ALL operation

    My main goal is a gain in performance and maintainability.

    SELECT *.

    OF T_TEMP_42 T1 WHERE T1. MATRIX_2 IS NULL AND

    (T1. BL_CODE | T1. YASSINE | T1. MATRIX_1 | T1. FIRMTYPE)

    PO NO

    (

    SELECT BL_CODE. YASSINE | MATRIX_1 | FIRMTYPE

    OF T_TEMP_41, WHERE MATRIX_2 IS NULL).

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

    SELECT *.

    OF T_TEMP_42 T1 WHERE T1. MATRIX_2 IS NOT NULL AND

    (T1. BL_CODE | T1. YASSINE | T1. MATRIX_1 | T1. MATRIX_2 | T1. FIRMTYPE)

    PO NO

    (

    SELECT BL_CODE. YASSINE | MATRIX_1 | MATRIX_2 | FIRMTYPE

    OF T_TEMP_41, WHERE MATRIX_2 IS NOT NULL

    );

    Thanks for your suggestions.

    Try this

    SELECT *.

    OF T_TEMP_42 T1

    WHERE (BL_CODE, YASSINE, MATRIX_1, FIRMTYPE, MATRIX_2) NOT IN (SELECT BL_CODE, YASSINE, MATRIX_1, FIRMTYPE, T_TEMP_41 MATRIX_2)

    It came off really simple... maybe too simple

  • How to pass the number object type to bind the variable in a select statement

    Hello

    I have a scenario like,

    UI, we store the values in the type of object, and this object type must be spent in a select query to retrieve the data accordingly.

    Is it possible to do so.

    If this isn't the case, please let me know how to take the values of object type and pass to the select query.

    Kind regards

    I found it,

    Object_name ('parameters1', 'parameter2');

  • Function that returns the results of a select statement

    Hello

    I would like to create a feature on the famous HR Departments oracle table to select * from him. I don't know how to do it.

    Is someone can help me?.

    Thank you

    Oracle stored functions cannot return result sets directly but can return the REF CURSOR. Please read [optimize result set retrieval using ODP.NET and Ref Cursor | http://www.oracle.com/technology/pub/articles/mastering_dotnet_oracle/williams_refcursors.html] which gives complete examples in PL/SQL for the side Server and VB. NET client side.

  • Performance in the select statement

    Hi all

    (select a.siteid, siteid, a.bpaadd_0 bpaadd_0, a.bpanum_0 bpanum_0,
    -case when a.bpaaddlig_0 = "then '-' another end a.bpaaddlig_0

    Address1,
    -case when a.bpaaddlig_1 = "then '-' another end a.bpaaddlig_1

    address2,
    -case when a.bpaaddlig_2 = "then '-' another end a.bpaaddlig_2

    Address3,
    cases where a.bpades_0 = "then '-' other place of end of a.bpades_0,.
    -case when a.cty_0 = "then '-' end of a.cty_0 to another city.
    -case when a.poscod_0 = "then '-' another end a.poscod_0

    PIN code
    -case when b.cntnam_0 = "then '-' another end b.cntnam_0

    ContactName,
    -case when b.fax_0 = "then '-' another fax machine to end b.fax_0.
    -case when b.MOBTEL_0 = "then '-' b.MOBTEL_0 other mobile end.
    -case when b.TEL_0 = "then '-' phone on the other end b.TEL_0.
    -case when b.web_0 = "then '-' other end b.web_0 site.
    c.zinvcty_0 zcity, c.bpainv_0 bpainv_0, c.bpcnum_0 bpcnum_0
    of lbcreport.bpaddress@info a,lbcreport.contact@info b

    c lbcreport.bpcustomer@info
    where (a.bpanum_0 = b.bpanum_0) and (a.cty_0 = c.zinvcty_0) and

    (a.SiteId = c.SiteId))

    In the above query, is there any degradation of performance could I continue with the same query
    or there is any other solution to speed up the query.
    in a select statement these many cases are allowed ah?

    Please could someone help me in this?
    Thanks in advance
    Good bye
    Sonny_starck

    Change that question you as follows...

    (select
         a.siteid siteid,
         a.bpaadd_0 bpaadd_0,
         a.bpanum_0 bpanum_0,
         nvl(a.bpaaddlig_0, '-') address1,
         nvl(a.bpaaddlig_1,'-' ) address2,
         nvl(a.bpaaddlig_2,'-' )  address3,
         nvl(a.bpades_0,'-' ) place,
         nvl(a.cty_0,'-' ) city,
         nvl(a.poscod_0,'-' ) pincode,
         nvl(b.cntnam_0,'-' ) end
         contactname,
         nvl(b.fax_0,'-' )  fax,
         nvl(b.MOBTEL_0,'-' )  mobile,
         nvl(b.TEL_0,'-' )  phone,
         nvl(b.web_0,'-' )  website,
         c.zinvcty_0 zcity,c.bpainv_0 bpainv_0,c.bpcnum_0 bpcnum_0
    from
         lbcreport.bpaddress@info a,
         lbcreport.contact@info b,
         lbcreport.bpcustomer@info c
    where
         (a.bpanum_0=b.bpanum_0) and
         (a.cty_0 = c.zinvcty_0) and
         (a.siteid = c.siteid))
    / 
    

    For performace check... also the post of BluShadow query execution plan

    Concerning
    Singh

  • How to store select statements in a procedure and use it as a parameter

    I need to enter below the select statements in a stored procedure with an input parameter, business_dt_num. This parameter must be the result under the statement select and placed inside the procedure...
    select max(business_dt_num)
    from invent.dp_ca 
    If a select statement fails he must get out of the execution of the procedure and is not engaged in the next select statement. How can I cancel the execution of the procedure, if a select statement fails?
    select max(business_dt_num)
    from invent.dp_ca 
    /
    Select count (1)
    of invent.dp_ca
    where BUSINESS_DT_NUM = YYYYMMDD
    and product_id! = 0 ;
    -above and below sql account must match
    Select count (1)
    invent.dp_ca d, e invent.dp_ca_proof
    where d.BUSINESS_DT_NUM = YYYYMMDD
    and d.KEY_ID = e.KEY_ID;
    /
    exec pk_proof.pr_PopulateTaggingWorkTable_CA (yyyymmdd);
    /
    SELECT count (distinct univ_key_id) of invent.dp_ca_proof
    where business_dt_num = YYYYMMDD and proof_status! = « A » ;
    -above and below sql account must match
    Select count (0) in the invent.dp_ca_work where business_dt_num = YYYYMMDD.
    Thanks,
    Steve
    
    Edited by: steve2312 on Dec 22, 2011 12:32 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    declare
       dp_ca_count1 number;
       dp_ca_count2 number;
    begin
       select count(1) into dp_ca_count1
       from invent.dp_ca
       where BUSINESS_DT_NUM = trunc(sysdate)
       and product_id != 0;
    
       select count(1) into dp_ca_count2
       from invent.dp_ca d, invent.dp_ca_proof e
       where d.BUSINESS_DT_NUM = trunc(sysdate)
       and d.KEY_ID = e.KEY_ID;
    
       if dp_ca_count1 != dp_ca_count2 then
               raise_application_error (-20001, 'Counts do not match.');
       end if;
    end;
    /
    
  • The execution plan changes for the same query.

    Hi all

    This issue was raised before also, but still not able to find the real cause of this.

    Thread1:
    Re: Research of fragmentation of the table in Oracle 8.1.6.3.0

    Thread2:
    CBC latch and buffer busy await you on the same table.

    It comes, sometimes hammers server 100% CPU utilization with free latch and buffer busy wait events.

    We found a single query consumes high CPU usage that is run by different sessions.

    This query have two types of execution plans, where one is accurate and is not (its primary key hit index index no appropriate means present on the table)

    Because its primary key index hit repeatedly at various sessions, some sessions are powerful db file sequential read and a few sessions waiting buffer busy waits for event. Also during this time a few sessions waiting for latch free event.

    My doubt is how to sql even with different literal values execution plan changes and causes a prob.
    select count(*),event from v$session_wait group by event;
      COUNT(*) EVENT
    ---------- ----------------------------------------------------------------
           165 SQL*Net message from client
             1 SQL*Net message to client
             3 buffer busy waits
             2 db file parallel read
            18 db file sequential read
            10 latch free
             5 log file sync
             1 pmon timer
             6 rdbms ipc message
             1 smon timer
    
    SQL> select sid from v$session_wait where event='db file sequential read';
           SID
    ----------
            26
            58
            82
           107
           116
           223
           212
           203
           192
           173
           161
           157
           150
           147
           254
           238
           229
           112
           101
            81
            68
    
    SQL> select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID;
    Enter value for sid: 161
    old   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID
    new   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=161
    
    SPID             SID    SERIAL# PROGRAM
    --------- ---------- ---------- ------------------------------------------------
    4231             161      49569 oracle@tfrdb3 (TNS V1-V3)
    
    
    SQL> select sql_text
    from v$process a,
         v$session b,  2    3
         v$sql c
    where a.addr = b.paddr and
         b.sql_hash_value = c.hash_value and
        a.spid = &PID;  4    5    6    7
    Enter value for pid: 4231
    old   7:     a.spid = &PID
    new   7:     a.spid = 4231
    
    SQL_TEXT
    --------------------------------------------------------------------------------
    SELECT ERROR,TIME_STAMP,O_RESOURCE,QUEUE,NEW_QUEUE FROM LOG WHERE ID = '09292AMR
    10B41FE' AND TYPE IN (11, 28, 25, 18, 60, 13) AND (LOG_SEQ>'234225222' OR TYPE =
     18 AND LOG_SEQ='234225222') ORDER BY TIME_STAMP ASC
    
    SQL> set autotrace traceonly exp
    SQL> SELECT ERROR,TIME_STAMP,O_RESOURCE,QUEUE,NEW_QUEUE FROM amrwf1.LOG WHERE ID = '09292AMR10B41FE' AND TYPE IN (11, 28, 25, 18, 60, 13) AND (LOG_SEQ>'234225222' OR TYPE =18 AND LOG_SEQ='234225222') ORDER BY TIME_STAMP ASC;
    
    Execution Plan
    ----------------------------------------------------------
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=11 Card=2 Bytes=126)
       1    0   SORT (ORDER BY) (Cost=11 Card=2 Bytes=126)
       2    1     CONCATENATION
       3    2       TABLE ACCESS (BY INDEX ROWID) OF 'LOG' (Cost=4 Card=1
              Bytes=63)
    
       4    3         INDEX (UNIQUE SCAN) OF 'PK_LOG_LOG_SEQ' (UNIQUE) (Co
              st=3 Card=1)
    
       5    2       TABLE ACCESS (BY INDEX ROWID) OF 'LOG' (Cost=4 Card=1
              Bytes=63)
    
       6    5         INDEX (RANGE SCAN) OF 'PK_LOG_LOG_SEQ' (UNIQUE) (Cos
              t=3 Card=1)
    
    
    SQL> select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID;
    Enter value for sid: 147
    old   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID
    new   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=147
    
    SPID             SID    SERIAL# PROGRAM
    --------- ---------- ---------- ------------------------------------------------
    6255             147      38306 oracle@tfrdb3 (TNS V1-V3)
    
    SQL> select sql_text
    from v$process a,
         v$session b,
         v$sql c  2    3
    where a.addr = b.paddr and
         b.sql_hash_value = c.hash_value and
        a.spid = &PID;  4    5    6    7
    Enter value for pid: 6255
    old   7:     a.spid = &PID
    new   7:     a.spid = 6255
    
    SQL_TEXT
    --------------------------------------------------------------------------------
    SELECT ERROR,TIME_STAMP,O_RESOURCE,QUEUE,NEW_QUEUE FROM LOG WHERE ID = '09273AMR
    62B4894' AND TYPE IN (11, 28, 25, 18, 60, 13) AND (LOG_SEQ>'223324996' OR TYPE =
     18 AND LOG_SEQ='223324996') ORDER BY TIME_STAMP ASC
    
    
    SQL> set autotrace traceonly exp
    SQL> SELECT ERROR,TIME_STAMP,O_RESOURCE,QUEUE,NEW_QUEUE FROM amrwf1.LOG WHERE ID = '09273AMR62B4894' AND TYPE IN (11, 28, 25, 18, 60, 13) AND (LOG_SEQ>'223324996' OR TYPE =18 AND LOG_SEQ='223324996') ORDER BY TIME_STAMP ASC;
    
    Execution Plan
    ----------------------------------------------------------
       0      SELECT STATEMENT Optimizer=CHOOSE (Cost=1538 Card=736 Bytes=
              46368)
    
       1    0   SORT (ORDER BY) (Cost=1538 Card=736 Bytes=46368)
       2    1     TABLE ACCESS (BY INDEX ROWID) OF 'LOG' (Cost=1527 Card=7
              36 Bytes=46368)
    
       3    2       INDEX (RANGE SCAN) OF 'LOG_ID' (NON-UNIQUE) (Cost=32 C
              ard=736)
    
    
    
    SQL> select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID;
    Enter value for sid: 82
    old   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=&SID
    new   1: select spid, sid, s.serial#, p.program from v$session s, v$process p where paddr=addr and sid=82
    
    SPID             SID    SERIAL# PROGRAM
    --------- ---------- ---------- ------------------------------------------------
    6172              82      45378 oracle@tfrdb3 (TNS V1-V3)
    
    
    SQL> select sql_text
    from v$process a,
         v$session b,
         v$sql c
    where a.addr = b.paddr and
         b.sql_hash_value = c.hash_value and  2
      3      a.spid = &PID;  4    5    6    7
    Enter value for pid: 6172
    old   7:     a.spid = &PID
    new   7:     a.spid = 6172
    
    SQL_TEXT
    --------------------------------------------------------------------------------
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    SQL_TEXT
    --------------------------------------------------------------------------------
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    
    SQL_TEXT
    --------------------------------------------------------------------------------
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    
    INSERT INTO LOG (ID,TIME_STAMP,TYPE,ERROR,INSTANCE,RULE_NUM,RULE_TYPE,PRIORITY,F
    LAGS,NAME,BATCH,O_RESOURCE,QUEUE,NEW_QUEUE,SERVER,FORM,WORKSET) VALUES (:V001,:V
    002,11,0,0,3,1,0,1,:V003,:V004,:V005,:V006,:V007,:V008,:V009,:V010)
    How to avoid this... why its different execution plan using (I mean bad index PK)

    Is it possible to avoid this?

    If any details please check out some of my previous post on this specific URL (above)

    -Yasser

    My doubt is how to sql even with different literal values execution plan changes and causes a prob.

    Different literal values cause analysis difficult.
    Hard analysis includes the re-evaluation of the best path.
    Literal value is included in the assessment of the selectivity for the scan interval (log_seq >...)

    See
    http://www.centrexcc.com/A%20Look%20under%20The%20Hood%20Of%20CBO%20-%20The%2010053%20Event.ppt.PDF
    http://www.centrexcc.com/fallacies%20Of%20The%20Cost%20Based%20Optimizer.PDF
    more the book of Jonathan Lewis which other threads, I believe that you already have.

    You must lower your CPU.
    Previous discussions, if the situation is still the same, it sounded like hard analysis particularly with this SELECTION against the NEWSPAPER plays an important role in that.

    How to avoid this... why its different execution plan using (I mean bad index PK)

    The points raised in the previous discussion remain valid.
    -Do you have access to this SQL to change?
    for example using bind variable or trick it if necessary due to problems caused by data as discussed in the previous thread.
    - Or you could it repoint the view to a view and a hint?
    -If a particular user makes this sql, could affect you cursor_sharing just for this user. If not, you should consider implementing pan-Canadian database.

    Oracle 8.1.6 still?

  • Sense of the GOAL: < text > in the execution plan

    Hello

    Could you please help me understand the following in the execution plan (Oracle10gR2)?
    ++++++++++++++
    GOAL: HINT
    OBJECTIVE: ANALYZE
    ++++++++++++++

    For example, the following plan:
    Rows     Execution Plan
    -------  ---------------------------------------------------
          0  SELECT STATEMENT   GOAL: HINT: FIRST_ROWS
        301   HASH JOIN
        200    TABLE ACCESS   GOAL: ANALYZED (FULL) OF 'EP1'
        303    NESTED LOOPS
        304     TABLE ACCESS   GOAL: ANALYZED (BY INDEX ROWID) OF 'EP3'
        304      BITMAP CONVERSION (TO ROWIDS)
          2       BITMAP OR
          2        BITMAP INDEX (SINGLE VALUE) OF 'EP3_BI1'
          2        BITMAP INDEX (SINGLE VALUE) OF 'EP3_BI2'
        303     TABLE ACCESS   GOAL: ANALYZED (BY INDEX ROWID) OF 'EP2'
        606      INDEX   GOAL: ANALYZED (UNIQUE SCAN) OF 'EP2_PK' (UNIQUE)
    My question is: what do I do ' GOAL: HINT ' and ' GOAL: ANALYSIS "means? Not specifically for the plan above, just a question about how they mean when they show up in the plan of execution like the one above.

    Thank you!

    Published by: shape on May 6, 2009 10:52

    Published by: shape on May 6, 2009 10:54

    Published by: shape on May 6, 2009 10:58

    New: your exit is whence?
    And I wonder too much about the word 'OBJECTIVE', the previous words and then the words are much more interest.

    GOAL: TIP: FIRST_ROWS<-- optimizer="" decided="" to="" use="" first_rows="">
    301 HASH JOIN
    TABLE 200 ACCESS OBJECTIVE: ANALYZED (FULL)<-- optimizer="" decided="" to="" go="" for="" a="" full="" table="" scan="" based="" on="" provided="" table="" stats="" ('analyzed'="" means:="" stats="" are="" available="" for="">
    303 NESTED LOOPS
    304 TABLE ACCESS OBJECTIVE: ANALYSIS (BY INDEX ROWID)<-- optimizer="" decides="" to="" go="" for="" an="" index="" scan="" here="" based="" on="" provided="" table="" stats="" ('analyzed'="" means:="" stats="" are="" available="" for="">

  • Error PLS-00428: an INTO clause in this SELECT statement

    Dear Experts,

    I'm new to PL/SQL programming

    I try to run the following query, I get the error message.

    Please help me solve the error.

    declare

    var_cd number (20);

    Start

    If: P1_TYP_CAT is not null then

    SELECT max (CAT_cd + 1) as var_cd from IM_AST_CAT by CAT_cd;

    insert into IM_AST_CAT (CAT_NM, CAT_CD) values ((upper (:P1_TYP_CAT)),(:var_cd));

    on the other

    RAISE_APPLICATION_ERROR ('-20001,' both Department and location must be provided ");

    end if;

    end;

    In PL/SQL, must be used IN the clause when using SELECT statements.

    SELECT max (CAT_cd + 1) as var_cd

    in variable - it is missing in your code

    from IM_AST_CAT by CAT_cd;

    Your code should be

    declare

    var_cd number (20);

    Start

    If: P1_TYP_CAT is not null then

    SELECT max (CAT_cd + 1).
        in var_cd
    of IM_AST_CAT
    order of CAT_cd;

    insert into IM_AST_CAT (CAT_NM, CAT_CD) values (upper(:P1_TYP_CAT), var_cd);

    on the other

    RAISE_APPLICATION_ERROR ('-20001,' both Department and location must be provided ");

    end if;

    end;

    For example:

    DECLARE

    l_first_name varchar2 (100);

    BEGIN

    Select first_name

    in l_first_name

    employees

    where employee_id = 100;

    END;

    Post edited by: Suri

Maybe you are looking for

  • What values can I change to increase the speed of mouse wheel?

    It seems that there are a couple of entries that you can change to increase the scrolling speed: -mousewheel.default.delta_multiplier_y -general.smoothScroll.mouseWheel.durationMaxMS -mousewheel.enable_pixel_scrolling -mousewheel.min_line_scroll_amou

  • Re: Satellite A300 (PSAGCA-09W01N) - how to upgrade the BIOS?

    I have a problem and the only solution that I have to try is updating the BIOS. Could someone please tell me how? Cheers, Levi

  • Plug the motherboard?

    I'm trying to find the specifications for a replacement motherboard. The advice I want to put in my T400 is FRU 63Y1189 I wonder if this Council would support a fingerprint reader.

  • procblem typo

    as you can see I'm getting the problem I type C she print CN AND N WHEN IT TYPE CN certain TIME SHIFT CALCULATOR POP UP. HOW CAN I SOLVE IT. PLAESE HELP

  • How can I activate my fingerprint reader?

    * Original title: fingerprints How can I activate my fingerprint reader? I have a Dell laptop. Latitude E4310 help much appreciated