Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2003
    Location
    In your thoughts
    Posts
    195

    Unanswered: ORA-01438 Value larger than ...

    Please go here to see a post that has already been submitted:

    http://www.vbforums.com/showthread.p...hreadid=236823

    Anyone know why I'm getting this error? Thanks, Jeremy
    Nothing better than a good ride.

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: ORA-01438 Value larger than ...

    Originally posted by JCScoobyRS
    Please go here to see a post that has already been submitted:

    http://www.vbforums.com/showthread.p...hreadid=236823

    Anyone know why I'm getting this error? Thanks, Jeremy
    Well, I see this in there:

    [SIZE=1]
    RTCon.Execute "INSERT INTO RT (RT_COST_TYPE,RT_CRDATE,RT_EXP_SCRAP," & _
    "RT_EXP_YIELD,RT_IMKEY,RT_LINK_GRP,RT_MDDATE,RT_MU LT_GRP,RT_MULT_SEQ," & _
    "RT_OP_NUM,RT_OVL_QTY,RT_OVL_SW,RT_REV,RT_RUN_COST ,RT_RUN_OFFSET," & _
    "RT_RUN_STD,RT_RUN_SW,RT_SCHED_QTY,RT_SEQNUM,RT_SE T_OFFSET,RT_SETUP,RT_SETUP_COST," & _
    "RT_TMP,RT_WCKEY) VALUES ('" & WCRec!WC_VALUED & "'," & _
    ...
    WCRec!WC_VALUED = 80
    ...
    RT_COST_TYPE VARCHAR2(1)
    It appears you are trying to insert 2 chars into a 1-char column?

  3. #3
    Join Date
    Feb 2003
    Location
    In your thoughts
    Posts
    195
    I'll check that out and get back to you. That would explain it but after hours of looking at code, I don't seem to be as sharp as when the day started. Thanks, Jeremy
    Nothing better than a good ride.

  4. #4
    Join Date
    Feb 2003
    Location
    In your thoughts
    Posts
    195
    The post I sent you to is erroneous. The value being inserted into RT_COST_TYPE = H. Does anything else look out of order? Thanks, Jeremy
    Nothing better than a good ride.

  5. #5
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Originally posted by JCScoobyRS
    The post I sent you to is erroneous. The value being inserted into RT_COST_TYPE = H. Does anything else look out of order? Thanks, Jeremy
    Nothing else shouts out. What does the SQL look like if you change "RTCon.Execute" to "Response.Write" ?

    A couple of irrelevant comments:

    1. Why are you using a combination of number of seconds since 01/01/1901 and a random number to generate a unique value for RT_SEQNUM? Why not just use an Oracle sequence - quicker and more reliable?

    2. Any real application should use bind variables, otherwise performance will be BAD - for all users on the database, not just for your application.

    3. If the VB variable names bore more of a resemblance to the column names in the table, it would be a lot easier to follow the code

  6. #6
    Join Date
    Feb 2003
    Location
    In your thoughts
    Posts
    195
    I figured it out, I was inserting '100' for RT_EXP_YIELD where I should had only been inserting '1'. Thanks, Jeremy
    Nothing better than a good ride.

  7. #7
    Join Date
    Feb 2003
    Location
    In your thoughts
    Posts
    195
    Originally posted by andrewst
    Nothing else shouts out. What does the SQL look like if you change "RTCon.Execute" to "Response.Write" ?

    A couple of irrelevant comments:

    1. Why are you using a combination of number of seconds since 01/01/1901 and a random number to generate a unique value for RT_SEQNUM? Why not just use an Oracle sequence - quicker and more reliable?

    2. Any real application should use bind variables, otherwise performance will be BAD - for all users on the database, not just for your application.

    3. If the VB variable names bore more of a resemblance to the column names in the table, it would be a lot easier to follow the code
    Great ideas but with my knowledge being small on VB, I don't know how to do some of that. I am learning as I go and I have learned alot in the past 2 months but I'm still new to ADO. Can you explain something to me?

    Question

    If I have a form and I tie each TextBox to a Column in a recordset. I open the recordset. I make changes to some TextBoxes. If I do a Recordset.Update, will it reflect the changes? Thanks, Jeremy
    Nothing better than a good ride.

  8. #8
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Originally posted by JCScoobyRS
    Great ideas but with my knowledge being small on VB, I don't know how to do some of that. I am learning as I go and I have learned alot in the past 2 months but I'm still new to ADO. Can you explain something to me?

    Question

    If I have a form and I tie each TextBox to a Column in a recordset. I open the recordset. I make changes to some TextBoxes. If I do a Recordset.Update, will it reflect the changes? Thanks, Jeremy
    I can't help with that, my knowledge of ADO is not great either - maybe try posting that question in the ASP forum.

    As far as my suggestions are concerned:

    1. To use a sequence for a unique key:

    a) In database: CREATE SEQUENCE my_seq;

    b) In code:
    "INSERT INTO my_table (col1) VALUES (my_seq.NEXTVAL)"

    2. To use bind variables - see attachment for an example. In brief you use "?" as a placeholder in the SQL then assign values via parameters. This is VITAL if your application is anything more than a toy - ask your Oracle DBA!

  9. #9
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Here's that attachment (I hope???)
    Attached Files Attached Files

Posting Permissions

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