Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Trying to update the "Version" field
Wed, Nov 10 2010 6:46 AMPermanent Link

Richard

ENT Technologies

I'm trying to update the version number of one of my tables with this code:

qry.SQL.Clear;
qry.SQL.Add('UPDATE Information.Tables SET Version = 2.00 WHERE Name = ' +Engine.QuotedSQLStr('DrawDetails'));
qry.ExecSQL;

However, I get a "An attempt was made to update a read-only cursor" error.

Is it possible to update the version number of a table?
Wed, Nov 10 2010 7:33 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Richard

>I'm trying to update the version number of one of my tables with this code:
>
>qry.SQL.Clear;
>qry.SQL.Add('UPDATE Information.Tables SET Version = 2.00 WHERE Name = ' +Engine.QuotedSQLStr('DrawDetails'));
>qry.ExecSQL;
>
>However, I get a "An attempt was made to update a read-only cursor" error.
>
>Is it possible to update the version number of a table?

Sure is, but you're trying to do it the wrong way Smiley

What you need is the ALTER TABLE command (I'll let you read the details in the OLH).

Basically the various system tables can't be updated via standard SQL commands but have to be maintained with their own special syntax.

Roy Lambert [Team Elevate]
Wed, Nov 10 2010 6:03 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Richard,

<< Is it possible to update the version number of a table? >>

As Roy indicated, you'll need to use something like this:

ALTER TABLE DrawDetails
VERSION 2.00

--
Tim Young
Elevate Software
www.elevatesoft.com
Wed, Nov 10 2010 11:26 PMPermanent Link

Richard

ENT Technologies

"Tim Young [Elevate Software]" wrote:

Richard,

<< Is it possible to update the version number of a table? >>

As Roy indicated, you'll need to use something like this:

ALTER TABLE DrawDetails
VERSION 2.00


Thanks very much. It's working now. There was a problem using single quotes (ignore this if it's in the manual. I obviously haven't seen that bit yet)

These don't work:
qry.SQL.Add('ALTER TABLE ' + Engine.QuotedSQLStr('DrawDetails') + ' VERSION 2.00');
qry.SQL.Add('ALTER TABLE ''DrawDetails'' VERSION 2.00'); // Two pairs of single quotes

But these do:
qry.SQL.Add('ALTER TABLE "DrawDetails" VERSION 2.00'); //Two double quotes
qry.SQL.Add('ALTER TABLE DrawDetails VERSION 2.00');
Sat, Nov 13 2010 9:43 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Richard,

<< Thanks very much. It's working now. There was a problem using single
quotes (ignore this if it's in the manual. I obviously haven't seen that bit
yet) >>

Yes, single quotes are only used for
string/date/time/timestamp/interval/blob constants, and double quotes are
always used for identifers:

http://www.elevatesoft.com/manual?action=viewtopic&id=edb2sql&topic=Identifiers

--
Tim Young
Elevate Software
www.elevatesoft.com
Image