Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Location
    Australia
    Posts
    46

    Question Unanswered: How to Retrieve Next Value from Field??

    Hi All,

    I have a table with a column called SRGTE_KEY_1 which is also referenced as an index with an Index name of EMDET_i0. The Data Type is Varbinary.

    I have a trigger when activated inserts data into this table. However my problem is that I need to determine what is the next available Varbinary value in the SRGTE_KEY_1 column so I can use this value with my Insert otherwise the trigger will Fail if I dont specify a Unique Value.

    What SQL statement/s can I write to be able to obtain the next Unique Value from this Column.

    A Step by Step procedure would be great as well as syntax. Thanks for your help.

    Regards
    Anthony

  2. #2
    Join Date
    Oct 2001
    Location
    England
    Posts
    426
    What do you mean by the next available value?
    If you mean treat it like an integer and add 1 then maybe it shouldn't be a varbinary.
    Or do you have a tabe which gives the available values?

  3. #3
    Join Date
    Jan 2003
    Location
    Australia
    Posts
    46
    By the next available value I mean any value that is not being used(thats what I mean by next available) so duplication wont occur. I'm not sure how to obtain this as its varbinary. I wouldn't have a problem if it was a numeric value, but I don't know about this data type.

Posting Permissions

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