Lock Table and permit only SELECT-Statement

Hi all,
can I lock a Table and permit only SELECT-statements on a Table?
Regards
Leonid

Hi Kamal,
I would like to configure it in such a way that if I implement the SELECT statement, another user can't insert
a data into the table.
If it is possible, I even the LOCK would like in such a way to configure the fact that the entry of the user arrives into the buffer and if the table is unlocked, all lines from the Buffer again into the table.
I make it in such a way:
SQL Script script_test.sql:
set echo off
set verify off
set pagesize 0
set termout off
set heading off
set feedback off
lock table mytable in share row exclusive mode;
spool c:\Temp\script_info.lst
select id||'|'||dae||'|'||name||'|'||name1||'|'||hiredate
||'|'||street||'|'||nr||'|'||plznum||'|'||city
||'|'||email||'|'||telephon||'|'||cddfeas||'|'||number
||'|'||why||'|'||fgldwer||'|'||wahl||'|'||adress
||'|'||las
from mytable
where las is null
spool off
spool c:\Temp\select_from_all_tables.lst
select *
from all_tables
order by owner
spool off
spool c:\Temp\select1_from_all_tables.lst
select *
from all_tables
order by owner
spool off
update mytable
set las = 'x';
commit;
set feedback on
set heading on
set termout on
set pagesize 24
set verify on
set echo on
Afterwards I start another session:
insert into briefwahl
values(38,'11.06.2003 09:37','Test','Test','01.01.1990',
'Test','12','90000','Test',
'[email protected]','12345657','test','123',
'test','test','test','test',
null);
Then I go into the first session and start script. And I go immediately into the second session and do commit; And although I have the table closed, the new entries are spent also with spool into the .lst-File. Why, I do not understand. And in the table all lines become updated.
Regadrs
Leonid
P.S. Sorry for my English. I have write with translator.

