SQL does-table-exist? (was Re: [V4RB] SQL "Create Table")
Ruslan Zasukhin
sunshine at public.kherson.ua
Tue Mar 11 23:16:59 CST 2003
on 3/11/03 9:33 PM, Erik Mueller-Harder at lists at praxisworks.com wrote:
> On Tuesday, March 11, 2003, Fred.Stephenson wrote:
>
>>> I wanted to find out whether a particular table exists already in
>>> the database. Isn't checking the sysItem table the best way to do
>>> this? What would be a better way?
>>
>> well I suppose you could do
>> if mydb.baseobject("tablename")= nil then
>> // whatever
>> else
>> //whatever
>> end if
>
> Yes, thanks. That's what I've done in past projects with Rb and Valentina --
> it works fine.
>
> For several unrelated reasons, I'm trying to do everything possible with SQL
> calls, though. What is the best way to find out whether a table exists (or
> doesn't exist) in a database via SQL?
Well, if you care about Server solution, then good news are that above way
ALSO will work.
This is our headache right now in fact :-)
> I had thought a simple inquiry of the SysItem table (VKernal documentation,
> page 15) would be the ticket -- and it seems to work fine. Ruslan sounds
> concerned about it though. Any other thoughts?
Just sys tables of Valentina right now are non-standard.
May be in 2.0 something will be changed
May be no.
> Ruslan, you say "This is not safe and good way." Is it not OK to perform
> inquiries on the system tables?
This is not very well tested.
So be careful.
For example in 1.9.7 was fixed bug on access to sys tables.
--
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com
To subscribe to the Valentina mail list go to:
http://listserv.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------
More information about the Valentina
mailing list