Daniel Cernotto wrote:
>
> I have this problem:
>
> ----------------------
> DECLARE p_cursor CURSOR WITH HOLD FOR select x from table_1 FOR =
> UPDATE
>
> FOREACH p_cursor INTO variables
>
> SELECT * INTO variables_2 FROM table_2 WHERE variables .... >
> IF variables_2 THEN
>
> UPDATE table_1 SET y =3D 0 WHERE CURRENT OF p_cursor >
> END IF
>
> END FOREACH
> --------------------
>
> When I run this program, ERROR -266 occurs
>
> Anyone have any idea?
Yes. If you are going to UPDATE column y WHERE CURRENT OF p_cursor,
then you must SELECT y in your p_cursor CURSOR.
Hope that helps,
--
Mark.
+------------------------------------------------------------------+
|Mark D. Stock - The West Solutions Group http://www.west.co.za |
| The Informix FAQ is at http://www.iiug.org |
|mailto:marks@west.co.za +-----------------------------------------+
|Tel: +27 11 803 2151 |If it doesn't work, force it! |
|Fax: +27 11 803 2189 |If it breaks, it needed replacing anyway!|
|Cell: +27 83 250 2325 |Well, that's how I code anyway! |
+------------------------+-----------------------------------------+