Connecting Tech Pros Worldwide Help | Site Map

SQL0104N on insert of consecutive NULLs

Mark McNary via DBMonster.com
Guest
 
Posts: n/a
#1: Nov 12 '05
I have a developer getting a SQL0104N on an insert statement. He is
inserting a list of values into a table and instead of putting 'NULL' into
the statement, the program just puts a placeholder comma. He is getting
the following error:

SQL ERROR ->[IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token ",,"
was found following "000000,0.000000,0,0,". Expected tokens may include:
"<rvc_element>". SQLSTATE=42601

The two commas in the unexpected token field are supposed to be inserted as
NULL into NULLable columns.

I do not recall ever seeing this error raised for this condition before.
We are runing DB2 V7.2 fixpack 4 on Intel under Windows 2K.

--
Message posted via http://www.dbmonster.com
Anton Versteeg via DBMonster.com
Guest
 
Posts: n/a
#2: Nov 12 '05

re: SQL0104N on insert of consecutive NULLs


You have to include NULL if the column should be nulled, or if you have for
instance a table with 3 columns do an insert into tablex(col1,col2) values
(val1,val2) to leave col3 null.

--
Message posted via http://www.dbmonster.com
Knut Stolze
Guest
 
Posts: n/a
#3: Nov 12 '05

re: SQL0104N on insert of consecutive NULLs


Mark McNary via DBMonster.com wrote:
[color=blue]
> I have a developer getting a SQL0104N on an insert statement. He is
> inserting a list of values into a table and instead of putting 'NULL' into
> the statement, the program just puts a placeholder comma. He is getting
> the following error:
>
> SQL ERROR ->[IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token ",,"
> was found following "000000,0.000000,0,0,". Expected tokens may include:
> "<rvc_element>". SQLSTATE=42601
>
> The two commas in the unexpected token field are supposed to be inserted
> as NULL into NULLable columns.[/color]

This is just a plain syntax error. DB2 doesn't know that you really meant
what you wrote and it also doesn't know the exact semantics that you want
to have applied. Have a look here for the syntax supported by INSERT:
http://publib.boulder.ibm.com/infoce...n/r0000970.htm

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Closed Thread


Similar DB2 Database bytes