Highlighted
Absent Member.
Absent Member.
463 views

ACUSQL - UPDATE Record

[Migrated content. Thread originally posted on 01 November 2011]

Using the same syntax as the sample in the manual. However when I go to update, I get "The cursor is READ ONLY".

Doing this to read the record.

EXEC SQL
DECLARE COBCUR1 CURSOR FOR
SELECT C_FIRST_NAME, C_LAST_NAME, C_CITY
FROM CUSTOMER
WHERE C_LAST_NAME = KEY-PASSED
FOR UPDATE
END-EXEC.

EXEC SQL
OPEN COBCUR1
END-EXEC.

EXEC SQL
FETCH COBCUR1
INTO :C-FIRST-NAME,
:C-LAST-NAME,
:C-CITY
END-EXEC

Then after user makes changes, I do the following.

EXEC SQL
UPDATE CUSTOMER SET
C_FIRST_NAME = :C-FIRST-NAME,
C_LAST_NAME = :C-LAST-NAME,
C_CITY = :C-CITY
WHERE CURRENT OF COBCUR1
END-EXEC

Then I get message "The cursor is READ ONLY"


In the config file I have the setting

ACUSQL_ODBC_CURSORS 0


Any ideas anyone?

Patty
0 Likes
1 Reply
Highlighted
Absent Member.
Absent Member.

RE: ACUSQL - UPDATE Record

FIGURED OUT THE PROBLEM.

The WHERE statment s/b WHERE C_LAST_NAME = :KEY-PASSED


It did not work using WHERE CURRENT OF CURSOR_NAME.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.