Similar Messages

  • How to use Oracle Table Type values in Select Statement.

    Hi,
    I am fetching initial set of values into Oracle Table of Records Type and want to use list of values in the Select statement.
    For example, try something like the following:
    TYPE t_record IS RECORD (
    ID TABLEA.ID%type,
    NO TABLEA.NO%type,
    v_record t_record;
    TYPE t_table IS TABLE OF v_record%TYPE;
    v_table t_table;
    -- Code to populate the values in v_table here.
    SELEC ID,NO, BULK COLLECT INTO <some other table variabes here> FROM TABLEA
    WHERE ID IN v_table(i).ID;
    I want to know how to use the values from Oracle Table Type in the Select Statement.

    Something like this:
    create or replace type t_record as  object (
    id number,
    no number
    CREATE or replace type t_table AS TABLE OF t_record;
    set serveroutput on
    declare
      v_table t_table := t_table();
      v_t1 t_table := t_table();
    begin
      v_table.extend(1);
      v_table(1).ID := 1;
      v_table(1).No := 10;
      v_table.extend(1);
      v_table(2).ID := 2;
      v_table(2).ID := 20;
      SELEC t_record (ID,NO) BULK COLLECT INTO v_t1
      from TableA
      FROM TABLEA
      WHERE ID IN (select t.ID from table(v_Table) t);
      for i in 1..v_t1.count loop
        dbms_output.put_line(v_t1(i).ID);
        dbms_output.put_line(v_t1(i).No);
      end loop;
    end;
    /Untested!
    P;
    Edited by: bluefrog on Mar 5, 2010 5:08 PM

  • How can i pass a variable instead of a table name in the Select statement.

    Dear all
    how can i pass a variable instead of a table name in a select statement ?
    Example :-
    Begin
    P_get_procedure_tname (aap_name,otable_name);--It will take an application name and will return a table name
    Select col1 into ocol1
    from  ---- here i want to pass the variable OTABLE_NAME
    End;How can i pass this ?

    Hi,
    You can use dynamic sql.
    EXECUTE IMMEDIATE 'SELECT COL1 INTO ' || OCOL1 || ' FROM " || OTABLE_NAME;
    {code}
    cheers
    VT                                                                                                                                                                                                                                                                                                   

  • When using office for mac or i studio after inserting several pictures, my computer locks up and the only way I can fix it is to do a force quit.  Why does it do this and how I I get it fixed without a force quit?

    I have a mac book, with office for mac and iStudio installed.  When I try to create a document using either one of these; after inserting several photos, the computer locks up and the only way I can get it to unlock is to do a force quit.  Why does it do this, and how can I get it to unlock without having to do a force quit?

    Are you using versions of the software that are compatible with the version of OS X you have installed? Very often such lockups are caused by application incompatibility.
    The problem may also come from trying to use both sets of applications at the same time while not having enough RAM installed. Adding more RAM may fix the problem.
    The problem can arise from corrupted support files such as preference files or Application Support files or corrupted cache files.
    The image files you are using may also be corrupt thus causing the problem.
    You might start with:
    Kappy's Personal Suggestions for OS X Maintenance
    For disk repairs use Disk Utility.  For situations DU cannot handle the best third-party utilities are: Disk Warrior;  DW only fixes problems with the disk directory, but most disk problems are caused by directory corruption; Disk Warrior 4.x is now Intel Mac compatible. TechTool Pro provides additional repair options including file repair and recovery, system diagnostics, and disk defragmentation.  TechTool Pro 4.5.1 or higher are Intel Mac compatible;  Drive Genius is similar to TechTool Pro in terms of the various repair services provided.  Versions 1.5.1 or later are Intel Mac compatible.
    OS X performs certain maintenance functions that are scheduled to occur on a daily, weekly, or monthly period. The maintenance scripts run in the early AM only if the computer is turned on 24/7 (no sleep.) If this isn't the case, then an excellent solution is to download and install a shareware utility such as Macaroni, JAW PseudoAnacron, or Anacron that will automate the maintenance activity regardless of whether the computer is turned off or asleep.  Dependence upon third-party utilities to run the periodic maintenance scripts had been significantly reduced in Tiger and Leopard.  These utilities have limited or no functionality with Snow Leopard or Lion and should not be installed.
    OS X automatically defragments files less than 20 MBs in size, so unless you have a disk full of very large files there's little need for defragmenting the hard drive. As for virus protection there are few if any such animals affecting OS X. You can protect the computer easily using the freeware Open Source virus protection software ClamXAV. Personally I would avoid most commercial anti-virus software because of their potential for causing problems.
    I would also recommend downloading the shareware utility TinkerTool System that you can use for periodic maintenance such as removing old log files and archives, clearing caches, etc.  Other utilities are also available such as Onyx, Lion Cache Cleaner, CockTail, for example.
    For emergency repairs install the freeware utility Applejack.  If you cannot start up in OS X, you may be able to start in single-user mode from which you can run Applejack to do a whole set of repair and maintenance routines from the commandline.  Note that AppleJack 1.5 is required for Leopard. AppleJack 1.6 is compatible with Snow Leopard. There is no confirmation that this version also works with Lion.
    When you install any new system software or updates be sure to repair the hard drive and permissions beforehand. I also recommend booting into safe mode before doing system software updates.
    Get an external Firewire drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
    Backuplist
    Carbon Copy Cloner
    Data Backup
    Deja Vu
    iBackup
    JaBack
    Silver Keeper
    MimMac
    Retrospect
    Super Flexible File Synchronizer
    SuperDuper!
    Synchronize Pro! X
    SyncTwoFolders
    Synk Pro
    Synk Standard
    Tri-Backup
    Visit The XLab FAQs and read the FAQs on maintenance, optimization, virus protection, and backup and restore.
    Additional suggestions will be found in Mac Maintenance Quick Assist.
    Referenced software can be found at CNet Downloads or MacUpdate.

  • * table name in the select statements

    Hi,
      I have come across a select Statement as below.
    Select * into *nast from nast where <conditions>.. End select.
    what does this *nast represents and when is it used. why do we need to call a Table  with *<Table Name>
    Kind Regards,
    Usha

    hi,
    select statement will always points to a database table so we have to give database table name and it gets data from that table. for storing that data we have to use internal tables must have same structure of database table.
    so select statement has the following form as........
    select * from [dbtable] into table [internal table]
    endselect.
    in sap select will act as a loop so that we hav to use end sleect. select has different varities in sap. for some types no need of end select.
    for ex:
    select single *
    select * ..................... into table [internal table name].....
    if helpful reward some points.
    with regards,
    suresh.

  • Evaluated order of Pivot and UnPivot in select statement

    My research which evaluated order of select statement is below.
    1 from
    2 where (Join condition)
    3 start with
    4 connect by
    5 where (filter of rows)
    6 group by
    7 having
    8 model
    9 select
    10 order byMy question is Where Pivot clause and UnPivot clause ?
    http://download.oracle.com/docs/cd/E16338_01/server.112/e10592/statements_10002.htm

    Provided that you can specify columns created by the PIVOT clause both in the select and in the Order By clause, I think the pivot must be executed before them:
    SQL> r
      1  select job, d10,d20,d30 from emp
      2  pivot (sum(sal) for deptno in (10 as D10, 20 as d20, 30 as d30))
      3* order by d20
    JOB              D10        D20        D30
    CLERK                       800
    CLERK                      1100
    MANAGER                    2975
    ANALYST                    3000
    ANALYST                    3000
    SALESMAN                              1600
    PRESIDENT       5000
    MANAGER         2450
    SALESMAN                              1500
    SALESMAN                              1250
    CLERK           1300
    MANAGER                               2850
    SALESMAN                              1250
    CLERK                                  950
    Selezionate 14 righe.
    Piano di esecuzione
    Plan hash value: 1739977809
    | Id  | Operation            | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT     |      |    14 |   518 |     5  (40)| 00:00:01 |
    |   1 |  SORT ORDER BY       |      |    14 |   518 |     5  (40)| 00:00:01 |
    |   2 |   HASH GROUP BY PIVOT|      |    14 |   518 |     5  (40)| 00:00:01 |
    |   3 |    TABLE ACCESS FULL | EMP  |    14 |   518 |     3   (0)| 00:00:01 |
    -----------------------------------------------------------------------------Max

  • Passing of internal table values to the select statement as SETS

    Hi All,
    Is there any way that i can restrict the values of a internal table to be passed to a select statement set by set..
    say for eg: if a itab has 1000 entries i want the first 500 to be going out in a select statement as a comparision for all entries and then the next set of 500 to go out..
    Please let me know.. this is very urgent..

    <b>Appending Several Lines</b>
    You can also append internal tables to index tables using the following statement:
    APPEND LINES OF <itab1> TO <itab2>.
    This statement appends the whole of ITAB1 to ITAB2. ITAB1 can be any type of table, but its line type must be convertible into the line type of ITAB2.
    When you append an index table to another index table, you can specify the lines to be appended as follows:
    APPEND LINES OF <itab1> [FROM <n1>] [TO <n 2>] TO <itab2>.
    <n 1 > and <n 2 > specify the indexes of the first and last lines of ITAB1 that you want to append to ITAB2.
    This method of appending lines of one table to another is about 3 to 4 times faster than appending them line by line in a loop. After the APPEND statement, the system field SY-TABIX contains the index of the last line appended. When you append several lines to a sorted table, you  must respect the unique key (if defined), and not violate the sort order. Otherwise, a runtime error will occur.
    Then u can use <b> FOR ALL ENTRIES</b> in select query.
    regards
    vinod

  • How to use a table name in the select statement using a variable?

    Hi Everybody,
                       I got a internal table which has a field or a variable that gets me some tables names. Now I need to retrieve the data from all these tables in that field dynamically at runtime. So could you suggest me a way out to use the select query which uses this variable as a table ?
    Regards,
    Mallik.

    Hi all,
    Actually i need some more clarification. How to use the same select statement, if i've to use the tabname in the where clause too?
    for ex : select * from (tab_name) where....?
    Can we do inner join on such select statements? If so how?
    Thanks & Regards,
    Mallik.

  • Marking in and out only selects audio.  I need both

    I'm sure this is very fundamental but I can't figure it out.
    I've been editing a lot of home movies this weekend when suddenly my IN and OUT buttons are behaving differently in the time line. They are only selecting (affecting) the two audio tracks and not affecting the video track. Why?

    Make sure the VIDEO tab is connected in the Timeline patchbay for the track where you want the video to go.
    -DH

  • How to setup FS Items for debit and credit only Financial Statement Items

    Hi,
    In Financial Statement, there are line items that report for the same accounts that are debit only under Assets and credit only under Liabilities. How should I setup Consolidation Chart of Accounts/FS Items in EC-CS for such items?
    Regards,
    B Lim

    Hi Prem,
    We have already assigned all the co-codes to only 1 COA.
    However, we did not create any Group COA and has no intention to.
    My issue is this:
    As you are aware in the Financial Statement, we are able to maintain for GL accounts to be reported under Assets by specifying the DR indicator and for the same accounts to be reported under Liabilities by specifying the CR Indicator.
    When I maintain the Consoliated COA in the Consolidation module (tcode CX16), I have problem with these accounts. How do I create the FS Items such that DRs goes to Assets lines and CRs goes to Liabilities?
    Regards,
    Bernard

  • Only select statements work (update/insert hang)

    Hi, I am running CF MX version 7,0,2,142559 Standard Edition
    and ColdFusion is hanging everytime I attempt an insert or update
    statement again Oracle 8i and 9i using the jdbc thin driver and an
    odbc socket driver.
    Select statements work fine. I have tried everything I could
    think of and I get the same results. All rights are given to the
    datasource and the user. I can do insert and update statement via
    another application (Toad) with the same Oracle user.
    Any suggestions??? I don't see any hot fixes for this but
    that doesn't mean one doesn't exist.
    Also, many times it causes the system cpu utlization to stick
    at 100% until I restart ColdFusion.
    Thanks for any help.

    Hi,
    I had similar results on Oracle 10G while using cfmx 7.02. I
    actually updated the macromedia_drivers.jar from the coldfusion
    support site.
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=42dcb10a
    An update to the datadirect JDBC drivers. Try that. If not,
    make sure you have the latest JDBC drivers from Oracle. Since
    previous versions would make the update/insert;s hang.

  • Question, regarding export. From the library module, when I select an image and then click on the Export button, or select file export, nothing happens. The program seems to lock up and the only way to continue in the software is to press the escape key.

    I guess the question is entirely contained in the title. Thank you.

    TO further clarify, after pressing the Export button the dialog box defining the export output does not appear

  • How to use 'OR'  & 'AND' together in SELECT statement.

    Hi All,
    I am a BW person. Dont know much about ABAP. But i m trying to write a start routine in BW Transfer Rules.
    I m stuck at one point where i need to check multiple values using a slect statement.
    My requirement is like
    SELECT single * into wa_MEMPLOYEE from /BI0/QEMPLOYEE
      where EMPLOYEE eq L_S_DATAPAK_LINE-PERNR AND
        EMPLGROUP EQ ('1 OR '2' OR '7') AND
       CNTRCTTYPE EQ ('01' OR '05' OR '09' OR '50' OR '60').
    I tried using 'IN' .But this works only partially.
    EMPLGROUP IN ('1', '2', '7') AND
        CNTRCTTYPE IN ('01' , '05' , '09' , '50' , '60').
    when i use 'IN', the code checks the EMPLHROUP properly.But it will allow all other CONTRACT TYPE records to be written to the internal table.
    Can any one tell me how can i achieve this please.
    Cheers
    POPS

    Hi,
    You can do as below:
    "Create ranges for EMPLGROUP  AND CNTRCTTYPE
    ranges : gr_empgrp for <tablename-fieldname>,
                 gr_cntrtype for <tablename-fieldname>.
    initialization.
    gr_empgrp-sign = 'I'.
    gr_empgrp-option = 'EQ'.
    gr_empgrp-low = '1'.
    append gr_empgrp.
    gr_empgrp-sign = '2'.
    gr_empgrp-option = 'EQ'.
    gr_empgrp-low = '1'.
    append gr_empgrp.
    gr_empgrp-sign = '7'.
    gr_empgrp-option = 'EQ'.
    gr_empgrp-low = '1'.
    append gr_empgrp.
    gr_cntrtype-sign = 'I'.
    gr_cntrtype-option = 'EQ'.
    gr_cntrtype-low = '1'.
    append gr_cntrtype.
    gr_cntrtype-sign = 'I'.
    gr_cntrtype-option = 'EQ'.
    gr_cntrtype-low = '05'.
    append gr_cntrtype.
    gr_cntrtype-sign = 'I'.
    gr_cntrtype-option = 'EQ'.
    gr_cntrtype-low = '09'.
    append gr_cntrtype.
    gr_cntrtype-sign = 'I'.
    gr_cntrtype-option = 'EQ'.
    gr_cntrtype-low = '50'.
    append gr_cntrtype.
    gr_cntrtype-sign = 'I'.
    gr_cntrtype-option = 'EQ'.
    gr_cntrtype-low = '60'.
    append gr_cntrtype.
    SELECT single * into wa_MEMPLOYEE from /BI0/QEMPLOYEE
      where EMPLOYEE eq L_S_DATAPAK_LINE-PERNR AND
        EMPLGROUP in gr_empgrp AND
       CNTRCTTYPE in cntrtype.
    Thanks,
    Sriram Ponna.

  • Create Dynamic table name in the select statement.

    I use oracle reports 6i to make myrep.rdf , this report created using certain select query Q1, I created a formula column in this report,
    in the formula column  I write pl/sql block statements to select the data from certain table depends on the output of a column in Q1,
    I want to make the pl/sql block dynamically enough to change the user which I select the data from depends on the connected user
    Ex: if I connected with user = 'KAM14'
    the pl/sql block will be
    select x into v_value from kam13.bil_file where .....;
    and if  I connected with user = 'KAM13'
    the pl/sql block will be
    select x into v_value from kam12.bil_file where .....;
    and so on
    how can I do this in the pl/sql block ...
    Thanks in Advance.

    I am not sure I understood properly, but I think you should create bil_file table under a different user and create synonyms  under KAM1x users.
    Regards

  • Selecting values into same internal table from 2 differrnt select statement

    Hi Friends,
    code :
    types :
       begin of ty_bsad,
         augbl type bsad-augbl,
      end of ty_bsad.
    begin of ty_bsad1,
         augbl type bsad-augbl,
         belnr type bsad-belnr,
      end of ty_bsad1.
      select augbl
               from bsad
              into table it_bsad
              where belnr = l_vbeln and
                       bukrs = l_bukrs and
                      kunnr  = l_kunrg.
           if sy-subrc = 0 .
               select belnr
                         into table lt_bsad1
                         from bsad
                        for all entries in lt_bsad
                       where augbl = lt_bsad-augbl and
                                kunnr = l_kunnr  and
                                burks  = l_bukrs and
                                blart   = 'xy'.
    now my requiremnt is i need to get both the augbl and belnr in single internal table but not in differnrnt internal table.
    how can i get it.
    Regards,
    Priyanka.
    Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 10:53 AM

    HI.
    No Need to create two internal table because your feyching values from same table BSAD with diffrent where condition.try this code.it s work.
    select augbl
    from bsad
    into table it_bsad
    where belnr = l_vbeln and
    bukrs = l_bukrs and
    kunnr = l_kunrg and
    blart = 'xy'.
    else Refer this code.
    LOOP AT it_bill_data INTO wa_bill_data.
        MOVE-CORRESPONDING wa_bill_data TO wa_final_data.
        READ TABLE it_material_data INTO wa_material_data
                                    WITH KEY matnr = wa_bill_data-matnr.
        IF sy-subrc = 0.
          wa_final_data-meins_mara = wa_material_data-meins.
        ENDIF.
        APPEND wa_final_data TO it_final_data.
    ENDLOOP.
    Regards.
    Jay
    Edited by: Jay on Jan 8, 2009 2:53 PM
    Edited by: Jay on Jan 8, 2009 2:57 PM
    Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 10:56 AM

Maybe you are looking for