Creating a temp table from within a view

Creating a temp table from within a view

Post by Kenny MacLeo » Thu, 15 Apr 1999 04:00:00



Is it possible to create a temporary table from within a view?

My view needs to be able to SELECT on the output of a stored procedure, and
I believe that to manipulate the recordset output of an SP, you need a
temporary table.

Any thoughts?

cheers

kenny

--
-----------------------------------------------------------------
Kenny MacLeod
skaff_at_flirble_dot_org

 
 
 

Creating a temp table from within a view

Post by Roy Harv » Thu, 22 Apr 1999 04:00:00


Kenny,

Quote:>Is it possible to create a temporary table from within a view?

No.

Quote:>My view needs to be able to SELECT on the output of a stored procedure, and
>I believe that to manipulate the recordset output of an SP, you need a
>temporary table.

You cannot put a stored procedure into a SELECT command, and the only
command that can appear in a view is SELECT.

The closest you can probably come is to create a table that matches
the output of the proc, then use:

  INSERT tbl
  EXEC procname

to load that table.  You could then reference this in a SQL command,
though you would probably have to make it a permanent table to use it
in a view.

Roy

 
 
 

1. Difference btwn CREATE VIEW and CREATE TABLE TEMP

Just out of curiosity, is there substantial difference in Ingres
between doing a CREATE VIEW and doing a CREATE TABLE TEMP?  Suppose
I'm writing a report and the data I need to collect is too complicated
to get at in a single SELECT statement.  In the .SETUP part of the
report I usually do a "CREATE TABLE TEMP AS ..." and then do a "DROP
TABLE TEMP" in the .CLEANUP section.

I was thinking it might be better to do a CREATE VIEW just once and
run the report on the view.  What things should I be considering in
making my decision?

------------------------------------------------------------------------------

UW - Madison Academic Computing Center         Phone:    608-262-9887
1210 W. Dayton St.                             Fax:      608-262-4679
Madison, WI., 53706                            CIS:      76376,3635

2. DBCC TRACEON error message?

3. Create View vs. Create Table Temp

4. Runtime solution and Fmpro 5

5. Cannot Create temp table within Store procedure??

6. Compile error : Method or data member not found

7. Creating a local temp table within an sp using Execute() or sp_executesql

8. Missing System DSN Entries

9. Creating #temp tables within a begin tran

10. avoiding creating temp tables for view

11. create temp table: -261 Cannot create file for table - Not owner

12. Difference between create table #temp and ##temp ?

13. Create table temp or select into temp.