cancel
Showing results for 
Search instead for 
Did you mean: 

How can specify a SQL hint from an existing report?

former_member560462
Participant
0 Kudos

I am porting an app from COM based CR to CR Visual Studio 2010. I've managed to update my database connection on the fly thanks to help on this forum. Now I want to get an Oracle style hint into my SQL. I've read all the threads lamenting the passing of SQLQueryString, so there appears to be no easy answer to this. I have a number of table linked reports that in the old version would take the SQLQueryString, and replace WHERE with WHERE /*+ <hinttext> */ . My OleDBProvider then interprets the hint text to do various options. Is there some way I can get this hintext string into my SQL? It doesn't have to go in any particular place in the SQL statement, it just needs to be there somewhere and I need to be able to generate the <hinttest> at runtime.

-nld

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Only suggestion I'd have is to use ADO .NET datasets created off of your query and point the report at that (assuming the number of records returned is less than a few thousand). No hints, etc. See KB [1281732 - How to pass a SQL query to a Crystal reports in a Visual Studio .NET application?|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233383331333733333332%7D.do]

Also, see Kb [1371957 - How can I get the SQL Query from a Crystal Report and Subreport using the RAS .NET SDK?|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333333373331333933353337%7D.do]

- Ludek

0 Kudos

Only other suggest is try to use SQLExpression. I should push that option into the SQL Statement.

Or use a Command Object, there is code in here to convert your report from up too two tables to a Command, if more than that then you have to re-write your reports.

Warning, you can not have more than one data source in the report.

Don

Edited by: Don Williams on Jan 3, 2012 10:20 AM

Answers (0)