#1  
Old 12th August 2005, 04:18 AM
Francesco Savastano
 
Posts: n/a
Default How to include some information like version number into a NX table file

Hello,
if let's say in version 1.0 of my database I create a table with 5 fields
and after in next version I need to add more fields : I want to be able to
detect programmatically tables created with previous version and then
convert to tables with new version. How can i add this extra information
like a version number to the table file: I dont want to add it for each
record..


  #2  
Old 12th August 2005, 05:16 AM
Franz-Leo Chomse [NDX]
 
Posts: n/a
Default Re: How to include some information like version number into a NX table file

On Thu, 11 Aug 2005 19:18:29 +0200, "Francesco Savastano"
<francosavastano@TakeThisOutFromAddress.virgilio.i t> wrote:

>Hello,
>if let's say in version 1.0 of my database I create a table with 5 fields
>and after in next version I need to add more fields : I want to be able to
>detect programmatically tables created with previous version and then
>convert to tables with new version. How can i add this extra information
>like a version number to the table file: I dont want to add it for each
>record..


You can either add an additional stream into each table or you have to
create a metadata database, which stores the datadictionary of each
version plus the table mapping for restructuring from the previous
version.


Regards from Germany

Franz-Leo Chomse [NexusDB Expert]
franz.leo.chomse@ndx.nexusdb_x.com (please remove "_x" to reply)
  #3  
Old 12th August 2005, 05:35 AM
Pierre Demers
 
Posts: n/a
Default Re: How to include some information like version number into a NX table file

Hello Francesco,

> if let's say in version 1.0 of my database I create a table with 5 fields
> and after in next version I need to add more fields : I want to be able to
> detect programmatically tables created with previous version and then
> convert to tables with new version. How can i add this extra information
> like a version number to the table file: I dont want to add it for each
> record..


I personnaly use the utility nxSourceMaker for this(v1 only). In the file
created with nxSourceMaker, I write the version of my tables. In one table I
save the version number of my app. At startup I compare both, if they are
not alike I call a restructure procedure from the nxSourceMaker file. Voilą.

If you are using V2, look in the binaries, Bert posted his new utility that
can replace nxSourceMaker. It is called NXDDCG.

HTH
Pierre


  #4  
Old 12th August 2005, 05:56 AM
Bert Moorthaemer
 
Posts: n/a
Default Re: How to include some information like version number into a NX table file

Pierre,

> If you are using V2, look in the binaries, Bert posted his new utility
> that
> can replace nxSourceMaker. It is called NXDDCG.


Ha! nothing better that mouth-2-mouth advertising :-)

Bert.

"Pierre Demers" <pierredemers@NOSPAMsympatico.ca> wrote in message
news:42fb9ce8@wic040d....
> Hello Francesco,
>
>> if let's say in version 1.0 of my database I create a table with 5 fields
>> and after in next version I need to add more fields : I want to be able
>> to
>> detect programmatically tables created with previous version and then
>> convert to tables with new version. How can i add this extra information
>> like a version number to the table file: I dont want to add it for each
>> record..

>
> I personnaly use the utility nxSourceMaker for this(v1 only). In the file
> created with nxSourceMaker, I write the version of my tables. In one table
> I
> save the version number of my app. At startup I compare both, if they are
> not alike I call a restructure procedure from the nxSourceMaker file.
> Voilą.
>
> If you are using V2, look in the binaries, Bert posted his new utility
> that
> can replace nxSourceMaker. It is called NXDDCG.
>
> HTH
> Pierre
>
>



  #5  
Old 12th August 2005, 09:12 AM
Pierre Demers
 
Posts: n/a
Default Re: How to include some information like version number into a NX table file

> Ha! nothing better that mouth-2-mouth advertising :-)

Yep, 75% of my sales...

Pierre


  #6  
Old 13th August 2005, 06:16 AM
Francesco Savastano
 
Posts: n/a
Default Re: How to include some information like version number into a NX table file


>you have to
> create a metadata database, which stores the datadictionary of each
> version plus the table mapping for restructuring from the previous
> version.


Can you explain how to do it (I am db beginner) with a small example of code
thanx?



  #7  
Old 13th August 2005, 06:54 AM
JFN
 
Posts: n/a
Default Re: How to include some information like version number into a NX table file

Francesco Savastano wrote:

>
> > you have to
> > create a metadata database, which stores the datadictionary of each
> > version plus the table mapping for restructuring from the previous
> > version.

>
> Can you explain how to do it (I am db beginner) with a small example
> of code thanx?


You may get a table datadictionary by using:

Dict := TnxDataDictionary.Create;
TheDatabase.GetGetDataDictionary(TableName, Password, Dict);

Now, put the dictionary in a BLOB (use Dict.AsStream property) and
store it in a table:

var
BS: TnxBlobStream;

begin
BS := NXTable.CreateBlobStream(SomeField, bmReadWrite);
try
BS.CopyFrom(aStream, aStream.Size);
finally
BS.Free;
end;

where aStream is the stream containing the datadictionary (or any blob
data).


HTH,
--
Jean-Francois Nifenecker, Bordeaux (EU)


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Build number, version number and releases in general Brian Evans [NDX] nexusdb.public.discussions 11 13th April 2006 12:56 AM
Max Number of Columns in Table? Dennis Landi nexusdb.public.support 1 7th June 2005 09:17 AM
Max number of fields in table? Holger Franke nexusdb.public.discussions 14 29th August 2003 09:48 PM
ANN: Important information regarding file compatibility between beta versions Thorsten Engler [NDA] nexusdb.public.announcements 0 16th July 2003 12:11 PM
ANN: Important information regarding file compatibility between beta versions Thorsten Engler [NDA] nexusdb.public.support 0 16th July 2003 12:11 PM


All times are GMT +11. The time now is 03:33 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.