Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Dynamic PL/SQL, MERGE and a Dissapearing Plus Sign

Dynamic PL/SQL, MERGE and a Dissapearing Plus Sign

From: jr <jrolandumuc_at_yahoo.com>
Date: 2 Apr 2007 09:56:27 -0700
Message-ID: <1175532987.766547.271520@y80g2000hsf.googlegroups.com>


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 - 11:56:27 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US