🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.databases
Article #51

Several Questions

#51
From: Travis Elkins
Date: Fri, 09 Jul 1999 00:00
108 lines
6030 bytes
This is a multi-part message in MIME format.
--------------7E8B41AEED9E3DB58BD7344D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello,

I have several questions I would like some help on.  For the most part,
they have something to do with database development, but there are some
related to DLLs/packages, (D)COM, threads, and other items.  Please, any
help or advice anyone might have would be greatly appreciated.

1. We have a database on a server that is relatively large and slow.  We
are developing some client applications that will display statistical
information from this data source.  Retrieving the data is a pretty slow
process.  So, currently all activity stops while waiting for the data
(TTable and TQuery components) to open.  I would say that this behavior
doesn't affect the main goal of the application, since it's just meant
to be watched and updated every 5-15 minutes, but it is slightly
irritating.

We are quite sure that if we have some other process retrieve the data,
and let our (main) application know that it's finished, then we can
quickly retrieve that data.  Several ideas included a separate
DLL/package, thread, or (D)COM server that would retrieve the
information from the database server and then alert our application when
the process was complete.  Then, we could quickly retrieve the data from
the 'middleman' with a fraction of the delay.

If you have understood what I am looking for, then I hope that you can
offer some advice.  I've looked at (D)COM servers, but don't know how to
implement callback procedures or to transfer data (objects).  I've tried
threads, but I'm quite sure I'm leaking resources like mad and my
"simple" test apps aren't working as I intended.  I haven't tried
DLLs/packages yet, but I believe that so long as their in the same
process, then it wouldn't be any different than if it were in the main
EXE.  So, please, any advice would really be appreciated.

2. I had some quick questions about AUTOINC fields.  I remember reading
somewhere that one should/could use triggers instead to implement such
behavior.  Is this a better alternative?  I would guess not, but I am
not sure.  Nor do I remember what I read or where I read it, so I don't
konw what else to do other than to ask others.

Also, I was hoping someone could tell me what the upper limit is with
AUTOINC fields.  I'm quite sure it won't just keep counting forever and
ever.  Is it a standard integer or what?  Or, does it depend on the
database?  (I'm using Paradox.)  And, will it use all possible values,
or just stop when it reaches a maximum, regardless of the total record
count.

Finally, I want to know what happens when the upper limit is reached.
Will it "roll over" and start filling in any "missing" values?  Look at
my example:
The upper limit is 10.  I add 8 records giving me the AUTOINC values of
1-8.  Then, I delete records 3 and 5 leaving me with 6 records with
AUTOINC values of 1-2, 4, and 6-8.  Then, I add two more.  This adds 9
and 10.  What if I add another.  Will it then find that 3 and 5 are free
and use that?  If so, what then happens when 3 and 5 are both filled up?

3. I have had some difficulties creating a Paradox table using SQL with
a field described as NOT NULL.  I create a simple table with two
fields.  One is AUTOINC, and the other is VARCHAR(x) NOT NULL.  I
receive an error when attempted to execute the statement from SQL
Explorer.  When I remove NOT NULL from the statement, it works fine.
Can anyone explain this behavior?  Can anyone suggest an alternative?

4.  According to the localsql.hlp help file, FOREIGN KEY is not
supported in local SQL.  It's my desire to properly implement
referential integrity during table creation.  Are there any alternative
methods to implementing foreign keys and referential integrity
programmatically from Delphi with local Paradox tables?

Well, I believe that's the extent of my questions.  As I've mentioned,
any help would really be appreciated.  If I'm unclear about any of my
problems or questions, feel free to contact me and ask for further
information or more clear explanations.

I would also like to ask that respondents address me by email as well as
the newsgroups.  This allows me to know immediately when someone has
responded.  Plus, I have email access both at work and at home, but only
newsgroup access from work.  I've had people do one or the other in the
past...please do both.

Thanks again for your time.

Travis

--------------7E8B41AEED9E3DB58BD7344D
Content-Type: text/x-vcard; charset=us-ascii;
 name="telkins.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Travis Elkins
Content-Disposition: attachment;
 filename="telkins.vcf"

begin:vcard 
n:Elkins;Travis
x-mozilla-html:TRUE
org:Plus Data Danmark a/s
version:2.1
email;internet:telkins@plusdata.com
note:Please respond to my email address as well as the newsgroup(s).  Thank you.
x-mozilla-cpt:;0
fn:Travis Elkins
end:vcard

--------------7E8B41AEED9E3DB58BD7344D--
Technical Details
Message-ID: <3785CD16.C28212B1@plusdata.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: ffff5,efba374fd9f6d267,start
X-Google-Attributes: gidffff5,public
X-Google-Thread: f6386,efba374fd9f6d267,start
X-Google-Attributes: gidf6386,public
X-Google-Thread: 10baee,efba374fd9f6d267,start
X-Google-Attributes: gid10baee,public
From: Travis Elkins <telkins@plusdata.com>
Subject: Several Questions
Date: 1999/07/09
Message-ID: <3785CD16.C28212B1@plusdata.com>
X-Deja-AN: 499043936
X-Accept-Language: da
Content-Type: multipart/mixed; boundary="------------7E8B41AEED9E3DB58BD7344D"
X-Complaints-To: abuse@uni2.dk
X-Trace: news.get2net.dk 931515593 192.38.197.18 (Fri, 09 Jul 1999 12:19:53 MET DST)
Organization: UNI2 Internet Kunde
MIME-Version: 1.0
NNTP-Posting-Date: Fri, 09 Jul 1999 12:19:53 MET DST
Newsgroups: comp.lang.pascal.delphi.databases,borland.public.delphi.database.multi-tier,comp.lang.pascal.delphi.misc