Is it possible to Lock just one column value in a row?

Is it possible to Lock just one column value in a row
A Java Developer has just asked me if it is possible to Lock just one column value in a row in Oracle
select ename from emp where empno=7369 for update;
EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
7369 SMITH      CLERK           7902 17-DEC-80        800                    20
will lock the entire row with empno=7369.
But is it possible to lock one column value from this row, like SAL=800 ?
Edited by: J.Kiechle on Jan 8, 2009 10:45 PM

J.Kiechle wrote:
Is it possible to Lock just one column value in a rowNo. Locking granularity is a row.

Similar Messages

  • Replacing one column value between two rows..help??

    HI,
    I have table T
    it has five columns, all are in number data type
    Col1 and col2 are jointly primary key i.e. they cannot be repeated combined
    when i run this query..
    SQL> Select * from t
    it shows me the data like this
    Col1        Col2              Col3       Col4           Col5
    1             1               78          58            12.76
    2             1               128         446           32.10
    3             1               468         566           52.10
    4             1               878         58            52.05
    5             1               987         348           22.02
    ... so on.
    my requirement is that i want to update this table by replacing the col1 value between any two rows
    suppose this is the first row
    Col1        Col2          Col3        Col4         Col5
    1             1             78          58        12.76
    and this is any 2nd row
    Col1        Col2          Col3        Col4        Col5
    5             1            987         348       22.02
    now i want that for first row the value of col1 replaces the value of col1 of 2nd row
    and for 2nd row the value of col1 replaces the value of col1 of 1st row
    i.e.
    Col1        Col2          Col3        Col4         Col5
    5             1            78           58         12.76
    Col1        Col2          Col3        Col4         Col5
    1             1            987        348          22.02
    please tell how to achieve this in single query/procedureregards,
    Ramis

    SQL> create table t (id1 number, id2 number, name varchar2(1));
    Table created.
    SQL> alter table t add primary key (id1,id2);
    Table altered.
    SQL> insert into t values(1,1,'A');
    1 row created.
    SQL> insert into t values(5,1,'B');
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select * from t;
           ID1        ID2 N
             1          1 A
             5          1 B
    SQL> var val1 number
    SQL> var val2 number
    SQL> exec :val1 := 1;
    PL/SQL procedure successfully completed.
    SQL> exec :val2 := 5;
    PL/SQL procedure successfully completed.
    SQL> update t set id1 = (:val1 + :val2) - id1 where id1 in (:val1,:val2);
    2 rows updated.
    SQL> select * from t;
           ID1        ID2 N
             5          1 A
             1          1 B
    SQL> rollback;
    Rollback complete.
    SQL> select * from t;
           ID1        ID2 N
             1          1 A
             5          1 B
    SQL> commit;
    Commit complete.
    SQL> update t set id1 = decode(id1,:val1,:val2,:val1)
      2  where id1 in (:val1, :val2);
    2 rows updated.
    SQL> select * from t;
           ID1        ID2 N
             5          1 A
             1          1 BRgds.

  • How to change font in just one column of JTable

    I have a table with 4 column.
    I want to have Courier font in column number 2, and Arial in columns number 1, 3 and 4.
    With:
    table.setFont(new Font("Courier New", Font.PLAIN, 12));
    I can set fonts in all columns but how to set font in just one column.
    Thanks
    Srdan

    Hi,
    there are 2 methods of JTable where every rendering resp. editing component "comes" through - prepareRenderer(...) and prepareEditor(....) - by overwriting this methods and calling its super method first you get the component and can manipulate it before you return it. This component is exactly that, what is used for rendering resp. editing afterwards.
    greetings Marsian

  • Is it possible to download just one playlist onto my husbands new ipod nano

    Is it possible to download just one playlist onto my husbands new ipod nano (16gb) from my Macbook pro version 10.6.8.  and is so how?

    Hello sylviafromkendal,
    With an iPod, you are able to sync music from multiple iTunes libraries to the device.  If the iPod is configured to manually manage the content, then please follow the directions in the first article below.  If that is not the case, then you will need to enable the manually manage music and videos option is turned on.  
    Manage content manually on your iPhone, iPad, and iPod - Apple Support
    Thanks for using the Apple Support Communities!
    Cheers,
    Alex H.

  • Add a horizontal guide to just one column

    Hey all,
    This seems like it's probably got a simple answer, but I've been beating my head against a wall all morning trying to figure it out so clearly it's not so simple to me I'm trying to add a horizontal guide to a single column in a three-column document (basically I want just that column to have two rows). The end result is going to be a tri-fold brochure type thing with two perforated stubs on one of the thirds. Any ideas out there?

    As far as I know, there are only two ways to make a guide. One is for the guide to end at the page boundaries by dragging it into the page:
    …and the other extends the guide into the pasteboard by dragging into the pasteboard:
    You can fake what you want by drawing a rule (as Peter suggested), but if you don't want it to print, select it and go to Window>Output>Attributes and check the Nonprinting checkbox. Create it on the master page if you want it on all pages.

  • Possible to sync just ONE Gmail contact group?

    So I'm wondering if it's possible to synchronize just one Gmail contact group with my Blackberry contacts.  Like, I have about 15 Gmail contact groups -- one group for co-workers, one group for publicists who send me press releases, one group for friends, etc.  I only want the addresses in my friends group to be sync'd with my Blackberry.  Is this possible?  Or do I have to let them all sync, and then manually delete the contacts I don't want from my Blackberry? 

    Hey eggcream,
    The contact list "My Contacts" is the list that synchronizes.
    You can remove this label in your Gmail contacts from those of whom you do not wish to have synchronized over.
    -HMthePirate
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • Create an object for just one column in resultset?

    Does it make sense to return a result set of one column into an object that represents that table? It seems like a waste of memory, but maybe I am missing something. Also all generic DOA's I have found don't deal with this situation, so maybe someone can help me with how I think about this problem in my design. Thanks for the thoughts.

    >
    Plan B is to just return a list of Strings instead of a list of "some object". The issue with this is the ease of creating a generic DAO that is easy to program to. Having a DAO for each "table" class seems to be the best practice that is offered out there.
    >
    Well a String IS an object.
    From an architecture perspective you should model a table as a table. So if you have a table of one column you should still model it as a table. A table is a table is a table and you should generally treat it as such until or unless there is a compelling reason not to.
    If you step back from the 'implementation' and refocus on the 'design' and requirements one of those requirements is to identify the sources of data that your application needs. Sounds like that data, at the server level is in a table and the typical interface between an application and a database is via tables. Makes no difference if you need one row or 1000, one column or 30 columns the first focus is on the data source.
    So the interface between an application, in your case a Java app, and a database server will generally involved tables. That means you should probably still use a standard DAO (I assume you mean Data Access Object).
    A generic table DAO would typically have functionality to deal with tables and not just an arbitrary object. It would have getters and setters, functionality to support multiple rows and might even know about columns.
    In good data models tables almost never have just one column. Even a simple lookup table usually has an ID or CODE column and then a value column for the actual data. So if that one column table suddenly becomes two or more columns you will have to refactor your entire architecture to then use a standard DAO.
    That is why the statement you made is true.
    >
    Having a DAO for each "table" class seems to be the best practice that is offered out there.
    >
    Unless you have some real reason not to I suggest you stick with that practice. That will make you code more scaleable and more consistent.
    From an architecture perspective.

  • Can You Lock Just One Page but not whole site?

    I'm sure this was answered -- but now I cannot find it in the topic list.
    I want a particular site to be open to one and all. But I want to lock just one page on that site -- which would require a user name and password. My attempts so far end up locking the entire site.
    Any suggestions?
    Many thanks,
    Richard.
    Power Book G4   Mac OS X (10.4.2)  

    if you search this forum for "password one page" you will find some previous posts.
    There is one that mentions creating a second one page site and passwording it with a hyperlink in the first site. Might be the way to go. I don't believe you can currently password just one page.
    good luck

  • How to get one column value from a DOCUMENT TYPE attribute

    Hi,
    I have created a DOCUMENT TYPE attribute which queries from a table and all the column values( For Ex: Customer Name, Contact Name and Address) are displayed in the message body.
    I want one column value(For Ex: Customer Name) to be displayed in the SUBJECT of the message.
    How can this be done? Please let me know.
    Thanks in advance.

    Thanks Matt. I have used SETITEMATTRTEXT to get a single column value into an ITEM ATTRIBUTE.
    Please see the following procedure...
    ==========================================================
    PROCEDURE MisNotifyDataDesk(
         itemtype IN VARCHAR2
         , itemkey IN VARCHAR2
         , actid IN NUMBER
         , funcmode IN VARCHAR2
         , resultout OUT VARCHAR2
         ) IS
    p_Cart_Id               VARCHAR2(30);
    p_ORG_NAME                     VARCHAR2(360);
    BEGIN
         IF funcmode != WF_ENGINE.ENG_RUN THEN
              wf_log_pkg.string(5,'Notify_Cust_Data_Desk','Not in RUN mode');
         RETURN;
         END IF;
    p_Cart_Id := WF_ENGINE.GetItemAttrText ( itemtype => itemtype
    , itemkey => itemkey
    , aname => 'CART_ID' );
    p_code_position := 10;
         SELECT
              ORG_NAME
         INTO
              p_ORG_NAME                     
         FROM
              MISIBE_END_CUST_DETAILS
         WHERE
              QUOTE_HEADER_ID = p_Cart_Id;
    -- For TEXT BODY
    WF_ENGINE.SETITEMATTRTEXT(itemtype => itemtype , itemkey => itemkey , aname => 'ORG_NAME',avalue => p_ORG_NAME);
    resultout := WF_ENGINE.ENG_COMPLETED||':'||CUST_DATA_CHECK(p_Cart_Id);
    EXCEPTION
         WHEN OTHERS THEN
              WF_CORE.context (
              'WFCustCheck',
              'MisNotifyDataDesk',
              itemtype,
              itemkey,
              TO_CHAR(actid),
              funcmode,
              SQLERRM
    RAISE_APPLICATION_ERROR (-20005, SQLERRM);
    ===========================================================
    I am using &ORG_NAME in the body and subject of my message. But the value is
    not retrieved into the ITEM ATTRIBUTE when I run my process. It is just displaying in the message and the subject of hte message as "&ORG_NAME"
    CUST_DATA_CHECK used in the resultout, is a function which returns 'T' or 'F'. That part is working fine. Just retrieving the ORG_NAME in the ITEM ATTRIBUTE is not working.
    Am I going wrong somewhere? Please let me know.
    Thanks,

  • Join all rows bases on one column value

    Hi All,
    I have requrement like Join all rows bases on one column value, i am not getting how to accomplish that. Here is my requrement. i have table test(id,id_desc) with no key
    table:Test
    id id_desc
    1 desc_a
    1 desc_b
    1 desc_c
    Now the requremnet i have one more table as test1(id,id_desc) here id is primary key. where record i need to insert as
    id id_desc
    1 desc_a
    desc_b
    desc_c

    orza wrote:
    Hi All,
    I have requrement like Join all rows bases on one column value, i am not getting how to accomplish that. Here is my requrement. i have table test(id,id_desc) with no key
    table:Test
    id id_desc
    1 desc_a
    1 desc_b
    1 desc_c
    Now the requremnet i have one more table as test1(id,id_desc) here id is primary key. where record i need to insert as
    id id_desc
    1 desc_a
    desc_b
    desc_cI'm guessing you want to pivot the results in TEST and use that to insert into TEST1?
    If so this may be useful
    http://www.oracle-base.com/articles/misc/StringAggregationTechniques.php

  • How To Concatenate Column Values from Multiple Rows into a Single Column?

    How do I create a SQL query that will concatenate column values from multiple rows into a single column?
    Last First Code
    Lesand Danny 1
    Lesand Danny 2
    Lesand Danny 3
    Benedi Eric 7
    Benedi Eric 14
    Result should look like:
    Last First Codes
    Lesand Danny 1,2,3
    Benedi Eric 7,14
    Thanks,
    David Johnson

    Starting with Oracle 9i
    select last, first, substr(max(sys_connect_by_path(code,',')),2) codes
    from
    (select last, first, code, row_number() over(partition by last, first order by code) rn
    from a)
    connect by last = prior last and first = prior first and prior rn = rn -1
    start with rn = 1
    group by last, first
    LAST       FIRST      CODES                                                                                                                                                                                                  
    Lesand         Danny          1,2,3
    Benedi         Eric           7,14Regards
    Dmytro

  • Concatenate a column value across multiple rows - PDW

    We are using PDW based on SQL2014. We require an efficient logic on how to concatenate a column value across multiple rows. We have the following table
    T1
    (CompanyID, StateCD)
    Having following rows:
    1              NY
    1              NJ
    1              CT
    2              MA
    2              NJ
    2              VA
    3              FL
    3              CA
    We need a code snippet which will return following result set:
    1                    
    CT,NJ,NY
    2                    
    MA,NJ,VA
    3                    
    CA,FL
    We have tried built-in function STUFF with FOR XML PATH clause and it is not supported in PDW. So, we need a fast alternative.

    Hi Try this:
    SELECT * INTO #ABC
    FROM 
    SELECT 1 AS ID,'NY' AS NAME
    UNION 
    SELECT 1 AS ID,'NJ' AS NAME
    UNION 
    SELECT 1 AS ID,'CT' AS NAME
    UNION 
    SELECT 2 AS ID,'MA' AS NAME
    UNION 
    SELECT 2 AS ID,'NJ' AS NAME
    UNION 
    SELECT 2 AS ID,'VA' AS NAME
    UNION 
    SELECT 3 AS ID,'FL' AS NAME
    UNION 
    SELECT 3 AS ID,'CA' AS NAME
    )A
    CREATE TABLE ##CDB (ID INT, NAME NVARCHAR(800)) 
    DECLARE @TMP VARCHAR(MAX), 
            @V_MIN INT,
    @V_MAX INT,
    @V_COUNT INT
    SELECT @V_MIN=MIN(ID),@V_MAX=MAX(ID) FROM #ABC 
    SET @V_COUNT=@V_MIN
    WHILE @V_COUNT<=@V_MAX
    BEGIN
    SET @TMP = '' SELECT @TMP = @TMP + CONVERT(VARCHAR,NAME) + ', ' FROM #ABC 
    WHERE ID=@V_COUNT
    INSERT INTO ##CDB (ID, NAME) SELECT @V_COUNT AS ID ,CAST(SUBSTRING(@TMP, 0, LEN(@TMP)) AS VARCHAR(8000)) AS NAME 
    SET @V_COUNT=@V_COUNT+1
    END
    SELECT * FROM ##CDB
    OR
    SELECT * INTO #ABC
    FROM 
    SELECT 1 AS ID,'NY' AS NAME
    UNION 
    SELECT 1 AS ID,'NJ' AS NAME
    UNION 
    SELECT 1 AS ID,'CT' AS NAME
    UNION 
    SELECT 2 AS ID,'MA' AS NAME
    UNION 
    SELECT 2 AS ID,'NJ' AS NAME
    UNION 
    SELECT 2 AS ID,'VA' AS NAME
    UNION 
    SELECT 3 AS ID,'FL' AS NAME
    UNION 
    SELECT 3 AS ID,'CA' AS NAME
    UNION 
    SELECT 5 AS ID,'LG' AS NAME
    UNION 
    SELECT 5 AS ID,'AP' AS NAME
    )A
    CREATE TABLE ##CDB (ID INT, NAME NVARCHAR(800)) 
    DECLARE @TMP VARCHAR(MAX), 
            @V_MIN INT,
    @V_MAX INT,
    @V_COUNT INT
    SELECT @V_MIN=MIN(ID),@V_MAX=MAX(ID) FROM #ABC 
    SET @V_COUNT=@V_MIN
    WHILE @V_COUNT<=@V_MAX
    BEGIN
    SET @TMP = '' SELECT @TMP = @TMP + CONVERT(VARCHAR,NAME) + ', ' FROM #ABC 
    WHERE ID=@V_COUNT
    SELECT @V_COUNT AS ID ,CAST(SUBSTRING(@TMP, 0, LEN(@TMP)) AS VARCHAR(8000)) AS NAME INTO #TEMP 
    INSERT INTO ##CDB (ID, NAME) SELECT ID, NAME FROM #TEMP WHERE NAME<>''
    DROP TABLE #TEMP
    SET @V_COUNT=@V_COUNT+1
    END
    SELECT * FROM ##CDB
    Thanks Shiven:) If Answer is Helpful, Please Vote

  • Reg : Concatenation of a column value with multiple rows... URGENT

    Hello,
    Could any of u help me in concatenating a column value with
    multiple rows ???
    For ex : I've the following data from emp table :
    DEPTNO ENAME
    10 KING'S
    30 BLAKE
    10 CLARK
    10 TOM JONES
    30 ALLEN
    30 JAMES
    20 SMITH
    20 SCOTT
    20 MILLER
    10 MILLER
    20 rajeev
    I want the following output :
    deptno Concat_value
    10 KING'S,CLARK,TOM JONES,MILLER
    20 Rajeev,MILLER,SMITH,SCOTT
    30 BLAKE,ALLEN,JAMES
    Thanks in Advance,
    Srini

    Hello Naveen,
    Thanks for ur answer. But I need a single SQL query for getting
    what I want. I know the solution in PL/SQL.
    Please try it in a single SQL....
    Thanks again,
    Srini

  • Sort just one column

    Is it possible to just sort one column without all the other columns sorting? I want to be able to manipulate a list of students in different ways (orders) without the other column changing order. I ussed to used excel microsoft and I'm sure I was able to do this with that program. Does Numbers allow this?

    James,
    Copy the column that you wish to sort and Paste it to an open part of the Sheet's canvas. This will create a 1-column table. Sort it. Copy the sorted table and Paste it back where it came from. The easiest and most reliable way to Select an entire column for Copying or Pasting is to click on the column's Label.
    If you describe the entire table, it may be possible for us to suggest another approach.
    Jerry

  • Is it possible to search only one column in a multi column data store?

    Assume I create a context index using a multi column datastore for the columns first_name, middle_name, and last_name.
    Then I can search all of the columns in the index using contains().
    Is there any way to use contains() to just search one of the columns in a multi column datastore - just last_name for instance?
    In some cases a want to search all of the columns, in other cases just one of the columns.

    Yes, see the doc:
    http://download.oracle.com/docs/cd/B14117_01/text.101/b10730/cdatadic.htm#i1006391
    If you use the default behaviour, then your column data will be separated by XML-like tags.
    <first_name>John</first_name><middle_name>Peter</middle_name><last_name>Doe</last_name>
    You would then need to EITHER define each of these as sections, or use "auto_section_group". You can then search on them using
    ... contains (col, 'peter within middle_name') >0
    See example:
    SQL> drop table t;
    Table dropped.
    SQL> create table t (first varchar2(20), middle varchar2(20), last varchar2(20));
    Table created.
    SQL> insert into t values ('John', 'Peter', 'Doe');
    1 row created.
    SQL> insert into t values ('Peter', 'Frederik', 'Smith');
    1 row created.
    SQL> exec ctx_ddl.drop_preference('my_mcds')
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.create_preference('my_mcds', 'multi_column_datastore')
    PL/SQL procedure successfully completed.
    SQL> exec ctx_ddl.set_attribute('my_mcds', 'columns', 'first,middle,last')
    PL/SQL procedure successfully completed.
    SQL> create index ti on t (first) indextype is ctxsys.context
      2  parameters ('datastore my_mcds section group ctxsys.auto_section_group');
    Index created.
    SQL> select * from t where contains (first, 'peter')>0;
    FIRST               MIDDLE            LAST
    John               Peter            Doe
    Peter               Frederik            Smith
    SQL> select * from t where contains (first, 'peter within middle')>0;
    FIRST               MIDDLE            LAST
    John               Peter            Doe

Maybe you are looking for