473,387 Members | 1,534 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,387 software developers and data experts.

Prepared statement too long

I have an SP that forms the create table ddl statement by going thro
the syscat tables, and also the indexes. We are using this in
production. I have declared a varchar of 6000 bytes which stores the
ddl, and prepare stmt1 and execute it. It worked well on all tables
except one that is really big, that has 200+ column it throws the
SQL0433N value "create table...." is too long.

I've changed the stmtheap to 10 k and still no joy. Please help
Nov 17 '08 #1
2 2771
Arun Srinivasan wrote:
I have an SP that forms the create table ddl statement by going thro
the syscat tables, and also the indexes. We are using this in
production. I have declared a varchar of 6000 bytes which stores the
ddl, and prepare stmt1 and execute it. It worked well on all tables
except one that is really big, that has 200+ column it throws the
SQL0433N value "create table...." is too long.

I've changed the stmtheap to 10 k and still no joy. Please help
We need more context. How is the CREATE TABLE glues together?
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Nov 17 '08 #2
On Nov 17, 4:52*pm, Serge Rielau <srie...@ca.ibm.comwrote:
Arun Srinivasan wrote:
I have an SP that forms the create table ddl statement by going thro
the syscat tables, and also the indexes. We are using this in
production. I have declared a varchar of 6000 bytes which stores the
ddl, and prepare stmt1 and execute it. It worked well on all tables
except one that is really big, that has 200+ column it throws the
SQL0433N *value "create table...." is too long.
I've changed the stmtheap to 10 k and still no joy. Please help

We need more context. How is the CREATE TABLE glues together?

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
What I did was to get the code for the copy_schema procedure that db2
uses and tweaked it so as to include primary key definitions and use
command line parameters for table/index space.
So I use a for statement, use the syscat.columns and glue each column
with its definition
like
set txt = txt || colname ......
at last, I get the complete create table statement, and
prepare stmt1 from txt
execute stmt1
is all I do, it had been working fine. I had deadlocking problems
initially, then I manually spaced the sp timing.

So this table claims_common is a denormalized one containing 232
columns, and so the statement goes well over 4000 characters. I have
changed the stmtheap, also the variable declaration og the 'txt' to
accomodate big DDLs, still no joy.

As a band aid solution (I don't know if this ought to have been used
in the first place), what I've done is to comment out that code and do
a create table <like <in <index in <statement, and it works
fine for now.
All I am concerned is the future, if something like this happens
again.The 0433N is bugging me now.

Nov 17 '08 #3

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

Similar topics

0
by: David.Tymon | last post by:
>Description: MySQL v4.1.0-alpha only allows a client to prepare a maximum of 254 statements. On the 255th mysql_prepare() call, a failure is returned with no information returned by...
1
by: Tom D | last post by:
I'm rewriting a database interface that our company currently has. Currently it's using the Pear::DB interface, but we found that that was introducing a bit too much overhead. I'm rewriting the...
0
by: phil | last post by:
I am having a problem with the C api with prepared statements, the data recorded in the database does not match the data I am sending. It seems to be some sort of bit shifted version of the data,...
0
by: Prashanth | last post by:
I am getting this error from BEA DB2 Driver in weblogic console. java.sql.SQLException: CURSOR C02 NOT IN A PREPARED STATE java.sql.SQLException: CURSOR C02 NOT IN A PREPARED STATE We keep...
2
by: Cyril VELTER | last post by:
I'm converting an application to use the V3 protocol features in the 7.4 libpq. As I need to make a design choice regarding the use of prepared statements, I'm wondering what ressources does a...
3
by: birju | last post by:
Hi, I'm running SQL Profiler on an SQL Server 2000 database. I see that one stored procedure gets repeatedly executed having a handle of '1'. This query takes a long time to complete. How do I...
2
by: ojorus | last post by:
Hi! Some questions regarding the mysqli-extension (php5) 1) Prepared statements: If I understand things right, prepared statements will give better performance if you make several similar...
1
by: kaushikm | last post by:
How to access sql server inbuilt functions from java prepared statement ? I have used getdate() of sql in a java prepared statement and am connecting to sqlserver. But it's not working. What to do ?
4
by: TechieGrl | last post by:
Prepared statements are new to me and having to do this with a multi- dimensional array is beyond me. Here is the prepared statement block: // Prepare to insert a record into table1...
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...
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
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...

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.