× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



The help is updated on 7.1 to say:
Message ID . . . . . . : SQL0109 Severity . . . . . . . : 30
Message type . . . . . : Diagnostic

Message . . . . : FOR READ ONLY clause not allowed.
Cause . . . . . : One of the following conditions was not allowed:
-- SELECT INTO and VALUES INTO statements cannot include the FOR
UPDATE
clause, the FOR READ ONLY clause, the OPTIMIZE clause, or the UNION,
EXCEPT
or INTERSECT operator.
...


This makes more sense. When you are doing this without a cursor, and you
are doing a simple select it should be an implied FOR READ ONLY.
However, if this is true that it should be an implied for read only, then
why is your select putting a lock on it?

When I run this on 7.1 my WRKJOB shows no object locks, nor record locks,
for the table involved.

D count S 10i 0
/free
exec sql
Set Option
Naming = *Sys,
Commit = *None,
UsrPrf = *User,
DynUsrPrf = *User,
Datfmt = *iso,
CloSqlCsr = *EndMod;
exec sql
select count(*) into :count
from rob/aaakey;
dsply count;
// *inlr=*on;
return;
/end-free

I even tried dropping
CloSqlCsr = *EndMod;
and still there were no locks. If you are finding these locks then
perhaps you have a bug?

Count is returning the right number of rows in that table.


Rob Berendt

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.