This is a discussion on Clearing a database within the MySQL forums, part of the Database Server Software category; --> Hi. I need to empty a database file in SQLite completely without deleting/ recreating the file itself. DROP TABLE ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi. I need to empty a database file in SQLite completely without deleting/ recreating the file itself. DROP TABLE is an option, but I do not always know what tables or databases are present. Is there a simple function for that, something like DROP TABLE *; ? Thanks. |
| |||
| Mikhail Kovalev wrote: > Hi. > > I need to empty a database file in SQLite completely without deleting/ > recreating the file itself. DROP TABLE is an option, but I do not > always know what tables or databases are present. Is there a simple > function for that, something like DROP TABLE *; ? > > Thanks. Err, this is a mysql newsgroup (the clue is in the name). |
| |||
| Mikhail Kovalev wrote: > > Very well. What would you do in MySQL? I would drop the entire database and recreate it. In MySQL a database is simply a directory. Since you say that in SQLite the database is a file and you have some (as yet not revealed) reason for not dropping the whole database and recreating it, us MySQL wallahs simply cannot help you. |
| |||
| Mikhail Kovalev wrote: > Alas, there is no SQLite or general SQL group. Whilst there is no obvious SQLite usenet newsgroup, it is not true that there is no general SQL usenet newsgroup, nor is is correct that there are no SQLite groups. I put sqlite forum into google and was rewarded with a very active group at the top of the list. I'm still intrigued as to why the (to me) obvious method of dropping and re-creating the database is not a possibility? |
| |||
| On 8 Des, 15:59, "Paul Lautman" <paul.laut...@btinternet.com> wrote: > Mikhail Kovalev wrote: > > Alas, there is no SQLite or general SQL group. > > Whilst there is no obvious SQLite usenet newsgroup, it is not true that > there is no general SQL usenet newsgroup, nor is is correct that there are > no SQLite groups. > > I put > sqlite forum > into google and was rewarded with a very active group at the top of the > list. > > I'm still intrigued as to why the (to me) obvious method of dropping and > re-creating the database is not a possibility? SQLite allows creating tables without a selected database (without user and password). I'm not the only user of the file (!), and I need to be able to clear the file completely without replacing it. I figured out I can use the SHOW function and then eval() queries through php. It just seems so natural to have a command like "DROP TABLE *;", but to my confussion it doesn't work. |
| |||
| On 8 Des, 15:59, "Paul Lautman" <paul.laut...@btinternet.com> wrote: > Mikhail Kovalev wrote: > > Alas, there is no SQLite or general SQL group. > > Whilst there is no obvious SQLite usenet newsgroup, it is not true that > there is no general SQL usenet newsgroup, nor is is correct that there are > no SQLite groups. > > I put > sqlite forum > into google and was rewarded with a very active group at the top of the > list. > > I'm still intrigued as to why the (to me) obvious method of dropping and > re-creating the database is not a possibility? I don't know what databases or tables there might be. |
| |||
| Mikhail Kovalev wrote: > On 8 Des, 15:59, "Paul Lautman" <paul.laut...@btinternet.com> wrote: >> Mikhail Kovalev wrote: >>> Alas, there is no SQLite or general SQL group. >> >> Whilst there is no obvious SQLite usenet newsgroup, it is not true >> that there is no general SQL usenet newsgroup, nor is is correct >> that there are no SQLite groups. >> >> I put >> sqlite forum >> into google and was rewarded with a very active group at the top of >> the list. >> >> I'm still intrigued as to why the (to me) obvious method of dropping >> and re-creating the database is not a possibility? > > SQLite allows creating tables without a selected database (without > user and password). I'm not the only user of the file (!), and I need > to be able to clear the file completely without replacing it. I > figured out I can use the SHOW function and then eval() queries > through php. It just seems so natural to have a command like "DROP > TABLE *;", but to my confussion it doesn't work. Seems to me that if you are going to empty the file completey then you might just as well dump it. However if the file really can hold tables even when it is totally empty, then you have just explained to yourself why it was of no use asking for this sort of help in a MySQL or even a general SQL newsgroup. |
| |||
| Paul Lautman wrote: > Mikhail Kovalev wrote: >> On 8 Des, 15:59, "Paul Lautman" <paul.laut...@btinternet.com> wrote: >>> Mikhail Kovalev wrote: >>>> Alas, there is no SQLite or general SQL group. >>> Whilst there is no obvious SQLite usenet newsgroup, it is not true >>> that there is no general SQL usenet newsgroup, nor is is correct >>> that there are no SQLite groups. >>> >>> I put >>> sqlite forum >>> into google and was rewarded with a very active group at the top of >>> the list. >>> >>> I'm still intrigued as to why the (to me) obvious method of dropping >>> and re-creating the database is not a possibility? >> SQLite allows creating tables without a selected database (without >> user and password). I'm not the only user of the file (!), and I need >> to be able to clear the file completely without replacing it. I >> figured out I can use the SHOW function and then eval() queries >> through php. It just seems so natural to have a command like "DROP >> TABLE *;", but to my confussion it doesn't work. > > Seems to me that if you are going to empty the file completey then you might > just as well dump it. > > However if the file really can hold tables even when it is totally empty, > then you have just explained to yourself why it was of no use asking for > this sort of help in a MySQL or even a general SQL newsgroup. > > > Paul, The problem is that SQLLite is quite a bit "looser" in what you can do with it. A lot more like Access than MySQL, for instance. There are many things in MySQL which have no equivalent in SQLLite. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
| |||
| On Sat, 8 Dec 2007 14:59:55 -0000, "Paul Lautman" <paul.lautman@btinternet.com> wrote: >Mikhail Kovalev wrote: >> Alas, there is no SQLite or general SQL group. > >Whilst there is no obvious SQLite usenet newsgroup, it is not true that >there is no general SQL usenet newsgroup, nor is is correct that there are >no SQLite groups. > >I put >sqlite forum >into google and was rewarded with a very active group at the top of the >list. You're confusing google groups with USENet groups. Perhaps he's smart enough to know that? -- gburnore at DataBasix dot Com --------------------------------------------------------------------------- How you look depends on where you go. --------------------------------------------------------------------------- Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³ | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³ Official .sig, Accept no substitutes. | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³ | ÝÛ 0 1 7 2 3 / Ý³Þ 3 7 4 9 3 0 Û³ Black Helicopter Repair Services, Ltd.| Official Proof of Purchase ================================================== ========================= |
| ||||
| Gary L. Burnore wrote: > On Sat, 8 Dec 2007 14:59:55 -0000, "Paul Lautman" > <paul.lautman@btinternet.com> wrote: > >> Mikhail Kovalev wrote: >>> Alas, there is no SQLite or general SQL group. >> >> Whilst there is no obvious SQLite usenet newsgroup, it is not true >> that there is no general SQL usenet newsgroup, nor is is correct >> that there are no SQLite groups. >> >> I put >> sqlite forum >> into google and was rewarded with a very active group at the top of >> the list. > > You're confusing google groups with USENet groups. Perhaps he's smart > enough to know that? No I'm not. I searched in Google and found web based forums on SQLite. There are more sorts of discussion groups than USENet and Google Groups! |