Jan: If you have the name of the temporary table, then you can use the method described by Buddy. If you want to know if you have temporary files/views in general, then you can use: SELECT COUNT(*) INTO vTempTables FROM SYS_TABLES WHERE SYS_TABLE_NAME NOT LIKE 'SYSTMP_%' AND SYS_TABLE_TYPE = 'TABLE' AND SYS_TEMPORARY = 1 The variable vTempTables will have the number of Temporary Tables.
If you want to know the number of temporary views, then use: SELECT COUNT(*) INTO vTempViews FROM SYS_TABLES WHERE SYS_TABLE_NAME NOT LIKE 'SYSTMP_%' AND SYS_TABLE_TYPE = 'VIEW' AND SYS_TEMPORARY = 1 The variable vTempViews will have the number of Temporary Views. If you want to know the number of temporary tables and views, then use: SELECT COUNT(*) INTO vTempTables FROM SYS_TABLES WHERE SYS_TABLE_NAME NOT LIKE 'SYSTMP_%' AND SYS_TEMPORARY = 1 The variable vTempTables will have the number of Temporary Tables and Views. The system normally has several temporary tables open and they all have the name SYSTMP_XXXXX, which is why you need to eliminate those names from your selection. In this method, make sure that your temporary tables and/or views are not named "SYSTMP_...." Javier Valencia 913-915-3137 ________________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of jan johansen Sent: Monday, February 23, 2009 3:18 PM To: RBASE-L Mailing List Subject: [RBASE-L] - Temp tables Group, What is the best way to check for the existance of a temporary table? Jan --- RBASE-L =======================3D=======================3 D= TO POST A MESSAGE TO ALL MEMBERS: Send a plain text email to [email protected] (Don't use any of these words as your Subject: INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH, REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP) =======================3D=======================3 D= TO SEE MESSAGE POSTING GUIDELINES: Send a plain text email to [email protected] In the message SUBJECT, put just one word: INTRO =======================3D=======================3 D= TO UNSUBSCRIBE: Send a plain text email to [email protected] In the message SUBJECT, put just one word: UNSUBSCRIBE =======================3D=======================3 D= TO SEARCH ARCHIVES: Send a plain text email to [email protected] In the message SUBJECT, put just one word: SEARCH-n (where n is the number of days). In the message body, place any text to search for. =======================3D=======================3 D=

