You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Stephen Dunton <st...@guidestartech.com> on 2009/02/01 19:22:46 UTC
Syntax Question
I'm losing my mind trying to figure out how to update one table from another in derby 10.3. Basically I want to do this:
Update t1
Set t1.col1 = t2.col2
>From t1, t2
Where t1.pk = t2.fk
I have tried every conceivable combination of aliasing / not aliasing, moving the from portion above set portion, you name it and keep getting an "Encountered "from"" syntax error.
Is this type of statement supported in 10.3?
I've seen stuff out there on the net and followed all of it but just can't get this type of update to work.
Any help would be greatly appreciated
Thanks,
Stephen Dunton
Software Developer
GuideStar Technologies Inc.
303.640.6253
StephenDunton@GuideStarTech.com
Re: Syntax Question
Posted by Raymond Kroeker <ra...@raykroeker.com>.
Hi Stephen,
I've attached a simple sql file that attempts to do as you are
suggestion. I've assumed some stuff about the table definitions. Let
me know if it helps. I tested on 10.4.2.0 but it should work for your
version.
-----------------------
Raymond Kroeker
On Sun, Feb 1, 2009 at 10:22, Stephen Dunton
<st...@guidestartech.com> wrote:
> I'm losing my mind trying to figure out how to update one table from another
> in derby 10.3. Basically I want to do this:
>
>
>
> Update t1
>
> Set t1.col1 = t2.col2
>
> From t1, t2
>
> Where t1.pk = t2.fk
>
>
>
> I have tried every conceivable combination of aliasing / not aliasing,
> moving the from portion above set portion, you name it and keep getting an
> "Encountered "from"" syntax error.
>
>
>
> Is this type of statement supported in 10.3?
>
>
>
> I've seen stuff out there on the net and followed all of it but just can't
> get this type of update to work.
>
>
>
> Any help would be greatly appreciated
>
>
>
> Thanks,
>
>
>
> Stephen Dunton
>
> Software Developer
>
> GuideStar Technologies Inc.
>
> 303.640.6253
>
> StephenDunton@GuideStarTech.com
>
>
--
---------------------------------------------------------
Raymond Kroeker