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

Order of SQL Execution in Crystal.

Status
Not open for further replies.

olsen85

Technical User
Jul 3, 2007
3
I am running Crystal Reports XI with a connection to an Oracle 10g database.

I want to add a custom command to my report to do something like 'alter session...' and have it run before any selects. I was wondering if anyone knew in what order will Crystal process the SQL statements and if there is a way to change this order?

Thanks.
 
Hi, If you are adding that to an existing CR designed report ( one that uses the 'standard' method of selecting tables and fields),after adding it, use the 'Show Sql' option under the database menu to see how it is being handled..

(How do you plan to link the command to the other tables, if any?)

If totally Command Object based, then the command may be written to include that , but I am not sure if you need to add a ; after it...Also, that command produces feedback ( 'Session Altered', for instance) - not sure what CR will do with that..

Using the Report to make database alterations is not usually a good idea since it is not really the correct tool.




[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Thanks for the response.

The alter table SQL statement does not show up in the 'Show Sql' option, and I have been unable to create a command with both an alter session statement and a select statement in one.

The reason for the need for this is that we have a single database with different schemas, I want to do alter session set current_schema = X in the command, in them and we want to be able to have a single report that can access all those schemas through a simple parameter.

Thanks.
 
I have determined a way to get this by just doing {?Schema}.table_name. Thanks for the help Turkbear.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top