Importing Data and RecID

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Wed Sep 2 02:20:10 CDT 2009


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]




More information about the Valentina mailing list