473,883 Members | 1,690 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL 103 - "Numeric literal invalid" on SELECT *, but not SELECT a,b,c

2 New Member
Hi,
I'm encountering a strange error after an upgrade has been run on a test site. Attempting to
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM table
or even just entering
Expand|Select|Wrap|Line Numbers
  1. SELECT *
(no table specified) returns the following error:
Expand|Select|Wrap|Line Numbers
  1. SQL0103N The numeric literal "1234_upgrade" is not valid. SQLSTATE=42604
The only place that I could see that coming from is the name of the folder the database was backed up to before the upgrade. I did a search within files of the upgrade scripts, and then of the entire DB2 user's directory (where the scripts, backups and DB2 data files all reside), and the string "1234_upgra de" only appears in the db2rhist files, and .bash_history in the commands used to backup the database.

I can still select individual columns just fine, such as
Expand|Select|Wrap|Line Numbers
  1. SELECT a,b,c FROM table
  2. --or
  3. SELECT DISTINCT a FROM table
Most or all of our queries explicitly specify the columns (as in the example above), so the test site still works. However, I'd like to resolve this issue, as it's quite the anomaly.

I believe that somewhere DB2 is picking up on the "1234", and somehow classifying it as numeric, then encountering the "_upgrade", but still treating it as numeric and throwing the error. I've looked at all the update scripts, and they consist of ALTER, INSERT, UPDATE and IMPORT statements - nothing exotic.

The DB2 manual provides little insight, as the error messages don't give me any hints as to where the problem might be.

"User Response:

Correct the invalid numeric literal. Federated system users, if the error occurred in a pass-through session, determine what data source is causing the error (see the problem determination guide for the failing data sources). Examine the SQL dialect for that data source to determine which literal representation rule has been violated, and adjust the failing statement as needed."
Thank you for your time and assistance,
-T. Dickerson

Following is the (cleansed) bash history of the commands that were used:
Expand|Select|Wrap|Line Numbers
  1. cd /home/db2inst1/1234_upgrade/backups
  2. gunzip CAREBEAR.0.db2inst1.NODE0000.CATN0000.20080722175447.001.gz > \
  3. CAREBEAR.0.db2inst1.NODE0000.CATN0000.20080722175447.001
  4. ls
  5. db2 connect to carebear
  6. db2 "force application (230)" db2 list applications
  7. db2 restore db carebear
  8. cd
  9. db2 connect to carebear
  10. db2 -vf db2_1233_1234_upgrade.sql -t > scriptout.txt
  11. vi scriptout.txt
  12. db2 -vf stares_change.sql -t
  13. db2 "import from stares.csv of del insert into stares" db2 -vf stares_setup.sql -t > output.txt
  14. vi output.txt
  15. db2 -vf dropconst.sql -t
  16. db2 -vf restoreconst.sql -t
  17. db2 "delete from beastly" db2 "import from beastly.ixf of ixf insert into beastly" db2 list active databases
  18. db2 list database directory
  19. exit
Topic also posted here: http://www.ibm.com/developerworks/fo...20379&tstart=0
Aug 6 '08 #1
3 20049
docdiesel
297 Recognized Expert Contributor
Hi,

as far as I can see you're working from within a shell. Seems to me you tried the SELECT without using double quotes:

Expand|Select|Wrap|Line Numbers
  1. shellprompt# db2 SELECT * FROM my.table
In this case the shell is interpreting the asterisk * and replaces it with the names of the directories and files found in the current directory. Add some double quotes to your statement or escape the asterisk, so that the shell is told to pass the * through to the db2 binary:
Expand|Select|Wrap|Line Numbers
  1. shellprompt# db2 "SELECT  * FROM my.table"
  2. shellprompt# db2  SELECT \* FROM my.table
Regards,

Bernd
Aug 7 '08 #2
tdickerson
2 New Member
Hi,

