Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Dynamic PL/SQL, MERGE and a Dissapearing Plus Sign
Hello. I'm trying to help a coworker insert a plus sign in front of a
given block of code within a MERGE statement. Below is an excerpt.
Using PL/SQL: Her code will automatically return a minus sign in front
of a given block of values, which is what she wants for some cases,
but it won't automatically return a plus sign in front of a given
block of values. Using straight SQL: the code returns exactly what
she wants.
Her job requirement, unfortunately, is to use a dynamic statement within PL/SQL.
Can anyone please tell me how to get the plus sign to be returned in front of a given block of code, without having to remove the merge and replace it with cursors and loops (which was tried originally on a smaller block of code and which worked exactly as expected). The MERGE statement--and its idiosyncrasies--are new to me and I have no clue why the plus sign simply cannot be concatenated onto the front of a given block of values.
Thanks.
JR
dynamicStmt := 'MERGE INTO myTable t USING (SELECT c.a,c.b,c.c,c.d, ' || '(case when c.e > 0 then ''+''||c.e '... Received on Mon Apr 02 2007 - 10:44:50 CDT