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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Table Number is Invalid" error run from Select statement 1

Status
Not open for further replies.

Goofus828

Programmer
Nov 9, 2005
127
US
Hi all,
I have a select statement saved in a memo field. I save the memo field contents to a variable and execute the variable/select statement via macro substitution.
Code:
xJunk = table1.mMemoSQL

&xJunk.
This returns the error of "Table Number is Invalid".

The table does exist.

When I copy the select statement from the memo window to the command box and execute it that way, it works. (of course!)

Any suggestions?
 
If the above does not work, You MIGHT be getting a CHR(10) + Chr(13) in the Memo field when it passed it's block size.

Check your Memo Field Block size with sys(2012) and change to with the info in SET BLOCKSIZE command.

Or write a routine to strip the Chr(10) + Chr(13) characters from the xJunk Varariable before you run it as a macro.


David W. Grewe Dave
 
Thank You!
That worked perfectly. You saved me a ton of additional work!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top