There is an update of sqlite addon that
includes the 3.3.17 version and clarification
in the menu that Connect opens the database
and New/Open/Save are for the session SQL (last tab).

  See http://www.jsoftware.com/jwiki/Addons/data/sqlite

However, the difference from the earlier version
should not have affected compatibility.

For .dump, it is really a utility that probably
best to be used from the command-line version.
It is really simple as seen in its source and
if done as an excersise, could be included in
the browser GUI; which in and of itself is just
a showcase and convenient visual browser for the API.

Optional insert works like this:

  insert into WORDS (WID,WVAL) 
    select distinct 7,'eleven'
    from WORDS where not exists (
      select * from WORDS where WID=7);



--- Bill Harris <[EMAIL PROTECTED]> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Oleg Kobchenko <[EMAIL PROTECTED]> writes:
> 
> > SQLite Addon for J
> 
> Cool!  Thanks, Oleg (I'm finally getting around to trying it, because
> I was recently in need of a DBMS).  
> 
> Just a couple of questions:
> 
>   It would be nice to have the ability of a sqlite3 .dump command.  I
>   tried downloading and running sqlite-3_3_17.zip, but it can't open the
>   database.  Is that likely because the addon is based on 3.3.7?  Are
>   there any plans either to update the addon sqlite.dll soon?  I presume
>   it's not as simple as just grabbing a file off the SQLite site --
>   there are, no doubt, changes in the addon, too, right?
> 
>   Are there any plans to implement some of the sqlite3 functionality in
>   the browser?  Is there a way to do that already?  I do see the Save As
>   command has the tantalizing .ddl and .sql suffix selections, but I
>   always end up with empty files when I try that.
> 
> In just scattered times over the last day, I've gotten quite a bit of
> use out of J scripts to select data.  My next step is to write a command
> (J+SQL or pure SQL) to add data to related tables.  For example,
> 
> create table A (
>        AID   integer primary key autoincrement,
>        ANAME varchar(45) not null);
> 
> create table B (
>        BID   integer primary key autoincrement,
>        BNAME varchar(45) not null,
>        AID   integer,
>        foreign key (AID) references A (AID) );
> 
> It's easy to insert into either table alone.  What I want to do is to
> insert a new ANAME - BNAME pair, roughly corresponding to 
> 
>        select AID from A where ANAME = 'MyAValue'
>        
>        if that returns nothing, then
>           insert into A (ANAME) values ('MyAValue')
>           insert into B (BNAME, AID) values ('MyNewBName', the AID from
>             the previous insert
>        else
>           insert into B (BNAME, AID) values ('MyNewBName' the AID from
>             the first select
> 
> I've found a number of SQL tutorials online, but I haven't seen this
> example worked out.  Any pointers to places that address this?



       
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the 
tools to get online.
http://smallbusiness.yahoo.com/webhosting 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to