Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Date Dimension

Re: Date Dimension

From: Vitaliy Ogiychuk <vitalio_at_infoplus.kiev.ua>
Date: Mon, 28 Oct 2002 12:07:04 +0200
Message-ID: <apiuj7$2qhk$1@news.kiev.sovam.com>


Run separately all queries, that you wanna insert and make sure that all of this result single value.

"Johnny" <kdankwah_at_aol.com> wrote in message news:732d872a.0210271230.69ef2caa_at_posting.google.com...
> I am trying to load into a Time table with this, select statements
> works perfectly by themselves but when put together I get an error
> message:
>
> Here is the syntax:
>
> INSERT INTO time
> (Time_key,
> Year_key,
> Year_id,
> Year_desc,
> Quarter_key,
> Quarter_id,
> Quarter_desc,
> Month_key,
> Month_id,
> Month_desc,
> Date_id,
> Date_desc)
> VALUES(custkeyseq.nextval, custkeyseq.nextval,
> (select TO_CHAR(TO_DATE('01-01-1996','MM-DD-YYYY') +
> (rownum-1),'YYYY')
> from ALL_tab_columns
> where rownum <=

TO_DATE('12-31-1998','MM-DD-YYYY')-TO_DATE('01-JAN-1996',
> 'DD-MM-YYYY') + 1),
> (select TO_CHAR(TO_DATE('01-01-1996','MM-DD-YYYY') +
> (rownum-1),'YYYY')
> from ALL_tab_columns
> where rownum <=

TO_DATE('12-31-1998','MM-DD-YYYY')-TO_DATE('01-JAN-1996',
> 'DD-MM-YYYY') + 1),
> custkeyseq.nextval,
> (select TO_CHAR('Q')||'-'||TO_CHAR(TO_DATE('01-01-1996','DD-MM-YYYY')
> + (rownum-1),'q')
> from ALL_tab_columns
> where rownum <=

TO_DATE('31-12-1998','DD-MM-YYYY')-TO_DATE('01-01-1996',
> 'DD-MM-YYYY') + 1),
> (select TO_CHAR('Q')||'-'||TO_CHAR(TO_DATE('01-01-1996','DD-MM-YYYY')
> + (rownum-1),'q')
> from ALL_tab_columns
> where rownum <=
> TO_DATE('31-12-1998','DD-MM-YYYY')-TO_DATE('01-01-1996',
> 'DD-MM-YYYY') + 1),
> custkeyseq.nextval,
> (select TO_CHAR(TO_DATE('01-01-1996','MM-DD-YYYY') +
> (rownum-1),'MON'||'-'||'YYYY')
> from ALL_tab_columns
> where rownum <=

TO_DATE('12-31-1998','MM-DD-YYYY')-TO_DATE('01-JAN-1996',
> 'DD-MM-YYYY') + 1),
> (select TO_CHAR(TO_DATE('01-01-1996','MM-DD-YYYY') +
> (rownum-1),'MON'||'-'||'YYYY')
> from ALL_tab_columns
> where rownum <=

TO_DATE('12-31-1998','MM-DD-YYYY')-TO_DATE('01-JAN-1996',
> 'DD-MM-YYYY') + 1),
> (select TO_DATE('01-01-1996','DD-MM-YYYY') + (rownum-1)
> from ALL_tab_columns
> where rownum <=

TO_DATE('31-12-1998','DD-MM-YYYY')-TO_DATE('01-01-1996',
> 'DD-MM-YYYY') + 1),
> (select TO_DATE('01-01-1996','DD-MM-YYYY') + (rownum-1)
> from ALL_tab_columns
> where rownum <=

TO_DATE('31-12-1998','DD-MM-YYYY')-TO_DATE('01-01-1996',
> 'DD-MM-YYYY') + 1))
> /
>
> I get this error message, what am I doing wrong.
>
>
> ERROR at line 15:
> ORA-01427: single-row subquery returns more than one row
Received on Mon Oct 28 2002 - 04:07:04 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US