ORA-01036 illegal variable name/number

ORA-01036 illegal variable name/number

Postby nmertens » Tue 18 Aug 2009 09:19

Hi folks!

I have to insert new rows with a ASPxGridView (DevExpress) and get the ORA-01036 error.

-DB connection: TNS-NAMES v.11 client or direct (always the same).

-Table EMP from SCOTT

-INSERT command: INSERT INTO SCOTT.EMP (ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) VALUES (:ENAME, :JOB, :MGR, :HIREDATE, :SAL, :COMM, :DEPTNO)

-Parameters are generated.


ASP-Code:
3 AutoGenerateColumns="False" DataSourceID="OracleDataSource1"
KeyFieldName="EMPNO">









VisibleIndex="1">























ConnectionString="User Id=scott;Password=tiger;Server=TLRZ0006;Direct=True;Sid=ORCLFN9I;Persist Security Info=True;"
DeleteCommand="DELETE FROM SCOTT.EMP WHERE ((EMPNO = :Original_EMPNO))"
InsertCommand="INSERT INTO SCOTT.EMP (ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) VALUES (:ENAME, :JOB, :MGR, :HIREDATE, :SAL, :COMM, :DEPTNO)"
OldValuesParameterFormatString="Original_{0}" SelectCommand="select * from emp"
UpdateCommand="UPDATE SCOTT.EMP SET ENAME = :ENAME, JOB = :JOB, MGR = :MGR, HIREDATE = :HIREDATE, SAL = :SAL, COMM = :COMM, DEPTNO = :DEPTNO WHERE ((EMPNO = :Original_EMPNO))">


























Please, what can I do?

N.M.
nmertens
 
Posts: 2
Joined: Tue 18 Aug 2009 06:55

Postby Shalex » Thu 20 Aug 2009 11:41

1. Please change the ReadOnly property for the EMPNO field of your ASPxGridView to False:

VisibleIndex="1">

2. The Insert command of OracleDataSource should be the following:

INSERT INTO SCOTT.EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) VALUES (:EMPNO, :ENAME, :JOB, :MGR, :HIREDATE, :SAL, :COMM, :DEPTNO)

3. Please don't forget to add the EMPNO parameter to the collection of InsertParameters:



Please notify us about the results.
Shalex
Devart Team
 
Posts: 7293
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle