Re: [cx-oracle-users] Optimizer Hints in Queries
Brought to you by:
atuining
From: Mark H. <mh...@pi...> - 2012-04-17 19:28:12
|
On 4/17/12 11:46 AM, Andrew Sawyers wrote: > I have looked through many archived messages trying to find some details on using hints in queries. I am using cc_Oracle 5.1.1 and oracle 11g - issuing a query, presuming I have a connection and a cursor, such as: > cursor.execute ("select /*+ first_rows °/ x, y, a from my_materialized_view") > Fails with "invalid character" - I am presuming that is from the / in the hint - I have tried various attempts too escape or other wise get this to work.....no luck. Also no luck googling variations of my issue... > I am hoping someone here can provide some help. > Cheers, > Andrew If this is an accurate cut and paste in your email, look at the "*/" part of your string. It's showing up here as a degrees sign. The directive does work, here's a cut and paste from a bit of my code: self.sql="""select /*+ FIRST_ROWS(1) */ seq,payload from opq_%s where status = 'queued' order by seq""" |