SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
DatabaseUpdate

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
DatabaseUpdate
Author Message
weizeyin



Joined: 22 Jan 2001
Posts: 9

Post DatabaseUpdate Reply with quote

//
//database system: Sybase 11.9.2
//
//CREATE TABLE dbo.T99_RH_LOG
//(
// FILENAME varchar(255) NOT NULL,
// ID numeric(16,0) IDENTITY,
// CZSJ datetime NULL,
// FPBZ char(1) NOT NULL,
// CONSTRAINT PK_T99_RH_LOG
// PRIMARY KEY NONCLUSTERED (ID)
//)
//LOCK ALLPAGES
//go
//
//insert into T99_RH_LOG (FILENAME,FPBZ) values ('fname','0')
//go

Dim update_rows, number
Dim rows, number
DatabaseConnect( "sd_inq" )
//success
DatabaseRetrieve( "SELECT FILENAME,ID,CZSJ,FPBZ FROM T99_RH_LOG WHERE FPBZ='0'", rows )
//rows return 1
DatabaseSet( 1, 4, "1" )
DatabaseUpdate( "UPDATE", update_rows)
//return error message
//Job job execution error. Exit code: -1.
//An error occured while executing JAL script: Line 6: Result set is not updatable,
//must be singleton select and the affected table must have a primary key.
//
DatabaseDisconnect

Mon Jan 22, 2001 11:06 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: DatabaseUpdate Reply with quote

What was your question?

: //
: //database system: Sybase 11.9.2
: //
: //CREATE TABLE dbo.T99_RH_LOG
: //(
: // FILENAME varchar(255) NOT NULL,
: // ID numeric(16,0) IDENTITY,
: // CZSJ datetime NULL,
: // FPBZ char(1) NOT NULL,
: // CONSTRAINT PK_T99_RH_LOG
: // PRIMARY KEY NONCLUSTERED (ID)
: //)
: //LOCK ALLPAGES
: //go
: //
: //insert into T99_RH_LOG (FILENAME,FPBZ) values ('fname','0')
: //go

