Importing Data and RecID
Barry G. Sumpter
barrysum at bigpond.net.au
Wed Sep 2 03:01:24 CDT 2009
LOL. Good luck following that.
With Primary keys and foreign keys you can see the value of the link.
Primary key of State: Vic you could see a foreign key of Vic
Vic representing the state of Victoria
With Valentina just forget about using Primary and Foreign key.
Just use the RecID links instead.
A quick sql example is:
Link Record (27) of tblPersonnel with Each Record (8) of tblStates
27 is the RecID of a Personnel record say Barry
And 8 is the RecID of a States record in this case Victoria
There is an unlink as well and some pretty cool ways of defining the Record
clause.
Again don't waste your time with the other types of links.
You can also setup multiple links say for a sales man who services different
states.
And as far as I know you have to use the additional LINK sql command to link
records.
I'd like to know if there is a way of linking records using Valentina
studio.
NOT the sql builder but the visual link window.
i.e. check mark this record in that table
then check mark the records in the other table
now click "Link" button
Hth
-----Original Message-----
From: valentina-bounces at lists.macserve.net
[mailto:valentina-bounces at lists.macserve.net] On Behalf Of Ruslan Zasukhin
Sent: Wednesday, 2 September 2009 5:20 PM
To: valentina at lists.macserve.net
Subject: Re: Importing Data and RecID
On 9/2/09 2:38 AM, "Greg Olson-Hyde" <greg at hawkmount.com> wrote:
Hi Greg,
> I am making progress importing my data into Valentina - my data, it
> appears, was VERY 'dirty', it has had a good wash and is much cleaner
> now!
Nice to hear :)
I believe when you learn Valentina Links, and may be start use them you will
get even more clean data model.
> I am having trouble with ID's. For example, if I create a table using
> my existing SQLite:
>
> CREATE TABLE tblqCategory (iqCategoryCategoryID INTEGER PRIMARY KEY
> AUTOINCREMENT, sqCategoryCategory TEXT, UNIQUE (sqCategoryCategory))
> However, my existing 'iqCategoryCategoryID' data has holes in it, it
> is not sequential. So, when I import and 'iqCategoryCategoryID'
> becomes 'RecID', Valentina then fills in the holes by making all the
> ID's sequential. My relationships will fall apart.
Here Mistake of course.
You should have in Valentina table the same iqCategoryCategoryID field,
And IMPORT existed values into this Valentina field also.
So you will get Valentina Table EXACTLY as you have it in SqlLite.
You can perfectly continue to use this field in your production app.
*************
OPTIONALLY you may want convert PRIMARY KEY to RecID concept.
But this conversion shold happens AFTER import of course.
You can read about such "conversion" of
Foreign Key to ObjectPtr link
In our WIKI, section
Link Refactoring.
<http://valentina-db.com/dokuwiki/doku.php?id=valentina:vcomponents:vkernel:
vlink:vlink>
Valentina provides special SQL command which do the job of this.
*************
ALSO
Please read carefully RecID field description again.
It NOT promise to be sequential.
When you will start delete records, it also will have holes,
And later reuse them.
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
_______________________________________________
Valentina mailing list
Valentina at lists.macserve.net
http://lists.macserve.net/mailman/listinfo/valentina
More information about the Valentina
mailing list