It will work fine, just remember to specify every column in the
table being updated (aka "REPLACEd INTO") or they will contain NULL.

It would be nice if SQLite featured an "INSERT OR MERGE" or "MERGE INTO"
command that would not require specifying all the columns. i.e., grab
the old row's values for the columns not specified to act more like
an update. For a 5 column table it's not a big deal, but when you wish
to REPLACE INTO a table with 50 columns, the SQL gets a bit unwieldy.

Happy credit derivativing.

--- "Anderson, James H (IT)" <[EMAIL PROTECTED]> wrote:
> Thanks, Joe! That looks like it might be the solution. 
> 
> -----Original Message-----
> From: Joe Wilson [mailto:[EMAIL PROTECTED] 
> Sent: Friday, February 02, 2007 9:58 PM
> To: sqlite-users@sqlite.org
> Subject: Re: [sqlite] Another sybase conversion question
> 
> --- "Anderson, James H (IT)" <[EMAIL PROTECTED]> wrote:
> > The following works fine in sybase, but because in sqlite "update"
> does
> > not support "from" it doesn't work. Is there another way of doing
> this?
> > 
> > Thanks,
> > 
> > Jim
> > 
> > update C1_credDerivEvent
> >    set CDEvent = a.CDEvent || ',' || b.CDEvent
> >   from C1_credDerivEvent     a,
> >        C1_tmp_credDerivEvent b,
> >        tmp_events            c
> >  where a.CDId         = b.CDId
> >    and b.CDApplicable = 'Yes'
> >    and b.CDEvent      = c.CDEvent;
> 
> http://www.sqlite.org/lang_replace.html


 
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to