Print Page | Close Window

Temporary Tables

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1289
Printed Date: 04 May 2024 at 12:00am


Topic: Temporary Tables
Posted By: reggiejdean
Subject: Temporary Tables
Date Posted: 07 Sep 2007 at 9:53am
Hi,
 
I am using Crystal Reports 9.  My plan is to upgrade to 11 soon.  My question is as follows:
 
I need to create and drop two temporary tables using Crystal Reports.  Does CR offer this type of functionality or should I perform this task on the database end and then use CR on the resulting tables?
 
Thanks,
Reggie



Replies:
Posted By: jkwrpc
Date Posted: 07 Sep 2007 at 10:30am
I am a not certain that CR XI does exactly what you want.
 
However, you can create Command objects which are essentially SQL statements. I think of them as views rather tables.  However, it does allow you to set relational links between the command objects. I find this extremely useful. You will find this functionality under the Database Expert.
 
The second part of your question is that you should be able to create an actual temporary table on the database server that runs against SQL. 
 
Depending on what you need to do with the table will give the you the answer to the question. If you need to deal with cursors and control methods, then SQL temporary tables are probably the answer. If you just need to pull two sets of data and then relate them to each other give the CR command objects a look.
 
Hope this is of help.
 
Regards,
 
John W.
http://www.CustomReportWriters.net - www.CustomReportWriters.net


Posted By: BrianBischof
Date Posted: 07 Sep 2007 at 11:06am
I agree with what John said, but would like to add that you haven't really told us anything about what you want to do. A few more details would make it easy to give a better answer. But yes, John is right.  

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: reggiejdean
Date Posted: 07 Sep 2007 at 12:02pm

Thank both of you for assisting me with this....

I would like to create two temporary tables and extract data from these with crystal reports.  It would help if I can create these two tables using Crystal Reports....this way I do not have to run scripts via the Oracle interface first, and then you CR on the resulting table.  Here is a high level example of what I need to do:
 
Step 1
Create Temporary Table 1
Update (remove NULLS etc) fields in Temp Table1
Join Parent Table 1 and Parent Table 2 (to create Table 1)
 
Step 2
Create Temporary Table 2
Update fields in Temp Table 2
Join Parent Table 1 and Parent Table 2 (to create Table 2)
 
Step 3
Create reports based on data in Temp Table 1 & 2
 
Step 4
Drop Temp Table 1 & 2
 
I would like to be able to do all of this using Crystal Reports. 
Otherwise, if CR does not allow me to Create and Drop Oracle
database tables, then I will be forced to perform Steps 1, 2, & 4
on the database backend & run Step 3 via CR.
 
Thanks again...you both are very much appreciated.
 
Reggie
 
 
 
 


Posted By: BrianBischof
Date Posted: 07 Sep 2007 at 12:23pm
Well, I'm not an Oracle guy so I don't know about its features. But basically, I would just try it. Create a temporary table using the Command object and see if Oracle accepts it. If so, then write the rest the SQL that you need and you'll be okay. Also, I know that the ODBC driver has more functionality than the OLE DB drivers. So if OLE doesn't work for you, then try the ODBC as well to double check. Unfortunately, installing ODBC drivers is a pain so I only use them as a last resort.


-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: reggiejdean
Date Posted: 07 Sep 2007 at 12:41pm
Thank you Brian....I cannot wait to buy your next book....coming up soon.
 
Reggie


Posted By: BrianBischof
Date Posted: 07 Sep 2007 at 12:47pm
I worked really hard on the new book and I hope you like it. However, I don't have anything about Oracle in it. I'm strictly a SQL Server guy. 

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: reggiejdean
Date Posted: 07 Sep 2007 at 2:07pm
Actually my company plans to install a SQL Server 2005 database soon....so I will be discussing your book with you soon. LoL


Posted By: BrianBischof
Date Posted: 07 Sep 2007 at 3:06pm
Cool! And make sure that everyone in the office gets a copy of the book for reference. 

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>



Print Page | Close Window