🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.interbase.sql
3 messages
3 total messages Started by Tom Greenway Thu, 05 Dec 2002 01:31
Whenever Sqlerror...
#11162
Author: Tom Greenway
Date: Thu, 05 Dec 2002 01:31
25 lines
1641 bytes
Is there a way to see if a trigger or table exists in the database before
submitting an SQL update script?

Example:
Client 1 has a database with NO BankDesc table
Client 2 has a database WITH a BankDesc table.

Need to incorporate a SQL update that is similar to:
 If NOT exist BankDesc then Create BankDesc...

If possible, then the same update could be ran on both Client 1 and Client
2's database with no errors.

I looked at the 'Whenever SQLERROR Continue' example, but attempting a SQL
update:
Create table BankDesc....
Whenever SqlError Continue

via IBConsole was not successful (table already in database).

Any suggestions would be appreciated.


Thanks,
Tom Greenway
Re: Whenever Sqlerror...
#11161
Author: Bill Todd
Date: Thu, 05 Dec 2002 01:31
6 lines
1220 bytes
Query the system tables described in chapter 7 of the Language
Reference.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
Re: Whenever Sqlerror...
#11163
Author: Martijn Tonies
Date: Thu, 05 Dec 2002 08:04
42 lines
2106 bytes
> Is there a way to see if a trigger or table exists in the database before
> submitting an SQL update script?
>
> Example:
> Client 1 has a database with NO BankDesc table
> Client 2 has a database WITH a BankDesc table.
>
> Need to incorporate a SQL update that is similar to:
>  If NOT exist BankDesc then Create BankDesc...
>
> If possible, then the same update could be ran on both Client 1 and Client
> 2's database with no errors.
>
> I looked at the 'Whenever SQLERROR Continue' example, but attempting a SQL
> update:
> Create table BankDesc....
> Whenever SqlError Continue
>
> via IBConsole was not successful (table already in database).

If you have another look at the SQLERROR sample you'll see that most
probably it's Embedded SQL only and the WHEN statement is Procedure
language only.


--

With regards,

Martijn Tonies
InterBase Workbench - the developer tool for InterBase
http://www.upscene.com

Firebird Workbench - the developer tool for Firebird
http://www.upscene.com

Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads