Re: [sqlite] How to conditionally drop a table?

2007-01-25 Thread Martin Jenkins

jose isaias cabrera wrote:
I got it right away.  And I just don't laugh for the fun of it.  :-) 
It's gotta be funny.  Was it a tad harsh?  Yeah... But it was funny.

See http://c2.com/cgi/wiki?ZenSlap

Martin

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] How to conditionally drop a table?

2007-01-25 Thread John Stanton

Martin Jenkins wrote:

G. Roderick Singleton wrote:


On Thu, 2007-01-25 at 11:13 -0600, John Stanton wrote:
 

If you find a way to drop a table which dosn't exist. let us know how 
you do it.



Thanks for your insight. However what's your point? That the OP didn't
check the website, that my reference was incorrect or what?   


He's not making a point - it's British (dry, subtle) humour.

Martin

- 


To unsubscribe, send email to [EMAIL PROTECTED]
- 




Very perspicaceous old chap.  ;-)

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] How to conditionally drop a table?

2007-01-25 Thread P Kishor

DROP TABLE [IF EXISTS]
DROP INDEX [IF EXISTS]
CREATE TABLE [IF NOT EXISTS]
and so on...

On 1/25/07, Nicolas Williams <[EMAIL PROTECTED]> wrote:

On Thu, Jan 25, 2007 at 10:35:23AM -0500, Anderson, James H (IT) wrote:
> I need a way to drop a table only if that table exists. How would I do
> that?

You'd think this would work:

SELECT CASE WHEN
(SELECT count(*) FROM sqlite_master WHERE
type = 'table' AND name = 'foo') > 0
THEN (DROP TABLE foo) END;

but it doesn't (it yields a syntax error).

In fact, inserts and updates inside a select case when all yield syntax
errors.

W.r.t. to dropping a table inside a select case when, well, you should
know whether the schema to begin with, so that makes sense.

Nico
--

-
To unsubscribe, send email to [EMAIL PROTECTED]
-





--
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation http://www.osgeo.org/education/
-
collaborate, communicate, compete
=

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] How to conditionally drop a table?

2007-01-25 Thread G. Roderick Singleton
On Thu, 2007-01-25 at 18:40 +, Martin Jenkins wrote:
> G. Roderick Singleton wrote:
> > On Thu, 2007-01-25 at 11:13 -0600, John Stanton wrote:
> >   
> >> If you find a way to drop a table which dosn't exist. let us know how 
> >> you do it.
> >> 
> > Thanks for your insight. However what's your point? That the OP didn't
> > check the website, that my reference was incorrect or what? 
> >   
> He's not making a point - it's British (dry, subtle) humour.
> 

In bad taste if that what the attempt was. ;-(
-- 
G. Roderick Singleton <[EMAIL PROTECTED]>
PATH tech



smime.p7s
Description: S/MIME cryptographic signature


Re: [sqlite] How to conditionally drop a table?

2007-01-25 Thread Nicolas Williams
On Thu, Jan 25, 2007 at 10:35:23AM -0500, Anderson, James H (IT) wrote:
> I need a way to drop a table only if that table exists. How would I do
> that?

You'd think this would work:

SELECT CASE WHEN
(SELECT count(*) FROM sqlite_master WHERE
type = 'table' AND name = 'foo') > 0
THEN (DROP TABLE foo) END;

but it doesn't (it yields a syntax error).

In fact, inserts and updates inside a select case when all yield syntax
errors.

W.r.t. to dropping a table inside a select case when, well, you should
know whether the schema to begin with, so that makes sense.

Nico
-- 

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] How to conditionally drop a table?

2007-01-25 Thread jose isaias cabrera


Fred,

I got it right away.  And I just don't laugh for the fun of it.  :-) It's 
gotta be funny.  Was it a tad harsh?  Yeah... But it was funny.


- Original Message - 
From: "Fred Williams" <[EMAIL PROTECTED]>

To: <sqlite-users@sqlite.org>
Sent: Thursday, January 25, 2007 1:42 PM
Subject: RE: [sqlite] How to conditionally drop a table?



-Original Message-
From: G. Roderick Singleton [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 25, 2007 12:06 PM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] How to conditionally drop a table?


On Thu, 2007-01-25 at 11:13 -0600, John Stanton wrote:
> If you find a way to drop a table which dosn't exist. let
us know how
> you do it.
>
> G. Roderick Singleton wrote:
> > On Thu, 2007-01-25 at 10:35 -0500, Anderson, James H (IT) wrote:
> >
> >>I need a way to drop a table only if that table exists.
How would I do
> >>that?
> >>
> >>Thanks,
> >
> >
> > Are you asking if http://sqlite.org/lang_droptable.html
works or have
> > you had problems?
>
>

