Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stored procedure query string length problem

Status
Not open for further replies.

phokat

IS-IT--Management
Jan 24, 2003
3
0
0
US
Hi,
I have a stored procedure in which I query a table to build an insert string, which is of the nature...
insert into table1234 (col1, col2....col200)
select (col1, col2...col200)
from table4321
where table4321.col201 = table1234.col201

I use a procedure because the table name is passed as a variable, the proc can be called for multiple tables.

My problem is that this query is growing to about 2000+ characters and failing.

When I am trying to debug this query, I print out the length of the query in the loop as well as the query itself using the dbms_output.
As soon as the query crosses about 1000 character length, the query string is reset to an undefined variable, as if the whole query never existed!

Any workarounds ? I appreciate your help,

thank you,
preetesh
 
First of all this table is a good candidate for redesigning. Can you provide the code you're using to create query string? Regards, Dima
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top