473,385 Members | 1,796 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,385 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 19895
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 ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.