Thanks for your insight. However what's your point? That the OP didn't
check the website, that my reference was incorrect or what?
--
G. Roderick Singleton <[EMAIL PROTECTED]>
PATH tech




Now you know why there are no software types that are stand up comedians
:-)

I think it was a (bad) attempt at a joke...

Fred


-
To unsubscribe, send email to [EMAIL PROTECTED]
-




-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] How to conditionally drop a table?

2007-01-25 Thread Fred Williams
> -Original Message-
> From: G. Roderick Singleton [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 25, 2007 12:06 PM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] How to conditionally drop a table?
>
>
> On Thu, 2007-01-25 at 11:13 -0600, John Stanton wrote:
> > If you find a way to drop a table which dosn't exist. let
> us know how
> > you do it.
> >
> > G. Roderick Singleton wrote:
> > > On Thu, 2007-01-25 at 10:35 -0500, Anderson, James H (IT) wrote:
> > >
> > >>I need a way to drop a table only if that table exists.
> How would I do
> > >>that?
> > >>
> > >>Thanks,
> > >
> > >
> > > Are you asking if http://sqlite.org/lang_droptable.html
> works or have
> > > you had problems?
> >
> >
>
> Thanks for your insight. However what's your point? That the OP didn't
> check the website, that my reference was incorrect or what?
> --
> G. Roderick Singleton <[EMAIL PROTECTED]>
> PATH tech
>
>

Now you know why there are no software types that are stand up comedians
:-)

I think it was a (bad) attempt at a joke...

Fred


-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] How to conditionally drop a table?

2007-01-25 Thread Martin Jenkins

G. Roderick Singleton wrote:

On Thu, 2007-01-25 at 11:13 -0600, John Stanton wrote:
  
If you find a way to drop a table which dosn't exist. let us know how 
you do it.


Thanks for your insight. However what's your point? That the OP didn't
check the website, that my reference was incorrect or what? 
  

He's not making a point - it's British (dry, subtle) humour.

Martin

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] How to conditionally drop a table?

2007-01-25 Thread G. Roderick Singleton
On Thu, 2007-01-25 at 11:13 -0600, John Stanton wrote:
> If you find a way to drop a table which dosn't exist. let us know how 
> you do it.
> 
> G. Roderick Singleton wrote:
> > On Thu, 2007-01-25 at 10:35 -0500, Anderson, James H (IT) wrote:
> > 
> >>I need a way to drop a table only if that table exists. How would I do
> >>that?
> >>
> >>Thanks,
> > 
> > 
> > Are you asking if http://sqlite.org/lang_droptable.html works or have
> > you had problems?
> 
> 

Thanks for your insight. However what's your point? That the OP didn't
check the website, that my reference was incorrect or what? 
-- 
G. Roderick Singleton <[EMAIL PROTECTED]>
PATH tech



smime.p7s
Description: S/MIME cryptographic signature


Re: [sqlite] How to conditionally drop a table?

2007-01-25 Thread John Stanton
If you find a way to drop a table which dosn't exist. let us know how 
you do it.


G. Roderick Singleton wrote:

On Thu, 2007-01-25 at 10:35 -0500, Anderson, James H (IT) wrote:


I need a way to drop a table only if that table exists. How would I do
that?

Thanks,



Are you asking if http://sqlite.org/lang_droptable.html works or have
you had problems?



-
To unsubscribe, send email to [EMAIL PROTECTED]
-



RE: [sqlite] How to conditionally drop a table?

2007-01-25 Thread Anderson, James H \(IT\)
Sorry, I should have checked the site first. My background is sybase and
I didn't expect anything so simple.

Thanks very much,

jim 

-Original Message-
From: G. Roderick Singleton [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 25, 2007 10:49 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] How to conditionally drop a table?

On Thu, 2007-01-25 at 10:35 -0500, Anderson, James H (IT) wrote:
> I need a way to drop a table only if that table exists. How would I do
> that?
> 
> Thanks,

Are you asking if http://sqlite.org/lang_droptable.html works or have
you had problems?
-- 
G. Roderick Singleton <[EMAIL PROTECTED]>
PATH tech


NOTICE: If received in error, please destroy and notify sender. Sender does not 
intend to waive confidentiality or privilege. Use of this email is prohibited 
when received in error.

-
To unsubscribe, send email to [EMAIL PROTECTED]
-



Re: [sqlite] How to conditionally drop a table?

2007-01-25 Thread G. Roderick Singleton
On Thu, 2007-01-25 at 10:35 -0500, Anderson, James H (IT) wrote:
> I need a way to drop a table only if that table exists. How would I do
> that?
> 
> Thanks,

Are you asking if http://sqlite.org/lang_droptable.html works or have
you had problems?
-- 
G. Roderick Singleton <[EMAIL PROTECTED]>
PATH tech



smime.p7s
Description: S/MIME cryptographic signature