473,473 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

What is wrong with this SQL? Problem with Long Varchar column at create Table

Hi everyone,

I have been building a set of tables for a new database and having
problem with tables having columns defined as Long Varchar. Can
someone look this over and tell me what I am doing wrong with the
create statement shown below:

Error Msg:

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 "LONG_VARCHAR" was found following ",2), TX_SUB_GUARDIAN".
Expected tokens may include: "CHARACTER". SQLSTATE=42601

Create Statement:

CREATE TABLE "DB2T"."AGREEMENT" ( ID_CASE INTEGER not null, ID_PRSN
INTEGER not null, ID_AGRM INTEGER not null, CD_AGRM_TYPE INTEGER not
null, DT_AGRM TIMESTAMP not null,
TX_DOC_PATH VARCHAR(36), ID_CR INTEGER not null, TS_CR TIMESTAMP not
null, ID_UP INTEGER not null, TS_UP TIMESTAMP not null, AM_AGRMNT
DECIMAL(9,2), CD_SRVC INTEGER,

TX_SUB_GUARDIAN LONG_VARCHAR(4000),

DT_ESTIMATED_END TIMESTAMP,
ETL_INS_TS TIMESTAMP not null,
ETL_UPD_TS TIMESTAMP not null,

CONSTRAINT AGREEMENT_PK
PRIMARY KEY (ID_CASE,ID_PRSN,ID_AGRM) );
Thanking you all in advance.

Okonita

Sep 10 '07 #1
3 4267
<Ok*****@gmail.comwrote in message
news:11**********************@57g2000hsv.googlegro ups.com...
Hi everyone,

I have been building a set of tables for a new database and having
problem with tables having columns defined as Long Varchar. Can
someone look this over and tell me what I am doing wrong with the
create statement shown below:

Error Msg:

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 "LONG_VARCHAR" was found following ",2), TX_SUB_GUARDIAN".
Expected tokens may include: "CHARACTER". SQLSTATE=42601

Create Statement:

CREATE TABLE "DB2T"."AGREEMENT" ( ID_CASE INTEGER not null, ID_PRSN
INTEGER not null, ID_AGRM INTEGER not null, CD_AGRM_TYPE INTEGER not
null, DT_AGRM TIMESTAMP not null,
TX_DOC_PATH VARCHAR(36), ID_CR INTEGER not null, TS_CR TIMESTAMP not
null, ID_UP INTEGER not null, TS_UP TIMESTAMP not null, AM_AGRMNT
DECIMAL(9,2), CD_SRVC INTEGER,

TX_SUB_GUARDIAN LONG_VARCHAR(4000),

DT_ESTIMATED_END TIMESTAMP,
ETL_INS_TS TIMESTAMP not null,
ETL_UPD_TS TIMESTAMP not null,

CONSTRAINT AGREEMENT_PK
PRIMARY KEY (ID_CASE,ID_PRSN,ID_AGRM) );
Thanking you all in advance.

Okonita
That is not the correct syntax. Do you have an SQL manual?

But you should not use long varchar anyway since it will be unsupported in
future releases. Use VARCHAR instead. If you need something bigger than
VARCHAR (which is only a few bytes less than long varchar) then use a CLOB
or BLOB.
Sep 10 '07 #2
Ok*****@gmail.com wrote:
TX_SUB_GUARDIAN LONG_VARCHAR(4000),
LONG VARCHAR (no "_") and no (4000).
LONG VARCHAR has a fixed length.
BUT you shouldn't us ethe LONG types they are obsolete.
What you should use is either
VARCHAR(4000) with a bigger page size (DB2 can handle up to 32KB in a
row) or use CLOB.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Sep 10 '07 #3
On Sep 10, 6:51 am, Serge Rielau <srie...@ca.ibm.comwrote:
Okon...@gmail.com wrote:
TX_SUB_GUARDIAN LONG_VARCHAR(4000),

LONG VARCHAR (no "_") and no (4000).
LONG VARCHAR has a fixed length.
BUT you shouldn't us ethe LONG types they are obsolete.
What you should use is either
VARCHAR(4000) with a bigger page size (DB2 can handle up to 32KB in a
row) or use CLOB.

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Serge,

Thank you very much...it worked beautifully. The DDl was generated
from the Mainframe using Squirrel tool. When I did the same thing
using db2look, there was no LONG_VARCHARs generated.

Okonita

Sep 13 '07 #4

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

Similar topics

16
by: lkrubner | last post by:
Are there any benchmarks on how much an extra, unneeded VARCHAR, CHAR, INT, BIGINT, TEXT or MEDIUMTEXT slows down a database call with MySql? PostGre info would also be useful. I'm trying to...
12
by: jacob nikom | last post by:
Hi, I would like to store XML files in MySQL. What is the best solution: 1. Convert it to string and store it as CLOB/text 2. Serialize it and store as byte array 3. Flatten it out and create...
2
by: serge | last post by:
/* This is a long post. You can paste the whole message in the SQL Query Analyzer. I have a scenario where there are records with values pointing to wrong records and I need to fix them using an...
7
by: robertbrown1971 | last post by:
I just inherited a Java application with a fairly complex data model that does not yet have any indexes except those on primary keys. It is still in development and before I get to do any...
7
by: Yannick Turgeon | last post by:
Hello all, I'm using SS2K on W2k. I'v got a table say, humm, "Orders" with two fields in the PK: OrderDate and CustomerID. I would like to add an "ID" column which would be auto-increment...
6
by: Andreas | last post by:
Hello list, what about uniqueness of inherited primary keys ? eg you have : create table objects ( id int4, date_created timestamp(0), primary key (id)
14
by: Demetris | last post by:
Hello people! I have a table with more than 30 million rows,a lot of columns and indexes. We need to change a column which is dec(15,2) and nullable to have a default value of zero. As I know you...
2
by: Benzine | last post by:
I am running MS SQL 2000. I recently ran a procedure in Query Analyzer from the Master db to clear out all replication information so I could start/recreate it again. After I ran this...
1
by: Rudolf Bargholz | last post by:
Hi, We have created triggers to log modifications to tables in our application. The triggers work fine, just on one of the tables in our database the triggers fail with the error message...
0
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,...
0
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...
0
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,...
0
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...
0
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,...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.