Results 1 to 4 of 4

Thread: Jdbc

  1. #1
    KumbhaniMehul is offline Member
    Join Date
    Apr 2010
    Posts
    16
    Rep Power
    0

    Default Jdbc

    I hava a table
    Structure is (Item_ID varchar(10),....)

    now i want to access the last record value and i want to increment the value of Item_ID field.

    Please remember Item_ID is text(varchar) type.

    please give me complete Query.
    Last edited by KumbhaniMehul; 04-06-2010 at 06:59 PM. Reason: i am thinking that you can't understand my Question

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Please do not post the same question in multiple sub-forums. I've already give you the solution.

  3. #3
    KumbhaniMehul is offline Member
    Join Date
    Apr 2010
    Posts
    16
    Rep Power
    0

    Default

    ID is varchar type

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    Is that the only data column you have? If so it's not possible to do that in anyways of I've explain earlier. You must have int value to do that. Just think about, you cannot take a top value by ordering a text data, otherwise not in a sequence. It's really hard to guess that we have such a sequence in text data. So you have to introduce an IDENTITY column. Since your table is record transaction data you MUST those valued data like IDENTITY number, date, etc.

Similar Threads

  1. Jdbc
    By KumbhaniMehul in forum Java Servlet
    Replies: 1
    Last Post: 04-06-2010, 06:18 PM
  2. new to JDBC
    By hussainzim in forum JDBC
    Replies: 12
    Last Post: 05-01-2008, 11:34 AM
  3. Replies: 0
    Last Post: 04-01-2008, 10:17 AM
  4. Replies: 0
    Last Post: 09-28-2007, 12:56 PM
  5. Ha-jdbc 2.0
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 07-17-2007, 05:40 PM

Posting Permissions

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