Quote:
>My form needs to create a Sybase temporary table on Form-Create and then
>insert data into this table using a stored procedure (TStoreProc component)
>when a particular button is pressed on the screen. I must then be able to
>access this data whilst the form is active.
>The problem I have is that everytime I execute a different TStoreProc
>component, it has a different thread to the database, and the temporary
>table is based on a thread.
>I would be very grateful if anybody had any suggestions about how the above
>could be done. Is there a free-hand component in Delphi where one can do
>INSERTS, UPDATES, CREATE TABLES etc ?
>Thanks
>Bronwen
The TQuery component should allow you to pass through the SQL to create a
table, etc. When you state that you need a temp table, are you really
referring to a Sybase temp table in tempdb? You could also create a
persistent table that stores a sybase process id (spid) in a column so that
rows could be inserted, selected, and deleted using this spid.
Each time you create a new thread you would need to get the spid for that
the logic to manage entries in the table.
One caveat with the above would be locking. I don't know what kind of use
such a table would be put to, so it is hard to know if you would have locking
problems.
--
Bob McClintock