473,287 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Strange error:An unexpected token ")" was found...Expected tokens may include: ")"

P
Hi all,

I'm trying to run the following code taken from
http://blogs.ittoolbox.com/database/...es/006045.asp#

select substr(tablespace_name,1,30) as "Tablespace Name",
case (tablespace_type)
when 0 then 'DMS'
else 'SMS'
end as "Type",
case (tablespace_state)
when 0 then 'Normal'
else 'Other ' || char(tablespace_state)
end as "State",
int((total_pages*page_size)/1024/1024) as "Size (Meg)",
smallint((float(free_pages) / float(total_pages))*100)
as "% Free Space",
int((free_pages*page_size) / 1024 / 1024)
as "Meg Free Space"
from db2$mon_tbs_cfg

It's suppose to find how much freespace is left for a tablespace. I
called the script freespace.sql. I tried to run it with the follownig
command:

db2batch -d SAMPLE -f freespace.sql

However, I recieved a strange error:

SQL0104N An unexpected token ")" was found following "ase
(tablespace_type".
Expected tokens may include: ")". SQLSTATE=42601
If it's expecting ")", why would it say ")" is unexpected?

Any idea is appreciated :)

Mar 21 '06 #1
2 19842
P wrote:
Hi all,

I'm trying to run the following code taken from
http://blogs.ittoolbox.com/database/...es/006045.asp#

select substr(tablespace_name,1,30) as "Tablespace Name",
case (tablespace_type)
when 0 then 'DMS'
else 'SMS'
end as "Type",
case (tablespace_state)
when 0 then 'Normal'
else 'Other ' || char(tablespace_state)
end as "State",
int((total_pages*page_size)/1024/1024) as "Size (Meg)",
smallint((float(free_pages) / float(total_pages))*100)
as "% Free Space",
int((free_pages*page_size) / 1024 / 1024)
as "Meg Free Space"
from db2$mon_tbs_cfg


Add a semicolon here (this is the default statement terminator for
db2batch):

;

Also make sure that the are no non-printable characters at the end of the
lines (like DOS EOL characters).

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Mar 21 '06 #2
P
Thanks Knut! It works :)

Mar 21 '06 #3

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

Similar topics

2
by: SaCompGeek | last post by:
I have a class that defines a Key/Name value collection that i generated by and XML Element with multiple attributes. The attribute are used to create the collection of 'Binate' objects. This is...
1
by: Najm Hashmi | last post by:
Hi all , I am trying to create a store procedure and I get the following error: SQL0104N An unexpected token "END-OF-STATEMENT" was found following "END". Expected tokens may include: "JOIN...
2
by: Gustavo Randich | last post by:
Hello, (Using DB2/LINUX 8.2.0) After compiling the STRIP migration UDF (found at http://www-106.ibm.com/developerworks/db2/library/samples/db2/0205udfs/), if I try to execute: values...
3
by: UnixSlaxer | last post by:
Hello All, While doing some TPC benchmark testing on DB2-UDB 8.2, I face the following problem when running this query: select * from lineitem where l_shipdate <= date '1998-12-01' -...
4
by: lisa | last post by:
I have an XML file that starts like this: <?xml version="1.0" encoding="ISO-8859-1" xmlns:fn="http://www.w3.org/2005/xpath-functions"?> <Authors> <Author> <ID>2</ID>...
2
by: =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post by:
Hi, has anyone come across this error before: This is an unexpected token. The expected token is 'NAME' I am getting it when trying to send an xml file across a web service layer. The...
0
by: vaibhavsumant | last post by:
<project name="DBCreate" default="usage" basedir="."> <property name="user" value="db2admin"/> <property name="passwd" value="db2admin"/> <property name="dbprefix" value=""/> <property...
3
by: flea2k | last post by:
I am trying to run this select statment against my DB2 database and it is throwing the following error, is there a setting in my db2 database to allow for this call "USE AND KEEP UPDATE LOCKS"? ...
1
by: Amjad Raza Gill | last post by:
I am facing this problem during the migration from oracle to db2, pls. help to remove this error. I am new to DB2. DB21034E The command was processed as an SQL statement because it was not a ...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.