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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Problem with FETCH

Re: Problem with FETCH

From: Daniel A. Morgan <dmorgan_at_exesolutions.com>
Date: Thu, 03 May 2001 23:32:07 -0700
Message-ID: <3AF24CE7.F9D258FC@exesolutions.com>

"Kast [WPM]" wrote:

> Hi,
> I have a Problem with my Application under ORACLE.
> Today it works proper with MS-SQL-Server but the Application
> must also run under ORACLE.
>
> With the MS-SQL-Server I can use the following Code:
>
> This "Fetch" the FIRST, NEXT,PRIOR or LAST Entry from the DataBase
> with the used " ORDER BY " statement.
>
> DECLARE ges_bw_cursor SCROLL CURSOR FOR SELECT bwnr FROM ges_bw ORDER BY
> bwnr
> OPEN ges_bw_cursor
> DECLARE @bwnr_ CHAR(20)
> FETCH FIRST FROM ges_bw_cursor INTO @bwnr_
> SELECT @bwnr_
> FETCH NEXT FROM ges_bw_cursor INTO @bwnr_
> SELECT @bwnr_
> FETCH PRIOR FROM ges_bw_cursor INTO @bwnr_
> SELECT @bwnr_
> FETCH LAST FROM ges_bw_cursor INTO @bwnr_
> SELECT @bwnr_
> CLOSE ges_bw_cursor
> DEALLOCATE ges_bw_cursor
>
> How can i do that on ORACLE ?
>
> I have read about CURSORS but i canĀ“t understand how this works.
> Who has an example ?
>
> I hope someone can understand my problems.
>
> Sorry for my very bad english...
>
> Thank you for any help.
>
> Regards,
> A.K.

I am going to say this as nicely as I can and as charitably as I can.

Oracle IS NOT SQL Server. Something for which I am extremely grateful.

If you want to work with Oracle you must do two things.

  1. Stop thinking it is a Microsoft product: It is not
  2. Read the manuals and the books

From an Oracle standpoint your code is at best laughable. You can't code like that. You can't think like that. And it will do you no good if anyone hands you the answer.

Go buy a PL/SQL book and read it.

Daniel A. Morgan Received on Fri May 04 2001 - 01:32:07 CDT

Original text of this message

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