Yeah,  I replaced the column name with 4,  that error was gone, but a new 
error message was generated, which is

execute called with 1 bind variables when 2 are needed

The  $list->execute($group) is asking for two parameters inside the 
parentless, which is weird.

Any idea how this happens?

Thanks very much.

He


At 12:48 PM 3/12/02 -0800, Ravishankar Narasimhan wrote:
>When you use a Union you need to have by order by 1,2
>instead of column_name.
>--- He Hong <[EMAIL PROTECTED]> wrote:
> > Hi, there,
> >
> > Here is my code. When I ran it, something is not
> > right.
> >
> > my $qstr = qq
> > #SELECT
> > subject,group_group,submitter,TO_CHAR(close_time,
> > 'MM/DD/YY
> >
>HH24:MI'),description,comments,eta,noc,status,notification_id,master
> >                       FROM notification
> >                       WHERE status = 'Active' and
> > group_group = ?
> >                    UNION
> >    select
> > subject,group_group,submitter,TO_CHAR(close_time,
> > 'MM/DD/YY
> >
>HH24:MI'),description,comments,eta,noc,status,notification_id,master
> >                       FROM notification
> >                       WHERE group_group = ?
> >                       and ROWNUM <= 500
> >                           ORDER BY close_time
> > DESC#;
> >
> >       $list = $dbh->prepare($qstr) or die "Couldn't
> > prepare statement: " .
> > $DBI->errstr();
> >       $list->execute($group) or die "Couldn't
> > execute statement: " .
> > $DBI->errstr();
> >
> > I want the "rownum <=500 order by close_time desc"
> > to act as the condition
> > of  the second select statement, which means to be
> > execute before the union.
> >
> > The erroer message I got is "DBD::Oracle::db prepare
> > failed: ORA-00904:
> > invalid column name (DBD ERROR:
> > OCIStmtExecute/Describe)". I checked
> > several times and couldn't find anything wrong with
> > the column name.
> >
> > When I took the  "rownum <=500 order by close_time
> > desc" off, it works
> > ok.  But when I added it, it went wrong.
> >
> > Could somebody give me a hint about what may cause
> > the problem?  I am
> > really appreciate it.
> >
> > He
> >
>
>
>__________________________________________________
>Do You Yahoo!?
>Try FREE Yahoo! Mail - the world's greatest free email!
>http://mail.yahoo.com/

Reply via email to