HELP! reading syscat from php in db2 udb v8.1.9 Linux
HELP! reading syscat from php in db2 udb v8.1.9 Linux
am 18.03.2006 22:40:08 von Robert Stearns
I am trying to write a small app in php to make the 'COMMENT' statement
a bit more friendly, so we might do more documentation. My problem is a
set of error statements which have nothing to do with what I'm doing.
For instance when I try to run the trigger list with the code below, I
get the error message:
42832--[IBM][CLI Driver][DB2/LINUX] SQL0607N "UPDATE" is not defined for
system objects. SQLSTATE=42832
$sql = "SELECT trigname AS obj_name
FROM syscat.triggers
WHERE trigschema='$db_schema'
";
dosql($sql, "S OBJ", -1, "", $res, $n);
I get different, but similar, error messages when I try tables and views:
42808--[IBM][CLI Driver][DB2/LINUX] SQL0151N The column
"MAXFREESPACESEARCH" cannot be updated. SQLSTATE=42808
42808--[IBM][CLI Driver][DB2/LINUX] SQL0151N The column "SEQNO" cannot
be updated. SQLSTATE=42808
When I run the statements in my frontend, ADS, they all do just what I
expect. Since I don't know where the problem lies, I posted this
question to two newsgroups.
Re: HELP! reading syscat from php in db2 udb v8.1.9 Linux
am 19.03.2006 15:49:53 von Serge Rielau
Bob Stearns wrote:
> I am trying to write a small app in php to make the 'COMMENT' statement
> a bit more friendly, so we might do more documentation. My problem is a
> set of error statements which have nothing to do with what I'm doing.
> For instance when I try to run the trigger list with the code below, I
> get the error message:
>
> 42832--[IBM][CLI Driver][DB2/LINUX] SQL0607N "UPDATE" is not defined for
> system objects. SQLSTATE=42832
>
> $sql = "SELECT trigname AS obj_name
> FROM syscat.triggers
> WHERE trigschema='$db_schema'
> ";
> dosql($sql, "S OBJ", -1, "", $res, $n);
>
> I get different, but similar, error messages when I try tables and views:
>
> 42808--[IBM][CLI Driver][DB2/LINUX] SQL0151N The column
> "MAXFREESPACESEARCH" cannot be updated. SQLSTATE=42808
>
> 42808--[IBM][CLI Driver][DB2/LINUX] SQL0151N The column "SEQNO" cannot
> be updated. SQLSTATE=42808
>
> When I run the statements in my frontend, ADS, they all do just what I
> expect. Since I don't know where the problem lies, I posted this
> question to two newsgroups.
Appears your client attached a FOR UPDATE clause.
Try this:
SELECT trigname AS obj_name
FROM syscat.triggers
WHERE trigschema='$db_schema'
FOR READ ONLY
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Re: HELP! reading syscat from php in db2 udb v8.1.9 Linux
am 19.03.2006 21:20:31 von Robert Stearns
Serge Rielau wrote:
> Bob Stearns wrote:
>
>> I am trying to write a small app in php to make the 'COMMENT'
>> statement a bit more friendly, so we might do more documentation. My
>> problem is a set of error statements which have nothing to do with
>> what I'm doing. For instance when I try to run the trigger list with
>> the code below, I get the error message:
>>
>> 42832--[IBM][CLI Driver][DB2/LINUX] SQL0607N "UPDATE" is not defined
>> for system objects. SQLSTATE=42832
>>
>> $sql = "SELECT trigname AS obj_name
>> FROM syscat.triggers
>> WHERE trigschema='$db_schema'
>> ";
>> dosql($sql, "S OBJ", -1, "", $res, $n);
>>
>> I get different, but similar, error messages when I try tables and views:
>>
>> 42808--[IBM][CLI Driver][DB2/LINUX] SQL0151N The column
>> "MAXFREESPACESEARCH" cannot be updated. SQLSTATE=42808
>>
>> 42808--[IBM][CLI Driver][DB2/LINUX] SQL0151N The column "SEQNO" cannot
>> be updated. SQLSTATE=42808
>>
>> When I run the statements in my frontend, ADS, they all do just what I
>> expect. Since I don't know where the problem lies, I posted this
>> question to two newsgroups.
>
> Appears your client attached a FOR UPDATE clause.
> Try this:
> SELECT trigname AS obj_name
> FROM syscat.triggers
> WHERE trigschema='$db_schema'
> FOR READ ONLY
>
>
Thank you, again, for helping a learner. Does the 'FOR READ ONLY' clause
speed up things in general? Should I include whenever I am only
interested in reading the results? My php version, if it is important,
is 4.4.
Re: HELP! reading syscat from php in db2 udb v8.1.9 Linux
am 19.03.2006 23:20:43 von Serge Rielau
Bob Stearns wrote:
> Thank you, again, for helping a learner. Does the 'FOR READ ONLY' clause
> speed up things in general? Should I include whenever I am only
> interested in reading the results? My php version, if it is important,
> is 4.4.
Unfortunately I'm not versed in PHP (yet).
What I do know is that telling what you want is always a good idea.
Some client interfaces always add FOR UPDATE clause to cursors.
Others even go as far as making cursors SCROLLABLE in utter disregard
for the impact for performance.
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab