Clearing tables...

2006-03-09 Thread Sky Blueshoes

What is the sequel statement to clear an entire table using DBI?


SkyBlueshoes

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: Clearing tables...

2006-03-09 Thread Timothy Johnson

Usually you'll want to do something like this:

my $sth = $dbh-prepare(DELETE FROM TABLE1);
$sth-execute();

Is that what you meant?  It will delete all records.



-Original Message-
From: Sky Blueshoes [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 09, 2006 4:46 PM
To: beginners@perl.org
Subject: Clearing tables...

What is the sequel statement to clear an entire table using DBI?


SkyBlueshoes

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Clearing tables...

2006-03-09 Thread JupiterHost.Net



Sky Blueshoes wrote:

What is the sequel statement to clear an entire table using DBI?


a) you mean Ess Queue Ell nor sequel

b) it depends on the database your using, but generally it will be a 
DELETE FROM table or DROP TABLE table type statement. See your DB 
vendor's documentation fro specifics (IE mysql.com)


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




Re: Clearing tables...

2006-03-09 Thread Bob Showalter

Sky Blueshoes wrote:
 What is the sequel statement to clear an entire table using DBI?

It depends on your database, but typically:

  $dbh-do('delete from some_table');

Some databases support TRUNCATE:

  $dbh-do('truncate some_table');


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response