I ran into problems a while back using "WHERE CURRENT OF"; I now use the
same method that Dennis describes and have not had a problem since then. His
description is right on the money.
Javier,

Javier Valencia, PE
President
Valencia Technology Group, L.L.C.
14315 S. Twilight Ln, Suite #14
Olathe, Kansas 66962-4578
Office (913)829-0888
Fax (913)649-2904
Cell (913)915-3137

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Dennis
McGrath
Sent: Tuesday, July 15, 2003 8:18 PM
To: RBASE-L Mailing List
Subject: [RBASE-L] - RE: Read Only Cursor Error?

I avoid WHERE CURRENT OF whenever possible.

I prefer all my tables to have an integer primary key which uniquely
identifies each row.  I retrieve the id with the fetch and do any
updates using theid in the where clause.  I get no suprises that way,
even as the code or table changes.  Even if my cursor fetches a join of
several tables, I can still update any of the included tables using the
appropriate where clauses.

Dennis McGrath

--- "Walker, Buddy" <[EMAIL PROTECTED]> wrote:
> Steve
>   The use of Current of is used when you have declared a cursor for
> instance
>
>   Normally I would use C1 instead of  cBuildCHKSTR.
>
>    DECL cBuildCHKSTR CURSOR FOR SEL columnName FROM tableview whe
> ........
>
>    OPE cBuildCHKSTR
>
>   WHILE 3 = 3  THEN
>     FETCH cBuildCHKSTR INTO VariableName INDIC IVar
>      IF SQLCODE = 100 THEN
>       BREAK
>      ENDIF
>
>       UPDATE tableview SET colunmList WHE CURRENT OF C1
>      --This will update the columnList of  whatever row the cursor is
> pointing to at that time.
>
>   ENDWHIL
>
>  Hope this helps
>
> Buddy
>
>
> -----Original Message-----
> From: J. Stephen Wills [mailto:[EMAIL PROTECTED]
> Sent: Tue 7/15/2003 11:14 AM
> To: RBASE-L Mailing List
> Cc:
> Subject: [RBASE-L] - Read Only Cursor Error?
>
>
> I know I've missed something somewhere and I can't find any reference
> to
> it so far,
> but, how does one make ("un-make") a READ-ONLY CURSOR?
>
> When I attempt to execute :
>
>    UPDATE +
>       TEMP_MASTER +
>    SET +
>       CheckString = (.vCheckString) +
>    WHERE +
>       CURRENT OF cBuildCHKSTR
>
> I'm getting the following error message :
>
>    -ERROR- Illegal use of a read-only cursor. (3007)
>
> I seem to recall that a cursor can be read-only,
> but I haven't (yet) found any reference thereto
> in the magnetic or paper reference materials I have.
>
>
> TIA,
> Steve in Memphis
>

Reply via email to