VStudio - Auto Increment - IDENTITY flag/property/attribute - is a Method

Barry G. Sumpter BarrySum at BigPond.Net.AU
Fri Jun 1 00:50:48 CDT 2007


After excuting the create table with the Identity attribute

Then dumping the database I got this which I thought was very interesting.

The Attribute is considered a METHOD.
And Removes the XX filed name from the list of fields and places it in the
Methods category.




CREATE TABLE "Test" (
	"Test" LONG  NOT NULL,
	"aa" LONG  NOT NULL,
	"xx" ULONG METHOD ('RecID')  NOT NULL  IDENTITY);




-----Original Message-----
From: valentina-studio-bounces at lists.macserve.net
[mailto:valentina-studio-bounces at lists.macserve.net] On Behalf Of Barry G.
Sumpter
Sent: Friday, 1 June 2007 2:20 PM
To: valentina-studio at lists.macserve.net
Subject: RE: VStudio - Auto Increment - IDENTITY flag/property/attribute

The V4RB sample app AutoIncrement.rb shows we can build an Auto Increment
field via SQL in the following code.

How do I flag a field as Auto Increment in VStudio?



 dim result as Integer
  
  // by Relational model table Person should have KEY field, which is unique
and NOT NULL.
  // It would be IDENTITY field.
  
  result = mDatabase.SQLExecute("CREATE TABLE person ( id  ULONG IDENTITY,
firstName STRING(40) )")
  showStatistic
  
Exception exc as VException 
  wProperties.ShowError( exc )




-----Original Message-----
From: valentina-studio-bounces at lists.macserve.net
[mailto:valentina-studio-bounces at lists.macserve.net] On Behalf Of Barry G.
Sumpter
Sent: Friday, 1 June 2007 2:09 PM
To: valentina-studio at lists.macserve.net
Subject: RE: VStudio - make and existing field the primary key?

When I drop the primary key the function also mistakenly drops the Unique
Attribute 
In VStudio as well.  The DB is OK just VStudio.

-----Original Message-----
From: valentina-studio-bounces at lists.macserve.net
[mailto:valentina-studio-bounces at lists.macserve.net] On Behalf Of Barry G.
Sumpter
Sent: Friday, 1 June 2007 2:03 PM
To: valentina-studio at lists.macserve.net
Subject: RE: VStudio - make and existing field the primary key?

When I execute a Valentina Dump of a test database I get this:

CREATE TABLE "Test" (
	"Test" LONG  NOT NULL UNIQUE INDEXED);



I believe is should be this:

CREATE TABLE "Test" (
	"Test" LONG  PRIMARY KEY NOT NULL UNIQUE INDEXED);

Is the dump missing the Primary Key?





-----Original Message-----
From: Barry G. Sumpter [mailto:BarrySum at BigPond.Net.AU] 
Sent: Friday, 1 June 2007 1:29 PM
To: 'Barry G. Sumpter'; valentina-studio at lists.macserve.net
Subject: RE: VStudio - make and existing field the primary key?

If there is an existing Primary Key (PK) then you must remove the primary
key to have any other candidates.

I can remove the primary key notation on a field - VStudio errors out and
any subsequent attempt to create a primary key errors out in the same way.



I Believe, the existing field has to be Long, Unique, indexed, and NOT NULL
to be a candidate.
  And the existing data must match the Unique attribute. i.e. no duplicate
data.



-----Original Message-----
From: Barry G. Sumpter [mailto:BarrySum at BigPond.Net.AU] 
Sent: Friday, 1 June 2007 12:53 PM
To: 'valentina-studio at lists.macserve.net'
Subject: RE: VStudio - make and existing field the primary key?

How do you make and existing field the primary key?

_______________________________________________
Valentina-studio mailing list
Valentina-studio at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina-studio

_______________________________________________
Valentina-studio mailing list
Valentina-studio at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina-studio

_______________________________________________
Valentina-studio mailing list
Valentina-studio at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina-studio



More information about the Valentina-studio mailing list