If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > SQL statement empty or blank Error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-23-05, 19:34
cthornhi cthornhi is offline
Registered User
 
Join Date: Feb 2005
Posts: 8
SQL statement empty or blank Error

I currently have multiple dynamic queries created and everything is working great except in one of my stored procedures. I keep receiving the error "...SQL statement empty or blank...During precompiling, the SQL statement referred to has no text between the EXEC SQL and the ending delimiter..."

This doesn't make sense because I'm not doing anything different than my other files. I've even tried to copy/paste a statement from a different procedure, which has ran without a problem, and I receive the same error. Any ideas?

(example)
DECLARE STMT varchar(1000);
SET STMT = 'UPDATE '||TableParm||' SET x=?...';
PREPARE s1 FOR STMT;
EXECUTE s1 USING PARM1;
Reply With Quote
  #2 (permalink)  
Old 02-24-05, 01:24
grofaty grofaty is offline
Registered User
 
Join Date: Jan 2003
Posts: 1,570
Hi,

Can you post error message? Please alo read Must Read before posting for any other tip.

Grofaty
Reply With Quote
  #3 (permalink)  
Old 02-24-05, 14:06
cthornhi cthornhi is offline
Registered User
 
Join Date: Feb 2005
Posts: 8
Found the problem...

One of the variables I was passing to my string was empty. I didn't realize it was being cleared out before being used.

It would help if the error messages could be more clear and provide a bit more information. I guess I'll know for next time.

Thank you!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On