Oracle Question

Discussion in 'OT Technology' started by XtremelyCanadian, Apr 1, 2003.

  1. XtremelyCanadian

    XtremelyCanadian I play hockey.....EH

    Joined:
    Jan 4, 2002
    Messages:
    1,801
    Likes Received:
    0
    Location:
    Edmonton,Canada
    Ok, this is kinda confusing i know, but bear with me. I am entering data into a table that has a primary key (ProductTypeID) and one other value(Description). I am using a sequence to create the primary key number and the other value is just a varchar. The problem is, the ProductTypeID is a foreign key in another table which i insert just after the first insert. Is there any way to bring back the ProductTypeID after i insert it, so that i can insert that newly created number into the next table???

    I tried Seq_ProductTypeID.currval, but it doesnt seem to be working. Any other way of doing this, im stumped??
     
  2. CyberBullets

    CyberBullets I reach to the sky, and call out your name. If I c

    Joined:
    Nov 13, 2001
    Messages:
    11,865
    Likes Received:
    0
    Location:
    BC, Canada/Stockholm, Sweden
    could u post ur sql statment?
     
  3. XtremelyCanadian

    XtremelyCanadian I play hockey.....EH

    Joined:
    Jan 4, 2002
    Messages:
    1,801
    Likes Received:
    0
    Location:
    Edmonton,Canada
    I figured it out, im just going to store the next value of the sequence in a variable and insert that, THANKS ANYWAYS!!
     

Share This Page