Results 1 to 4 of 4

Thread: Oracle Dates

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2003
    Posts
    1

    Angry Oracle Dates

    I have been using Oracle as Back-end to my VB Project..During a database insertion routine when I try to insert a VB date field into the Oracle Database I get the following error :

    "Runtime Error '-2147467259(80004005)'

    [Oracle][ODBC][Ora]ORA-00932:Inconsistent Datatypes


    The SQL query string executed is given below :

    strQry = "insert into TAS_EMPLOYEE values ('" & ecode & "','" & ename & "','" & des & "','" & gid & "','" & sex & "','" & dob & "' ,'" & doj & " ','" & email & "'," & phone & ")"

    dob and doj are date fields...

    can somebody help..

    VR.

  2. #2
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    What are the values of the date variables when you try to use them in the query?

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  3. #3
    Frenzied Member swatty's Avatar
    Join Date
    Aug 2002
    Location
    somewhere on earth
    Posts
    1,478
    Can you show the value of strQry before executing it.

    And maybe show a datefields value of your db.
    Code:
    If Question = Incomplete Then
       AnswerNextOne
    Else
       ReplyIfKnown
    End If
    cu Swatty

  4. #4
    Addicted Member
    Join Date
    Jan 2001
    Location
    MPLS
    Posts
    187
    Try re-formating to dd-mmm-yyyy format before inserting the date values.

    strQry = "insert into TAS_EMPLOYEE values ('" & ecode & "','" & ename & "','" & des & "','" & gid & "','" & sex & "','" & Format(dob, "dd-mmm-yyyy") & "' ,'" & Format(doj, "dd-mmm-yyyy") & " ','" & email & "'," & phone & ")"

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