Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 5 of 5 total |
Trying to update the "Version" field |
Wed, Nov 10 2010 6:46 AM | Permanent 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 AM | Permanent Link |
Roy Lambert NLH Associates 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 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 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. 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 PM | Permanent 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 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. 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 |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |