Having been forced into many DUH moments in the past by:

   - not having TEMP tables exist when I want them to exist
   - having TEMP tables exist when I don't want them to exist
   - having more than one copy of the CREATE TEMP command (in "on before
   design", and also in "on before start"), and changing one of them but
   forgetting to change the other

I now have a table called "CodeSnippets", with a varchar column tat
contains to create the temp table:

========================
 SET ERROR MESSAGE 2038 OFF
 DROP TABLE tNCOAChanges
 SET ERROR MESSAGE 2038 ON

 CREATE TEMP TABLE tNCOAChanges (  +
etc.
==========================

Then all I need in the "on before design" and "on before start" eep is
something like this:

RUN SELECT CodeSnippet FROM CodeSnippets WHERE CodeSnipAbbrev =
'CreateTableNCOA'

The code can be reused at the R:Prompt, too, and it's embedded in the
database so there are no other files to manage.

Bill




On Thu, May 9, 2013 at 12:10 PM, Albert Berry <[email protected]>wrote:

> I just spent 15 minutes trying to figure out what was wrong with a form I
> created using R:Azzak's marvellous "click to switch sides" form with a view
> and a temp table.
>
> I opened the form in design mode and got error 2038 "Table does not
> exist". My On Before Design action created the table. It dropped the table
> first, with error 2038 off. What the heck?
>
> Well, DUH - when you create a view that refers to a table that you have
> not yet created ... So I switched the table and view definitions so the
> table was there when I created the view ...
>
> Just one of those mornings, I guess.
>

Reply via email to