ORA-01747: invalid user.table.column, table.column, or column specification
511330May 15 2006 — edited May 15 2006Hi All
I am new to Oracle but have some experience with Access and limited experience with SQL.
I am building a web app using ASP / VB and Oracle 10g Express.
I have a table with a PK of TableID that has a Seq , TABLE1_Seq
Here is the SQL for the table:
CREATE TABLE "TABLE1"
( "TABLEID" NUMBER NOT NULL ENABLE,
"1" VARCHAR2(4000),
"2" VARCHAR2(4000),
"3" VARCHAR2(4000),
"4" VARCHAR2(4000),
CONSTRAINT "TABLE1_PK" PRIMARY KEY ("TABLEID") ENABLE
)
/
CREATE OR REPLACE TRIGGER "BI_TABLE1"
before insert on "TABLE1"
for each row
begin
select "TABLE1_SEQ".nextval into :NEW.ID from dual;
end;
/
ALTER TRIGGER "BI_TABLE1" ENABLE
/
And for the Seq:
CREATE SEQUENCE "TABLE1_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE
/
And the trigger:
CREATE OR REPLACE TRIGGER "BI_TABLE1"
before insert on "TABLE1"
for each row
begin
select "TABLE1_SEQ".nextval into :NEW.ID from dual;
end;
/
ALTER TRIGGER "BI_TABLE1" ENABLE
/
All of these are just the generic that is compiled when creating the table with no changes.
This is the code I use in the ASP page to add the record:
<% Else
' no error was generated
If ("finalinsert" = Request("DoInsertFinally")) Then
' generate sql insert string for this entry
sql = "INSERT INTO TABLE1(TABLEID,1,2,3,4) values (TABLE1_SEQ.nextval,abc,def,ghi,jkl)"
Set DataConn = Server.CreateObject("ADODB.Connection")
DataConn.Open "Provider=MSDAORA;Data Source=127.0.0.1;User Id=****;Password=*****;"
Set cmdTemp = Server.CreateObject("ADODB.Command")
cmdTemp.CommandText = sql
cmdTemp.CommandType = 1
Set cmdTemp.ActiveConnection = DataConn
cmdTemp.Execute
Set cmdTemp = Nothing
Set DataConn = Nothing
%>
Unfortunately it Returns this Error and I would be grateful of any pointers as to where I am going wrong.
Microsoft OLE DB Provider for Oracle (0x80004005)
ORA-01747: invalid user.table.column, table.column, or column specification
Thanks in Advance
Tony