Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: DBI: checking if a table exists in a cross-DB manner?

by herveus (Prior)
on Dec 03, 2004 at 12:51 UTC ( [id://412104]=note: print w/replies, xml ) Need Help??


in reply to Re: DBI: checking if a table exists in a cross-DB manner?
in thread DBI: checking if a table exists in a cross-DB manner?

Howdy!

'TRUNCATE TABLE' is not, so far as I can tell, standard SQL, and isn't necessarily going to be available. The index to the SQL-92 standard has no entry for 'truncate'. I don't know about newer SQL standards, but SQL-92 seems to be still widely used as a basis.

yours,
Michael
  • Comment on Re^2: DBI: checking if a table exists in a cross-DB manner?

Replies are listed 'Best First'.
Re^3: DBI: checking if a table exists in a cross-DB manner?
by thor (Priest) on Dec 03, 2004 at 13:15 UTC
    You're absolutely correct. But AFAIK, all of the big names support it. I've yet to use a database that didn't have it.

    thor

    Feel the white light, the light within
    Be your own disciple, fan the sparks of will
    For all of us waiting, your kingdom will come

      Howdy!

      OK. But SQLite does not appear to support it, to name one very useful non-big name.

      yours,
      Michael
        Getting around to learning that has been on my "to-do" list for a while, so I guess it's no surprise that I didn't know that. I stand corrected. :)

        thor

        Feel the white light, the light within
        Be your own disciple, fan the sparks of will
        For all of us waiting, your kingdom will come

      Depends on what you call 'the big names'.

      FWIW Ingres doesn't support it - to name a rather 'big' open-source RDBMS. Instead you have MODIFY table TO TRUNCATE. But that's not SQL-9X either.

        As an aside, I wonder if there's a forthcoming SQL standard that specifies a common syntax for this. It seems like a useful thing to do...even if the backend translates it to "DELETE FROM table".

        thor

        Feel the white light, the light within
        Be your own disciple, fan the sparks of will
        For all of us waiting, your kingdom will come

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://412104]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2024-04-24 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found