you could do this... but only you can tell if it will give the result you
want ..
UPDATE portlet A
SET A.description = ( SELECT B.param_char_val
FROM param_exception B
WHERE A.portlet_code = B.portlet_code
and B.param_name = 'portlet_title'
and B.param_char_val is not null and rownum = 1)
WHERE EXISTS ( SELECT B.param_char_val
FROM param_exception B
WHERE A.portlet_code = B.portlet_code
and B.param_name = 'portlet_title'
and B.param_char_val is not null
);
added "and rownum = 1"
On Tue, Dec 9, 2008 at 6:19 AM, ddf <[EMAIL PROTECTED]> wrote:
>
>
>
> On Dec 8, 10:04 pm, Vlad <[EMAIL PROTECTED]> wrote:
> > I'm trying to update portlet.description with the value of
> > param_exception.param_char_val where there is a match on portlet code.
> >
> > I only want this to occur when
> > param_exception.param_name='portlet_title' and param_char_val is not
> > null.
> >
> > I'm banging my head against the following - I keep getting a single-
> > row subquery error.
> >
> > Any ideas?
> >
> > TIA
> >
> > UPDATE portlet A
> > SET A.description = ( SELECT B.param_char_val
> > FROM param_exception B
> > WHERE A.portlet_code = B.portlet_code
> > and B.param_name = 'portlet_title'
> > and B.param_char_val is not null)
> > WHERE EXISTS ( SELECT B.param_char_val
> > FROM param_exception B
> > WHERE A.portlet_code = B.portlet_code
> > and B.param_name = 'portlet_title'
> > and B.param_char_val is not null
> > )
>
> That's because this:
>
> ( SELECT B.param_char_val
> FROM param_exception B
> WHERE A.portlet_code = B.portlet_code
> and B.param_name = 'portlet_title'
> and B.param_char_val is not null)
>
> returns more than one row for each portlet_code. Have you run this
> query by itself to see what it returns? You should do so as you
> cannot decide how to fix this if you don't know the result set you're
> generating.
>
>
> David Fitzjarrell
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---