Re: Checking if a table exist

2006-05-02 Thread Robert Roggenbuck
Hi Peter, in case You just want to be shure not to destroy an already existing table by creating it again, You can just isse an $dbh-do(CREATE TABLE...). An already existing table will never desroyed and a warning will be raised. Greetings Robert - Loo, Peter # PHX wrote: Hi All,

RE: Checking if a table exist

2006-04-28 Thread Reidy, Ron
1. Look in the data dictionary 2. Select from the table and trap the appropriate error code -Original Message- From: Loo, Peter # PHX [mailto:[EMAIL PROTECTED] Sent: Thursday, April 27, 2006 4:33 PM To: List - DBI users Subject: Checking if a table exist Hi All, Does anyone know of

Re: Checking if a table exist

2006-04-28 Thread JupiterHost.Net
Reidy, Ron wrote: 1. Look in the data dictionary 2. Select from the table and trap the appropriate error code -Original Message- From: Loo, Peter # PHX [mailto:[EMAIL PROTECTED] Sent: Thursday, April 27, 2006 4:33 PM To: List - DBI users Subject: Checking if a table exist Hi All,

Re: Checking if a table exist

2006-04-27 Thread Jonathan Leffler
On 4/27/06, Loo, Peter # PHX [EMAIL PROTECTED] wrote: Does anyone know of a good way to check if a table exist disregarding whether the table has data or not? Simplest is: my $sth = $dbh-prepare(SELECT * FROM $tablename); if ($sth) { ...table exists...probably; you might need to do

Re: Checking if a table exist

2006-04-27 Thread Ron Savage
On Thu, 27 Apr 2006 17:17:26 -0700, Jonathan Leffler wrote: Hi Jonathan my $sth = $dbh-prepare(SELECT * FROM $tablename); if ($sth) { ...table exists...probably; you might need to do $sth- execute to be sure as different DBMS differ... } else { ...table probably doesn't exist, or it

RE: Checking if a table exist

2006-04-27 Thread Loo, Peter # PHX
users Subject: Re: Checking if a table exist On 4/27/06, Loo, Peter # PHX [EMAIL PROTECTED] wrote: Does anyone know of a good way to check if a table exist disregarding whether the table has data or not? Simplest is: my $sth = $dbh-prepare(SELECT * FROM $tablename