Rowstamp issue.
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Rowstamp issue.

  1. #1
    Join Date
    Mar 2004
    Posts
    55

    Question Rowstamp issue.

    I have the following query

    insert into tablex
    select rowstamp, col1,col2,col4
    from tablex2

    Now the issue is that the rowstamp in the first table is significantly greater than the rowstamp in the destination and i am not sure i want this huge difference in my destination table.

    Is there a way I can rowstamp the destination table with its next rowstamp and not the one from the source table.

    Obviously i can't drop the rowstamp in the query or i get a message saying that i do not have enough columns.

    Thanks

  2. #2
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Maybe a little more explanation is in order. How about data structures, sample data, a clear description of what you're trying to do?
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

  3. #3
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    90
    In your application there must be a function that generates unique rowstamps. Use it in your insert's values clause.
    I am about to do something similar. When a record is inserted in one table I need to insert a record in another table. I am going to have to snoop around the application's packages and see which function generates ct_recid (equivalent to your rowstamp). I will then use this function in an insert statement from a trigger.
    d

  4. #4
    Join Date
    Feb 2004
    Posts
    77
    if rowstamp is a nullable column...you can ignore rowstamp from the query by specifying column listing

    insert into tablex (column1, column2, column3)
    select col1, col2, col4
    from tablex2;

    then use some logic based on tablex2 to populate rowstamp later.

  5. #5
    Join Date
    Mar 2004
    Posts
    55
    My rowstamp column is not nullable. If i don't specify the rowstamp in my query than it throws up the message saying its not a nullable column.

    I looked through the oracle online doco and can't find much. Pretty much stuck.

    The table i am inserting into is a table that is continually getting rows inserted to is and hence its rowstamp increments. However i am not sure how to get it to increment from my own insert query.

    Surely there must be something?

  6. #6
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    90
    Mozart, like I said before there's either a sequence or a function that calls the sequence. You have to find it or you shouldn't be messing with this application.
    d

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width