FOR UPDATE query issue

SELECT table_name FROM all_tables WHERE dropped = 'NO' and owner = 'test'
FOR UPDATE;
ERROR at line 1:
ORA-02030: can only select from fixed tables/views
ORA-06512: at line 9
ORA-06512: at line 16
Can any body help me out what is wrong in that query.
Thanx

SELECT table_name FROM all_tables WHERE dropped = 'NO' and owner = 'test'
FOR UPDATE;What do you want to achieve from this?? Do you want to update the all_tables ?? :-)

Similar Messages

  • For Update Query

    Hi All,
    I having block level 8000 records, I Scroll down from First record to last record it is takeing more time.
    I Observed tkproof while scrolling two select statments are running..
    1) pre-query block level
    2) For update query
    For update query -> How is is forming? Any Property or some else?
    I am not able to find the second query..where it is forming..How to restrict the second query.
    Query Array size - 10
    Number of records buffered - 10
    Number of records Displayed - 10
    Query all records - No
    Locking mode - Immediate
    Key mode - Automatic
    Version - Oracle 10g
    Plz ........any

    The for update -query is generaetd by forms when its locking the record. If you didn't change anything in the record "by hand", check if there is some code in the POST-QUERY-trigger which forces the record to be locked. if its the POST-QUERY you can issue the following command to avoid the lock at the end of the POST-QUERY:
    SET_RECORD_PROPERTY(:SYSTEM.TRIGGER_BLOCK, :SYSTEM.TRIGGER_RECORD, STATUS, QUERY_STATUS);

  • For Update Query with Wait Clause from ORACLE Forms

    Hi
    We are using Oracle Forms 10g running with 10g database 10.2.0.1.0. We happend to see a query which is getting generated in AWR report like Select rowid, all_columns from TableName for Update of C1 Nowait. But no such query is really written in forms and we are aware that, Any query prefixed with rowid is definitely executing from Forms. But how the ForUpdate and Nowait clause is appended to the query.
    We have checked the following properties in the database Block
    *1) Locking Mode is set to Automatic*
    *2) Update Changed Columns only is set to YES*
    *3) Query all records is set to No (Though this particular property may not be relevant to the issue)*
    What is the property or setting which might trigger such a query from ORACLE Forms with ForUpdate and Nowait clause.
    Any ideas/suggestions on why such behaviour. Please have a healthy discussion on this. Thanks in advance.

    Why have you started another thread on the same thing?
    FOR UPDATE cursor is causing Blocking/ Dead Locking issues
    Just use one thread to avoid confusion.
    The fact that nobody has answered on the other thread for a couple of days could be to do with it being the weekend and most people are not at work.
    Either be patient or, if it's more "urgent" than that, raise a SR/Tar with Oracle metalink.

  • For Update Query from ORACLE Forms

    Hi
    We are using Oracle Forms 10g running with 10g database 10.2.0.1.0. We happend to see a query which is getting generated in AWR report like Select rowid, all_columns from TableName for Update of C1 Nowait. But no such query is really written in forms and we are aware that, Any query prefixed with rowid is definitely executing from Forms. But how the ForUpdate and Nowait clause is appended to the query.
    We have checked the following properties in the database Block
    *1) Locking Mode is set to Automatic*
    *2) Update Changed Columns only is set to YES*
    *3) Query all records is set to No (Though this particular property may not be relevant to the issue)*
    What is the property or setting which might trigger such a query from ORACLE Forms with ForUpdate and Nowait clause.
    Any ideas/suggestions on why such behaviour. Please have a healthy discussion on this. Thanks in advance.

    you can't dynamically add a query to the data model in reports.
    You should look into the XML based customization of Oracle Reports. This will enable you to define a report dynamically by creating a definition in XML.
    Also another option is to have the report with a query in it and use lexical parameters in reports to pass the query definition or just the where part of it.
    Look at the reports online help for both of these solutions.

  • Update query issue to update middle (n records) of the rows in a table

    Hi
    I have a below requirement for that I gone thru one below appoch to fulfill my requirement.
    Requirement:
    I need to pull 3 crore data thru ODI, source table does not have a primary key and it have 200 columns with 3 crores records (it has a 25 columns as composite key).
    I need to populate those 3 crores records into target oracle DB but when I tried to load 3 crores at time I got an error so I approch incremental load, since for that I need to update for each 1 crore records with flg1,flg2 anf flg3 (flag values), for this update I have added one more column in source table using those flag values I can populate 1 crore records in target machine.
    Approch
    For aove requirement I writem below query to update flg1 for first crores records update tbl_name set rownum_id='flg1' where rownum<=10000000; and it updated successfully without any error, for second, to update flg2 for 2nd crore records I wrote below update query and it execute 20min and given *0 rows updated* Please help if below query is wrong
    Query: update tbl_name set rownum_id='flg2' where rownum<=20000000 and rownum_id is NULL;
    Thanks in advance
    Regards,
    Phanikanth

    A couple of thoughts.
    1. This forum is in English and accessed by people in more than 100 countries. Use metric counts not crore. Translate to million, billions, trillions, etc.
    2. No database version ... makes helping you very hard.
    3. 200 columns with 25 in a composite key is a nightmare by almost any definition ... fix your design before going any further.
    4. What error message? Post the complete message not just your impression of it.
    5. Oracle tables are heap tables .. there is no such concept as the top, the bottom, or the middle.
    6. If you are trying to perform sampling ... use the SAMPLE clause (http://www.morganslibrary.org/reference/select.html#sssc).
    7. What is ODI? Do not expect your international audience to know what the acronym means.

  • Wriet Back --- Update query issue

    Hi Freinz,
    I have a requirement where user needs to write back some values.
    The table (product_tbl) that has to be update is of the following staructure.
    col 0:Product
    col 1:Actual Rev
    col 2:Derived Rev
    col 3:Estimated Rev
    i have enabled write back for col 1, col 2 , col 3 ...
    Also in the write back template i have the insert query as" Insert into product_tbl (Actual Rev,Derived Rev,Estimated Rev) values (@{c1},@{c2},@{c3}) "
    I am supposed to have a update query also ...
    My doubt is as below...
    Product is the key column and this colum is not editable.
    How shud my update query look like..as user will be entrying the values based on the product field..
    Apprecaite ur immediate help..
    Many Thanks,
    Mithu...

    Hi,
    Try this:
    UPDATE produc_tbl
    SET Actual Rev = {@1} ,
    Derived Rev = {@2},
    Estimated Rev = {@3}
    WHERE
    PRODUCT = @{@0}
    Regards John
    http://obiee101.blogspot.com/

  • Select for update query not working..

    hi i am tying to get this bit of ncode to work so i can then go to the next part of demonstrating a deadlock between two transactions. however i cannot go any further has my initial code does not work at all. here it goes
    //////////User A////////////////////////////////
    DECLARE
    v_salary squad.salary%TYPE := 300;
    v_pos squad.position%TYPE := 'Forward';
    BEGIN
    UPDATE squad
    SET salary = salary + v_salary
    WHERE sname = 'Henry';
    FOR UPDATE;
    UPDATE squad
    SET position = v_pos
    WHERE sname = 'Fabregas';
    COMMIT;
    END;
    //////////////////////User B/////////////
    DECLARE
    v_salary squad.salary%TYPE := 200;
    v_pos squad.position%TYPE := 'Forward';
    BEGIN
    UPDATE squad
    SET position = v_pos
    WHERE sname = 'Fabregas';
    FOR UPDATE;
    UPDATE squad
    SET salary = salary + v_salary
    WHERE sname = 'Henry';
    FOR UPDATE;
    COMMIT;
    END;
    Basicly user a creats a lock and so does user b, user b enquires a lock from user a and vice versa i.e. a deadlock

    Hi
    You get the following error:
    ORA-06550: line 8, column 7:
    PLS-00103: Encountered the symbol "UPDATE" when expecting one of the following:
    because the FOR UPDATE; is invalid in your statement.
    Try this:
    //////////User A////////////////////////////////
    DECLARE
    v_salary squad.salary%TYPE := 300;
    v_pos squad.position%TYPE := 'Forward';
    v_n number;
    BEGIN
    UPDATE squad
    SET salary = salary + v_salary
    WHERE sname = 'Henry';
    select 1 into v_n from squad
    WHERE sname = 'Fabregas'
    for update;
    UPDATE squad
    SET position = v_pos
    WHERE sname = 'Fabregas';
    COMMIT;
    END;
    //////////////////////User B/////////////
    DECLARE
    v_salary squad.salary%TYPE := 200;
    v_pos squad.position%TYPE := 'Forward';
    v_n number;
    BEGIN
    UPDATE squad
    SET position = v_pos
    WHERE sname = 'Fabregas';
    select 1 into v_n from squad
    WHERE sname = 'Henry'
    for update;
    UPDATE squad
    SET salary = salary + v_salary
    WHERE sname = 'Henry';
    COMMIT;
    END;
    To syncronize the blocks first in a SQLPlus call these two statements:
    select 1 from squad WHERE sname = 'Fabregas' for update;
    select 1 from squad WHERE sname = 'Henry' for update;
    After this start the user A code in another SQLPlus, and start the user B code. After this call rollback or commit in the first sqlplus.
    Ott Karesz
    http://www.trendo-kft.hu

  • Select for update query

    with :
    resultset = stmt.executeQuery("select nxtid from mytable .. for update");
    I have the ora-1002 Erreur.
    Could you help me.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by burgniar:
    with :
    resultset = stmt.executeQuery("select nxtid from mytable .. for update");
    I have the ora-1002 Erreur.
    Could you help me.<HR></BLOCKQUOTE>
    Solution is :
    conn.setAutoCommit(false);
    null

  • FOR UPDATE NOWAIT issue

    Oracle Version: 10.2.0.5
    O/S : Redhat
    Hi,
    I have a select statement that is wrapped in the FOR UPDATE NOWAIT clause. This is embedded in a stored procedure and this stored procedure may be called concurrently by multiple threads from a .net application.
    Off late i have noticed that the proc has been returning the same value to 2 different calls - this defeats the purpose of row-level locking that FOR UPDATE NOWAIT does. I did notice that the procedure calls from the .net application where 100th of a millisecond apart.
    Is there any workaround to avoid the same row being returned to different calls? or is this a known behaviour and i just have to live with it?
    Edited by: brainstormer on May 6, 2013 12:56 PM

    This is part of the SP that performs the lock, updates the queue table so that record is marked as In Process so it is not returned to another process when it is already In Process.
    Thought it may sound far fetched, my theory is that even before session 1 completes the SELECT statement, session 2 comes in and run the select statement. Since session 1 has not completed and has not locked the row yet - oracle returns the same row to both.
    Is this a possible scenario?
       PRAGMA AUTONOMOUS_TRANSACTION;
       lock_detected EXCEPTION;
       PRAGMA EXCEPTION_INIT(lock_detected, -54);
       BEGIN
            BEGIN
                SELECT q.request_id, q.process_id
                             INTO o_request_id, o_process_id
                  FROM PROCESS_QUEUE q
                 WHERE q.process_id IN (
                            SELECT process_id
                                FROM (
                                       SELECT l.process_id
                                         FROM PROCESS_QUEUE L,  REQUESTS r
                                        WHERE L.request_id = r.request_id
                                            AND r.manifest_only = NVL(io_manifest_only,r.manifest_only)
                                            AND r.status = 'INP'
                                            AND ((l.status IN ('PND', 'RTY') AND l.host_name IS NULL AND l.instance_name IS NULL)
                                              OR (l.status = 'INP' AND l.host_name = i_host_name AND l.instance_name = i_process_name))
                                             AND retry_count < i_retry_count
                                          ORDER BY r.updated_dttm asc, l.created_dttm asc
                                        WHERE
                                            ROWNUM =1)
             FOR UPDATE NOWAIT;
             EXCEPTION
              WHEN lock_detected THEN
                 NULL;
              WHEN NO_DATA_FOUND THEN
                 NULL;
           END;
          UPDATE PROCESS_QUEUE
             SET status = 'INP',
                 updated_dttm = sys_extract_utc(current_timestamp),
                 host_name = i_host_name,
                 instance_name = i_process_name
           WHERE process_id=o_process_id;
          COMMIT;
          END;

  • MBO update query issue

    Dear All
    when i create MBO and try to execute the update query it give me a success but it is not reflect the Database.
    update Timesheet set StatusName='from SAP1231231' where TimesheetId=118729.
    Regard
    Ali

    A couple of thoughts.
    1. This forum is in English and accessed by people in more than 100 countries. Use metric counts not crore. Translate to million, billions, trillions, etc.
    2. No database version ... makes helping you very hard.
    3. 200 columns with 25 in a composite key is a nightmare by almost any definition ... fix your design before going any further.
    4. What error message? Post the complete message not just your impression of it.
    5. Oracle tables are heap tables .. there is no such concept as the top, the bottom, or the middle.
    6. If you are trying to perform sampling ... use the SAMPLE clause (http://www.morganslibrary.org/reference/select.html#sssc).
    7. What is ODI? Do not expect your international audience to know what the acronym means.

  • Syntax for Update Query?

    Hi
    I have the following query:
    update martin_adhoc_pct
    set adhoc.mbr_oed = mbr.orig_eff_date
    where adhoc.subs_ssn = mbr.subs_ssn
    and adhoc.mbr_type = mbr.mbr_type
    I get an error saying that:
    ORA-000904 "mbr"."mbr_type" invalid identifier..
    I am using PL/SQL and pulled the table name and field directly from the Objects listing so the names are right. This is the first time I've attempted an UPDATE statement with SQL, so wondering what I'm doing wrong..
    Thanks for any help..

    Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    I have created a table in our data warehouse that has a blank column (specified as datatype DATE) that I want to update with data from another data warehouse table (one that I didn't create). So for example:
    ssn mbr type oed
    123456789 aab needs to be filled in
    987654321 dd1 needs to be filled in
    etc..
    The unique identifier is the sub id and mbr type, so that's why my code joined these fields between the tables. Where they are equal, fill in the associated oed. I need all rows filled in, not just one. Here is the created table code:
    SELECT  mbr00.mbr_type,
            mbr00.mbr00_subs_ssn,
            me607.subscriber_id,
            cast (null as date) mbr_oed       
    from  odw.member_exp me607,
            odw.member_mas mbr00
    where   me607.subscriber_id = mbr00.mbr00_ssn_ref_num   
    and     me607.elig_start_date < sysdate
    and     me607.elig_end_date > sysdate
    and     me607.rmc_code in ('123')
    {code}
    Thanks..
    Edited by: user12296489 on Feb 11, 2010 9:06 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Better method for update query

    Thanks in advance for any help you can offer on this...
    I have two tables:
    DETAIL_TABLE with columns: email_address, invalid_format_indicator, source, create_date
    SUMM_TABLE with columns: run_date, source, email_address_cnt, invalid_email_address_cnt
    Each week I run a job that truncates, then inserts new rows into the DETAIL_TABLE of email addresses that are likely invalid (invalid_format_indicator = 'Y'), and the source system ("source") that created them, as well as the date they were created in our system. Later in the process of that same job, I add new rows into SUMM_TABLE with counts.
    So, for data:
    DETAIL_TABLE:
    email_address|invalid_format_indicator|source|create_date
    joe.aol.com|Y|web|2011-03-01
    mary@myurl|Y|web|2011-03-05
    larry 2yahoo.com|Y|phone|2011-03-06
    After the DETAIL_TABLE is refreshed, new rows (14 of them) are inserted into the SUMM_TABLE whereby it creates a new row for each source. What I then want to do is update the 'invalid_email_address_cnt' field by counting the number of rows in DETAIL_TABLE, grouping by source.
    Right now, I'm running 14 update queries simultaneously--one for each source.
    Data looks like this after the update is complete (bear in mind, it's being updated via 14 separate queries):
    SUMM_TABLE
    run_date|source|email_address_cnt|invalid_email_address_cnt
    2011-03-06|web|25|5
    2011-03-06|phone|3|1
    2011-03-06|loader|20|4
    2011-03-06|source14|5|2
    It looks like this BEFORE the update:
    run_date|source|email_address_cnt|invalid_email_address_cnt
    2011-03-06|web||
    2011-03-06|phone||
    2011-03-06|loader||
    2011-03-06|source14||
    I'm currently running this update statement:
    Update SUMM_TABLE S
    set invalid_email_address_cnt =
    (Select count(*)
    from DETAIL_TABLE D
    where D.source = 'web'
    and D.invalid_format_indicator = 'Y')
    where S.run_date = sysdate
    and S.source = 'web';
    I repeat this query 13 more times-- one for each source. Ick...
    I'd like to consolidate it to one query. I prefer not using PL/SQL. The tool I'm using doesn't support PL/SQL (It's an open source ETL tool), so if I can do this via straight SQL (Oracle compliant) that would be ideal.
    Any help would be greatly appreciated!

    I believe you just want a correlated update
    Update SUMM_TABLE S
       set invalid_email_address_cnt =
          (Select count(*)
            from DETAIL_TABLE D
           where D.source = s.source
             and D.invalid_format_indicator = 'Y')
    where S.run_date = sysdate;I'm not sure, though, about the WHERE clause. Surely you mean TRUNC(sysdate) or you're using a local variable that you used to insert the row into the summary table. Otherwise, if you get unlucky and the clock ticks while your procedure is running, the update may not affect any rows.
    Justin

  • Help for update query

    Hi, How I can split the column of code_full_desc and update in code1,code2 and code3 column which are blank. It should be split after first hyphen.
    create table #desc (code_full_desc char(20), code1 char(4),code2 char(4), code3 char(6))
    insert into #desc values ('CCCCA_AAAA_99_ECTRA','','','')
    insert into #desc values ('DDDDA_BBBB_88_TRACT','','','')
    ---Results should be
    code_full_desc                  code1   code2   code3
    CCCCA_AAAA_99_ECTRA     AAAA   99        ECTRA
    DDDDA_BBBB_88_TRACT      BBBB    88       TRACT

    create table #desc (code_full_desc char(20), code1 char(4),code2 char(4), code3 char(6))
    insert into #desc values ('CCCCA_AAAA_99_ECTRA','','','')
    insert into #desc values ('DDDDA_BBBB_88_TRACT','','','')
    select * from #desc
    ;with mycte as
    SELECT row_number() Over(Partition by code_full_desc Order by code_full_desc) rn, code_full_desc, S.a.value('(/H/r)[4]', 'VARCHAR(100)') AS splitVal4
    , S.a.value('(/H/r)[3]', 'VARCHAR(100)') AS splitVal3
    , S.a.value('(/H/r)[2]', 'VARCHAR(100)') AS splitVal2
    , S.a.value('(/H/r)[1]', 'VARCHAR(100)') AS splitVal1
    ,code1,code2,code3
    FROM
    SELECT *,CAST (N'<H><r>' + REPLACE(code_full_desc, '_', '</r><r>') + '</r></H>' AS XML) AS [vals]
    FROM #desc) d
    CROSS APPLY d.[vals].nodes('/H/r') S(a)
    Update mycte
    set
    code1=splitVal2,
    code2=splitVal3,
    code3=splitVal4
    WHERE rn=1
    select * from #desc
    drop table #desc

  • For Update Nowait Query Generated Implicitly by Forms

    Recently we had a problem in one form because of a query getting generated implicitly by Forms with for update and nowait clause. i.e.
    Select Col1, Col2, Col3 Where Rowid= :1 for update of Col1 NoWait if we change the sequence of the Fields in block by shuffling the Fields i.e Bringing Col 1 to Col3 and Col3 to Col1 the query formed is some thing like this i.e.
    Select Col3, Col2, Col1 Where Rowid= :1 for update of Col3 NoWait  We just want to know when this query is getting fired and how i.e. Upon firing of which trigger in Forms this is getting fired in the DB. Because we are for sure we are not firing this query either from front end or back end. We are not locking the block any where or changing the lock mode of the block programatically.
    Few block level properties relevant to this
    Locking Mode - Automatic
    Update Changed Columns Only - Yes
    Possible reasons which we feel is that when we are assigning the values to a field programattically and when more than 1 user is navigating on the same block this may happen. Because Forms doesnt knows whether the user has edited the record manually or programatically. But we have noticed this query runs even when only 1 user is connected to this schema. This is our understanding so far any ideas/suggestions to avoid this or overcome this is appreciated.
    Thanks in advance

    Locking Mode - Automatic or Immediate, means select for update is issued as soon as value in a base table item changed by user or programmatically.
    Setting it to "Delayed" will delay lock until commit-time.
    You can override this behavior by creating ON-LOCK triger.

  • Problem for running Update query with Chinese

    Hi all,
    I am running a web application in Lotus Domino.
    I have a Lotus Script Agent which need to update Oracle 8i Database with Chinese Character throught ODBC but i find that all characters become some strange characters.
    I got the problem only for update query.
    I have no problem for select query for getting the chinese data.
    Also, I got no problem to run the update query with chinese characters in Sqlplus.
    I also try to run the same update query which the ODBC connection is pointing to an MS Access Database. It works too.
    So the only things i leave is the Oracle ODBC driver.
    Anythings I should do for the Oracle ODBC server?
    Thanks very much.

    Hi, I checked the registry of Oracle and
    in the NLS_LANG field, the values is AMERICAN_AMERICA.UTF8. In the server side, I set the same.
    It should be okay, as i can retrieve the chinese content in the Oracle. Just that when i try to run a query contain chinese, such as,
    "insert into TableA values ('���')". i will got some strange character inserted in the databasae.
    Could you tell me what should i do?
    Thanks a lot a lot.

Maybe you are looking for