as far as I can see you're working from within a shell. Seems to me you tried the SELECT without using double quotes:

Expand|Select|Wrap|Line Numbers
  1. shellprompt# db2 SELECT * FROM my.table
In this case the shell is interpreting the asterisk * and replaces it with the names of the directories and files found in the current directory. Add some double quotes to your statement or escape the asterisk, so that the shell is told to pass the * through to the db2 binary:
Expand|Select|Wrap|Line Numbers
  1. shellprompt# db2 "SELECT  * FROM my.table"
  2. shellprompt# db2  SELECT \* FROM my.table
Regards,

Bernd
Thanks for the suggestion, but this also occurs within the DB2 CLP, and with quotes.
Aug 7 '08 #3
docdiesel
297 Recognized Expert Contributor
Hi,

this behaviour is quiet, hm, interesting. Did you ever check what happens if you rename the folder from 1234_upgrade to just 1234 ? Or is the folder already gone and it's name persists just in the log and history files?

Regards,

Bernd
Aug 11 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3479
by: BillCo | last post by:
I've been running a text-to-table import as part of a daily routine for years and I've just added a few new fields and updated the import spec. The strange thing is that it works perfectly when importing to a local table, but once I try to run it on an identical linked table it spits up a "numeric field overflow" error. In the past it has imported to the linked table with no problems, but it's been doing this since I increased the number...
13
2524
by: baumann.Pan | last post by:
when define char *p = " can not modify"; p ='b' ;is not allowed, but if you declare p as char p = "can modify"; p = 'b'; is ok? why?
1
1233
by: Pascual ataeda | last post by:
Hello, According to the MSDN documentation, FieldInfo.GetValue throws a NotSupportedException if “A field is marked literal, but the field does not have one of the accepted literal types”. What are the accepted literal types? What are the unaccepted literal types?
2
3225
by: Vinod I | last post by:
Hi Team, When I tryed following code, I am getting the Runtime Error as "The View State is invalid for this page and might be corrupted." Exception Details: System.Web.HttpException: The View State is invalid for this page and might be corrupted. Stack Trace: System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +150 System.Web.UI.Page.LoadPageViewState() +16
6
2241
by: ern | last post by:
printf("C:\myfile.txt"); prints as C:myfile.txt How do I specify string literal ?
10
5381
by: fei.liu | last post by:
Consider the following sample code char * ptr = "hello"; char carray = "hello"; int main(void){ } What does the standard have to say about the storage requirement about ptr and carray? Is it a fair statement that char *ptr will take 4 more bytes (on 32bit platform) in DATA segment? I have found
8
9275
by: fredo | last post by:
This question was asked in comp.lang.javascript with no result. In IE5.x and IE6, I want to display an image when the user rolls over a text link. The image does indeed display, but only on the first rollover. It seems that the image height and width become set to zero after the image is displayed once; or perhaps that the height:expression(eval(...)); code is executed only once for each page load/reload. problem demo:
5
14340
by: Grant Edwards | last post by:
I'm trying to use the py-gnuplot module on windows, and have been unable to get it to work reliably under Win2K and WinXP. By default, it uses popen(gnuplotcmd,'w'), but in some situations that consistently gets an "invalid operand" IOError when write() is called on the pipe. So I switched to subprocess. It works fine when executed "normally" (e.g. "python progname.py"), but when bundled by py2exe, it always does this:
3
3704
BeemerBiker
by: BeemerBiker | last post by:
I tried the following that didnt work "c:\\new.mdb" 'c:\\new.mdb' "c:\\new\.mdb" So far, the only thing that worked is "c:\\new" but I had to rename the destination access database to get rid of the .mdb Here is a sql command that works just fine when giving it to the access wizard to execute as a query. It copies 3 columns from one database to another. INSERT INTO AvailableCourses ( , Grouping, )
0
11123
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
10734
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
10836
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
9567
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7960
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
5982
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4606
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4211
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3230
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.