473,654 Members | 3,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Strange error:An unexpected token ")" was found...Expecte d 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(tablespa ce_name,1,30) as "Tablespace Name",
case (tablespace_typ e)
when 0 then 'DMS'
else 'SMS'
end as "Type",
case (tablespace_sta te)
when 0 then 'Normal'
else 'Other ' || char(tablespace _state)
end as "State",
int((total_page s*page_size)/1024/1024) as "Size (Meg)",
smallint((float (free_pages) / float(total_pag es))*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_typ e".
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 19993
P wrote:
Hi all,

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

select substr(tablespa ce_name,1,30) as "Tablespace Name",
case (tablespace_typ e)
when 0 then 'DMS'
else 'SMS'
end as "Type",
case (tablespace_sta te)
when 0 then 'Normal'
else 'Other ' || char(tablespace _state)
end as "State",
int((total_page s*page_size)/1024/1024) as "Size (Meg)",
smallint((float (free_pages) / float(total_pag es))*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
16287
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 writte in VB.NET 1.1. I have this class in a Win32 test application and it works fine. Whe I put the class in a Web app I get the following error. The assembl it is in is not directory in the ASP.NET application but in one tha the ASP.NET...
1
30248
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 <joined_table> Explanation: A syntax error in the SQL statement was detected at the specified token following the text "<text>". The "<text>" field indicates the 20 characters of the SQL statement that preceded the token
2
2771
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 char(STRIP('0000345.50','L','0'),20) @
3
6952
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' - interval '69' day (3)
4
8967
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> <UserName>Whoever</UserName> <Title>Whatever</Title> <Internet>email</Internet>
2
3122
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 xml file is well formed, having been checked with XmlSpy. The size of the file is roughly 119KB. I think it was written in MS Word and the HTML is
0
4247
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 name="driver" value="COM.ibm.db2.jdbc.app.DB2Driver"/> <property name="starturl" value="jdbc:db2:temp"/> <property name="db2dir" location="${basedir}/../../../../.." /> <target name="CreateTestData" > <echo message="in mydbs db2dir = ${db2dir}" />
3
5449
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"? SELECT * FROM user.tableA WHERE FIRST_NAME ='Billy' WITH RS USE AND KEEP UPDATE LOCKS SQL0104N An unexpected token "USE AND KEEP UPDATE LOCKS" was found following "Billy' WITH RS". Expected tokens may
1
10898
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 valid Command Line Processor command. During SQL processing it returned: SQL0104N An unexpected token "" was found following "". Expected tokens may include: "". LINE NUMBER=27. SQLSTATE=42601 CONNECT TO MIGT USER db2inst USING db2inst;...
0
8372
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
8814
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
8706
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
8475
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
7304
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
6160
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
5621
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2709
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
1
1915
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.