: Dim update_rows, number
: Dim rows, number
: DatabaseConnect( "sd_inq" )
: //success
: DatabaseRetrieve( "SELECT FILENAME,ID,CZSJ,FPBZ FROM T99_RH_LOG WHERE
: FPBZ='0'", rows )
: //rows return 1
: DatabaseSet( 1, 4, "1" )
: DatabaseUpdate( "UPDATE", update_rows)
: //return error message
: //Job job execution error. Exit code: -1.
: //An error occured while executing JAL script: Line 6: Result set is not
: updatable,
: //must be singleton select and the affected table must have a primary key.
: //
: DatabaseDisconnect

Mon Jan 22, 2001 11:54 pm View user's profile Send private message
weizeyin



Joined: 22 Jan 2001
Posts: 9

Post Re: DatabaseUpdate Reply with quote

: What was your question?
My question is why DatabaseUpdate( "UPDATE", update_rows) return error message?

Tue Jan 23, 2001 11:43 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: DatabaseUpdate Reply with quote

The error message that you mentioned in your original post fully answer this question:

Job execution error. Exit code: -1.
An error occurred while executing JAL script: Line 6: Result set is not updateable, must be singleton select and the affected table must have a primary key.

In your case, T99_RH_LOG does not have nether a primary key or an unique index on it. Without it, 24x7 does not know how to construct properly the UPDATE statement. Solution: create unique index on the ID column (or any other appropriate column or column set)

: My question is why DatabaseUpdate( "UPDATE", update_rows) return
: error message?

Tue Jan 23, 2001 1:21 pm View user's profile Send private message
weizeyin



Joined: 22 Jan 2001
Posts: 9

Post Re: DatabaseUpdate Reply with quote

: The error message that you mentioned in your original post fully answer this
: question: Job execution error. Exit code: -1.
: An error occurred while executing JAL script: Line 6: Result set is not
: updateable, must be singleton select and the affected table must have a
: primary key.

: In your case, T99_RH_LOG does not have nether a primary key or an unique
: index on it. Without it, 24x7 does not know how to construct properly the
: UPDATE statement. Solution: create unique index on the ID column (or any
: other appropriate column or column set)

But,T99_RH_LOG has a primary key on ID,please see

"//CREATE TABLE dbo.T99_RH_LOG
//(
// FILENAME varchar(255) NOT NULL,
// ID numeric(16,0) IDENTITY,
// CZSJ datetime NULL,
// FPBZ char(1) NOT NULL,
// CONSTRAINT PK_T99_RH_LOG
// PRIMARY KEY NONCLUSTERED (ID) -- see !!!
//)
//LOCK ALLPAGES
//go "

Wed Jan 24, 2001 4:13 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: DatabaseUpdate Reply with quote

Try without NONCLUSTERED

: But,T99_RH_LOG has a primary key on ID,please see

: "//CREATE TABLE dbo.T99_RH_LOG
: //(
: // FILENAME varchar(255) NOT NULL,
: // ID numeric(16,0) IDENTITY,
: // CZSJ datetime NULL,
: // FPBZ char(1) NOT NULL,
: // CONSTRAINT PK_T99_RH_LOG
: // PRIMARY KEY NONCLUSTERED (ID) -- see !!!
: //)
: //LOCK ALLPAGES
: //go "

Wed Jan 24, 2001 9:06 am View user's profile Send private message
weizeyin



Joined: 22 Jan 2001
Posts: 9

Post Re: DatabaseUpdate Reply with quote

: Try without NONCLUSTERED

Sorry,I had modified 'NONCLUSTERED' to 'CLUSTERED',but result was same.

//CREATE TABLE dbo.T99_RH_LOG
//(
// FILENAME varchar(255) NOT NULL,
// ID numeric(16,0) IDENTITY,
// CZSJ datetime NULL,
// FPBZ char(1) NOT NULL,
// CONSTRAINT PK_T99_RH_LOG
// PRIMARY KEY CLUSTERED (ID)
//)
//LOCK ALLPAGES
//go

Wed Jan 24, 2001 9:56 am View user's profile Send private message
weizeyin



Joined: 22 Jan 2001
Posts: 9

Post Re: DatabaseUpdate Reply with quote

: Try without NONCLUSTERED
: Try without NONCLUSTERED

Sorry,I had modified 'NONCLUSTERED' to 'CLUSTERED',but result was same.

//CREATE TABLE dbo.T99_RH_LOG
//(
// FILENAME varchar(255) NOT NULL,
// ID numeric(16,0) IDENTITY,
// CZSJ datetime NULL,
// FPBZ char(1) NOT NULL,
// CONSTRAINT PK_T99_RH_LOG
// PRIMARY KEY CLUSTERED (ID)
//)
//LOCK ALLPAGES
//go


Thu Jan 25, 2001 12:20 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: DatabaseUpdate Reply with quote

Hm... Are you connecting to database as dbo or some other user, not aliased to dbo?

: Sorry,I had modified 'NONCLUSTERED' to 'CLUSTERED',but result was same.

: //CREATE TABLE dbo.T99_RH_LOG
: //(
: // FILENAME varchar(255) NOT NULL,
: // ID numeric(16,0) IDENTITY,
: // CZSJ datetime NULL,
: // FPBZ char(1) NOT NULL,
: // CONSTRAINT PK_T99_RH_LOG
: // PRIMARY KEY CLUSTERED (ID)
: //)
: //LOCK ALLPAGES
: //go

Thu Jan 25, 2001 9:34 am View user's profile Send private message
weizeyin



Joined: 22 Jan 2001
Posts: 9

Post Re: DatabaseUpdate Reply with quote

: Hm... Are you connecting to database as dbo or some other user, not aliased
: to dbo?

I had logined to database with 'sa'.

Thu Jan 25, 2001 10:18 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: DatabaseUpdate Reply with quote

Please try specifying full table name in the SELECT as
SELECT FILENAME,ID,CZSJ,FPBZ FROM DBO.T99_RH_LOG WHERE FPBZ='0'

If it does not help, please email to support@softtreetech.com to open support case.

: I had logined to database with 'sa'.

Thu Jan 25, 2001 11:40 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.