Re: For loops in model clause

  • From: GBA-DBA <gba.oraclel@xxxxxxxxx>
  • To: "Ian Cary" <ian.cary@xxxxxxxxxxxxxx>
  • Date: Thu, 26 Jun 2008 09:16:33 -0500

Ian,

I tried the query against a 10g R2 db and it works. My original test was
done using a 10g R1 and in that case the query throws the error....so I
guess it is a bug in 10g R1.

Thanks a lot for your help.

Regards,
Galo
On Thu, Jun 26, 2008 at 5:30 AM, Ian Cary <ian.cary@xxxxxxxxxxxxxx> wrote:

> Your construct seems to work for me on 10.2.0.3
>
>  1  select tdate,
>  2         dummy
>  3  from  (select sysdate tdate from dual)
>  4  model
>  5  return updated rows
>  6  dimension by (tdate)
>  7  measures (1 as dummy)
>  8  rules  (dummy[FOR tdate from to_date('01-dec-07') TO
> to_date('01-jul-08')
>  9*         increment numtoyminterval(1,'month')] =  1 )
> otstst10> /
>
> TDATE                DUMMY
> --------- ----------------
> 01-DEC-07                1
> 01-JAN-08                1
> 01-FEB-08                1
> 01-MAR-08                1
> 01-APR-08                1
> 01-MAY-08                1
> 01-JUN-08                1
> 01-JUL-08                1
>
> 8 rows selected.
>
> Cheers,
>
> Ian
>
>
>
> |---------+----------------------------->
> |         |           gba.oraclel@gmail.|
> |         |           com               |
> |         |           Sent by:          |
> |         |           oracle-l-bounce@fr|
> |         |           eelists.org       |
> |         |                             |
> |         |                             |
> |         |           25/06/2008 19:31  |
> |         |           Please respond to |
> |         |           gba.oraclel       |
> |         |                             |
> |---------+----------------------------->
>
>  
> >--------------------------------------------------------------------------------------------------------------|
>  |
>                                      |
>  |       To:       oracle-l@xxxxxxxxxxxxx
>                                       |
>  |       cc:
>                                      |
>  |       Subject:  For loops in model clause
>                                      |
>
>  
> >--------------------------------------------------------------------------------------------------------------|
>
>
>
>
> Hi list,
>
> I'm playing with the model clause but, I'm having some trouble with a rule
> using a for loop.
>
> dt_elig is a date column in the source table. The error I get is :
> ORA-32626 Illegal bounds or increment in MODEL FOR loop. Any idea about
> what I'm doing wrong?
>
>
>
> FOR
>
>
> dt_elig FROM to_date('01-Dec-07','DD-Mon-YY')
>                    TO to_date('01-Jun-08','DD-Mon-YY')
> INCREMENT numtoyminterval(1,'MONTH')--
> Regards
> GBA
>
> This email was received from the INTERNET and scanned by the Government
> Secure Intranet anti-virus service supplied by Cable&Wireless in
> partnership with MessageLabs. (CCTM Certificate Number 2007/11/0032.) In
> case of problems, please call your organisation's IT Helpdesk.
> Communications via the GSi may be automatically logged, monitored and/or
> recorded for legal purposes.
>
> For the latest data on the economy and society consult National Statistics
> at http://www.statistics.gov.uk
>
>
> *********************************************************************************
>
>
> Please Note:  Incoming and outgoing email messages are routinely monitored
> for compliance with our policy on the use of electronic communications
>
> *********************************************************************************
>
>
> Legal Disclaimer  :  Any views expressed by the sender of this message are
> not necessarily those of the Office for National Statistics
>
> *********************************************************************************
>
>
> The original of this email was scanned for viruses by the Government Secure
> Intranet virus scanning service supplied by Cable&Wireless in partnership
> with MessageLabs. (CCTM Certificate Number 2007/11/0032.) On leaving the GSi
> this email was certified virus free.
> Communications via the GSi may be automatically logged, monitored and/or
> recorded for legal purposes.
>

Other related posts: