Hi Stathis,
Thanks, that works very nicely. I've taken the liberty of sending this to
the developers list as I believe its more appropriate there.
If you want we can release the plugin without any real help file, it just
means that anybody who wants to use it will have to dig into the source code
and most people won't do that.
For everybody on the list who doesn't know what iSqlJ is its a way of mixing
Java and SQL. From the web site http://www.rege.org/isqlj/ :
"The iSqlJ is an interpreter which combines the strength points of both SQL
and Java. It uses the BeanShell for Java interpretation and JDBC for SQL
execution. Then, you can write programs which mix Java code and SQL
statements.
If you are writing SQL programs which consists from a lot of SQL statements,
then propably the iSqlJ is written for you. If additionally you want to
parameterize those programs, then definitely iSqlJ will fit your need. If
finally you want to add functionality of Java to your SQL statements, then
you are going to love it. "
From SQuirreLs point of view its a plugin that makes SQuirreL scriptable,
and it looks very, very powerful.
The problem is that theres very little documentation. Stathis has been too
busy getting it to work to write the documentation. Also English is not his
first language which makes documentation very difficult. And I think that
Stathis (like most of us) doesn't like doing documentation (from the web
site - " Help others to use the program by writing documentation for it. I
hate any other writing than coding, and that explains why this site is so
lazy. Please help me to improve it and make people to understand the
features of iSqlJ more easy.")
If somebody on this list has an interest in iSqlJ and would like to help out
please reply to this message, Stathis is subscribed to this list.
Stathis, I hope you don't mind me sending this message. I doing it out of
pure selfishness :-) I'd really like to see iSqlJ documented sufficiently
that I could sit down and start using it seriously.
Col
-----Original Message-----
From: Stathis.Rege [mailto:st...@re...]
Sent: Tuesday, 20 May 2003 21:24
To: Colin Bell; 'Denis Grannell'
Cc: squ...@li...
Subject: RE: [Squirrel-sql-users] Bug when displaying user defined data
types?
Hi Collin and Denis
I possibly have an immediate solution for this problem.
1. Try to install the sqsc-isqlj plugin located in www.rege.org/isqlj/.
2. Start a session. and write the following statement
jdbc.getDatabase().dropTable( "foo_%");
#sql[session]
{
create table foo_1
(
.......
);
create table foo_2
(
.......
);
}
3. Select all of the code and press Control J. Propably you will have the
feature you wanted.
This will happen because i allready implemented a small parser able to run
mixed Java and SQL. I made also a plugin for SquirrelSql client.
Inside this parser exists a Database class which has the dropTable method.
I know that i did not documented, i have no excuse. I will do my best when i
will have some time.
Best regards
Stathis Alexopoulos
-----Original Message-----
From: Ruffin Bailey [mailto:Ruf...@Bl...]
Sent: Wednesday, 21 May 2003 0:58
To: squ...@li...
Subject: [Squirrel-sql-develop] RE: Auto DROP [object] on CREATE [object
a already existing in db]
[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.]
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.
[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.]
That sounds like a good way of doing it, again if you could bitbucket any
errors there.
[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.]
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. ??
I like the way you started using single quotes for your quote, above.
Wonder where that came from? ;^)
Thanks for your help,
Ruffin Bailey
|