Re: RE: Bug with model clause and bind variables...?

Boneist <[email protected]>
Newsgroups gmane.comp.db.oracle.toad.free
Message-ID <24350824.115641318432877328.JavaMail.SYSTEM@alvqcfw02>
 Message from: Boneist 

I can confirm this is still an issue in v11.0.0.116

_______________________________________

Historical Messages 


Author: Boneist
Date: Wed Oct 12 08:20:47 PDT 2011
I can confirm this is still an issue in v11.0.0.116
__

Author: Michael Staszewski
Date: Thu Jul 14 06:24:30 PDT 2011




 

I can reproduce this in the current beta as well. I'll take a peek at it.

Thanks,

Michael


__

Author: Boneist
Date: Thu Jul 14 05:52:22 PDT 2011
 I&#39;ve got an example query that I&#39;m trying to run in the editor&nbsp;in Toad v10.0:

 &nbsp; with  my_tab  as   (select   1   id,   100  cnt  from  dual  union   all select   2   id,   30  cnt  from  dual  union   all select   3   id,   40  cnt  from  dual  union   all select   4   id,   5  cnt  from  dual  union   all select   5   id,   6  cnt  from  dual  union   all select   6   id,   99  cnt  from  dual  union   all select   7   id,   1  cnt  from  dual  union   all select   8   id,   1  cnt  from  dual )   select  * from  my_tab mt model partition   by   (: threshold threshold ) dimension   by   (id) measures   ( cnt ,   0  cumulative_count ,   1  grp ) ( cumulative_count[ any ]  order   by   id   =  cnt[ cv() ]  +   case   when  cnt[ cv() ]  &gt;   cv( threshold )   then 1 / 0 when  cnt[ cv() ]  +   nvl( cumulative_count[ cv()- 1 ] , 0 )   &gt;   cv( threshold )   then 0 else   nvl( cumulative_count[ cv()- 1 ] , 0 ) end, grp[ any ]  order   by   id   =   nvl( grp[ cv()- 1 ] , 0 )   +   case   when  cumulative_count[ cv() ]  =  cumulative_count[ cv()- 1 ]  +  cnt[ cv() ]  then 0 else   1 end); 

When I run it via execute statement with the &quot;Prompt for substitution variables&quot; option ticked, it pops up the provide values window, but there&#39;s no variable listed. 
If I change it from :threshold to &amp;threshold, it works as expected. It doesn&#39;t seem to matter if I put a space between the left bracket and the colon, either, yet if I put &quot;:threshold&quot; elsewhere in the query (ie. not in the model clause), it pops up correctly (but the value is not passed through to my original bind variable). 
Is this a bug?


ETA: I should add that when I declare the variable and assign a value to it and then run it through as a script, it works with the bind variable, both in Toad and SQL*Plus, so I think it&#39;s a Toad-ism, rather than a problem with the version of the db / client I&#39;m using (10.2.0.4).

Message was edited by: Boneist
__
_______________________________________
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.