Thread: [Squirrel-sql-develop] Get table schema & RE: Auto DROP [object]...
A Java SQL client for any JDBC compliant database
Brought to you by:
colbell,
gerdwagner
From: Ruffin B. <Ruffin.Bailey@Blackbaud.com> - 2003-06-03 15:02:20
|
A "feature request/can I do this", and a fwd of a message that hasn't = come through just yet (sent May 20th; sorry if it "deluges" later). In Microsoft SQL Server's Query Manager, I can select one or many = database objects, hit ctrl-c, and have the schema for the table(s) = (text, natch) in my clipboard. AWFULLY handy. Worth pursuing in = SQuirreL? Second bit is my reply for the Auto DROP function -- basically just = looking to use on VIEWs, so should be relatively safe. Adding a pref = for tables too is a good idea. Email quoted below. Thanks! Ruffin Bailey Ruffin Bailey wrote on Tuesday, May 20, 2003 10:58 AM: > [Another possibility would be to look at the SQL prior to it being = executed > and if there is a CREATE TABLE command then execute a DROP command = first.] >=20 > The problem of course is that this would throw an error if > the table/view/whatever object *didn't* exist before the > statement the user created executed. Squ'l could silently > bitbucket the error thrown by the unnecessary drop statement, > I suppose, and though it's somewhat kludgey that's a valid route, I = think. >=20 > [There is an API > ISQLPanelAPI.addSQLExecutionListener(ISQLExecutionListener) > that allows you to look at SQL before it is executed and if necessary > modify it. > ... > In your case you'd probably want to look at the SQL _before_ its = split into > the three statements and then add a DROP TABLE to the start.] >=20 > That sounds like a good way of doing it, again if you could bitbucket = any > errors there.=20 >=20 > [Because I'm a very nervous person I would want this behaviour to be > configurable. I.E. have an application setting something like 'Auto = drop > tables before create true/false" with the default being false so that = the > user has to change it to true if they want this behaviour.] >=20 > That's a good idea -- I normally wish I had this feature when > I'm making reports and optimizing views and sprocs, in which > case an accidental drop isn't such a big deal. Guess the > best way to go is to set up different settings for each > object type. Might set up the plugin to drop views by > default, but you'd have to manually change settings for other types. = ?? >=20 > I like the way you started using single quotes for your > quote, above. Wonder where that came from? ;^) >=20 > Thanks for your help, >=20 > Ruffin Bailey |