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

    Unanswered: ORA-00984 (Column Not Allowed Here)

    I am using VB to insert a row into a database. When I do so, I get the error listed in the subject. I guess the first thing to do is to figure out what it is so can someone tell me what causes this? Secondly, here is the code in question:

    Code:
    Private Sub Create_Quote() 
        'Create Connection Object 
        Set OraCon = CreateObject("ADODB.Connection") 
        OraCon.ConnectionString = "Provider=OraOLEDB.Oracle;" & _ 
                              "Data Source=QSDB;" & _ 
                              "User ID=QSDB_USER;" & _ 
                              "Password=5star5" 
        'Open Connection 
        OraCon.Open 
        'Create Recordset Selecting all Customer Names 
        'SQLQuery = "SELECT QUOTE_NUM,QUOTE_COMP,QUOTE_CREATOR,QUOTE_MODIFIER," & _ 
        '"QUOTE_SELLER,QUOTE_BUYER,QUOTE_PO_NUM,QUOTE_PART_NUM,QUOTE_PART_NAME," & _ 
        '"QUOTE_C_DATE,QUOTE_M_DATE from QUOTES" 
        'Set OraRec = New ADODB.Recordset 
        'OraRec.Open SQLQuery, OraCon, adOpenStatic, adLockOptimistic, adCmdText 
        OraCon.Execute "INSERT INTO QUOTES (QUOTE_NUM,QUOTE_COMP,QUOTE_CREATOR," & _ 
        "QUOTE_MODIFIER,QUOTE_SELLER,QUOTE_BUYER,QUOTE_PO_NUM,QUOTE_PART_NUM," & _ 
        "QUOTE_PART_NAME,QUOTE_C_DATE,QUOTE_M_DATE,QUOTE_REV) VALUES ('" & txtQuoteNum.Text & "','" & _ 
        cmbCustomer.Text & "','" & txtEstimator.Text & "','" & txtEstimator.Text & "','" & _ 
        cmbSeller.Text & "','" & cmbBuyer.Text & "','" & txtPONum.Text & "','" & _ 
        txtPartNum.Text & "','" & txtPartName.Text & "'," & Format(Now, "dd-mmm-yyyy") & "," & Format(Now, "dd-mmm-yyyy") & ",'" & txtRevision.Text & "')" 
    End Sub
    Thanks, Jeremy
    Nothing better than a good ride.

  2. #2
    Join Date
    Jan 2003
    Posts
    18
    Hi Jeremy,
    This error occurs when a column name was used in the VALUES clause of an INSERT statement.So please check that first.

    Regards,
    Senthil

  3. #3
    Join Date
    Oct 2005
    Posts
    1

    ORA-00984 (Column Not Allowed Here)

    Hi there,

    Had a similar problem today (using ASP and Oracle) and came across your post. Managed to solve the problem, this is just incase anyone else comes across this post.

    My insert statement read like this :
    INSERT INTO SMS_GROUP VALUES ( 77 , 777 , SOMETEXTHERE , 120 )
    I changed my ASP CODE so the output read as follows
    INSERT INTO SMS_GROUP VALUES ( 77 , 777 , 'SOMETEXTHERE', 120 )

    So I guess another tip is to make sure that text is enclosed in 'apostrophes' !

Posting Permissions

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