02-04-03, 23:10 #1Registered User
- Join Date
- Feb 2003
- In your thoughts
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:
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 SubNothing better than a good ride.
02-05-03, 04:17 #2Registered User
- Join Date
- Jan 2003
This error occurs when a column name was used in the VALUES clause of an INSERT statement.So please check that first.
10-19-05, 06:19 #3Registered User
- Join Date
- Oct 2005
ORA-00984 (Column Not Allowed Here)
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' !