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!

string literal too long

Status
Not open for further replies.

FranckM

Programmer
May 8, 2002
76
0
0
CA
string literal too long is the error I'm getting by using this code. I'm assuming this is because I'm creating a huge SQL statment. Is that the problem? IF so does anyone know how I could fix this? Thanks for taking the time to read, it's really appreciated.


do while icounter <= ubound(arrwords)
invalues = invalues & arrwords(icounter)
icounter = icounter + 1
if icounter = ubound(arrwords) then
tempSql = tempSql & strSQL & &quot; AND band_reserve.reserve_number IN ('&quot; & invalues & &quot;')&quot;
elseif counter = 253 then
tempSql = tempSql & strSQL & &quot; AND band_reserve.reserve_number IN ('&quot; & invalues & &quot;') union &quot;
invalues = &quot;&quot;
counter = 0
end if
counter = counter + 1
loop
 
You get the &quot;string literal too long&quot; error when executing your query or before that ? If the error comes from the
Code:
AND band_reserve.reserve_number IN (...)
clause, a way to think of it may be to replace it by a
Code:
not in
clause that contains only the reserve_numbers that are NOT in the arrwords array. This way assumes that you know exactlly all the reserve_numbers aviables before your loop. Water is not bad as long as it stays out human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top