473,788 Members | 2,787 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL0104N on insert of consecutive NULLs

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.00000 0,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
Nov 12 '05 #1
2 5754
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,col 2) values
(val1,val2) to leave col3 null.

--
Message posted via http://www.dbmonster.com
Nov 12 '05 #2
Mark McNary via DBMonster.com wrote:
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.00000 0,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.


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
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3928
by: collincm | last post by:
Hi, I am trying to optimize a table for inserts. Half of the timeron cost is in the FK lookup! These tables for example CREATE TABLE FOO2( FOO2_ID INTEGER NOT NULL CONSTRAINT FOO2_PK PRIMARY KEY, DATA VARCHAR(200) NOT NULL, LASTTIME TIMESTAMP NOT NULL);
4
2275
by: chambersdon | last post by:
I have an application that needs to insert nulls into the database and I don't seem to be able to do this. I am currently trying to do this with a Typed DataSet but I can't seem to Insert Nulls (or udpate columns with a null value). I have a column in a test table called 'anInteger'. The Typed DataSet for this element has minOccurs="0" and the type = xs:int. To set this field to null I call the SetanIntegerNull method of my typed...
5
4074
by: robecflo | last post by:
Hi Forum, i have a problem, hope somebody can give me ideas. I'm developing with windows forms and vb.net, and oracle as a database. At this moment i have a table called amortizaciones, this table has a field called id_pasivo, which is foreign key to another table called pasivo, a consecutive field called no_cupon and a third field called date. So when i make a query (i.e select * from amortizaciones where id_pasivo = 522 order by...
3
3731
by: teddysnips | last post by:
I need a trigger (well, I don't *need* one, but it would be optimal!) but I can't get it to work because it references ntext fields. Is there any alternative? I could write it in laborious code in the application, but I'd rather not! DDL for table and trigger below. TIA
11
28358
by: Ted | last post by:
OK, I tried this: USE Alert_db; BULK INSERT funds FROM 'C:\\data\\myData.dat' WITH (FIELDTERMINATOR='\t', KEEPNULLS, ROWTERMINATOR='\r\n');
0
3768
by: varac | last post by:
Hi list, I am new to mysql and would appreciate any advice that you have to offer. I am attempting to batch insert 100 rows into a table, and I need to know the 100 id's of all the inserted rows. I know that I can find the id of the last inserted row despite my app being multi-threaded, since the select last inserted command is connection-specific.
4
4395
by: Justin | last post by:
Excuted the statement through a SSH connection: db2 import from <filename.ixfof ixf messages /database/stage/ acct_news_asc.txt insert into userid.acct_news_asc And it worked fine. Ran the same command through perl and received an error: SQLErr: SQL0104N An unexpected token "/database/stage/acct_news_asc.txt" was found following
1
2541
by: kfwolf | last post by:
Excuted the statement through a SSH connection: db2 load from <filename.ixf> of ixf messages /database/stage/ acct_news_asc.txt insert into userid.acct_news_asc And it worked fine. Ran the same command through perl and received an error:
1
7268
by: Justin | last post by:
We had a load that failed. Now we have a pending load. When executing load terminate, we receive the following error: db2 load terminate SQL0104N An unexpected token "terminate" was found following "LOAD". Expected tokens may include: "QUERY". SQLSTATE=42601 db2 query load terminate DB21034E The command was processed as an SQL statement because it was
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9498
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10366
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10173
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.