Merge Statement to merge variables with table

Rating8.8Very Good

I know typically that when using a Merge statement, one is merging the values of one table into another.  In my case, i have the current values I want to determine if I need to insert or update but they are in variables, and not a table.  How do I use the Merge statement when right after my USING I would like to put my variables rather than a SELECT statement?

  1. MERGE statement from 2 tables into single table …
    I have 2 MERGE statements as per code below. The source tables are TMP_SKU_FCST_APRL and TMP_SKU_FCST_FWEQ. The 2 source tables have a rcrd_chng_id as primary key (a surrogate key). RCRD_CHNG_ID is defined as CAST (ROWNUM AS NUMBER(10)) for both tables. The target table prod_store also has rcrd_…
  2. Merge Statement giving me ORA-00001 (h…
    Merge statement is giving me ORA-00001: unique constraint (SERVMAN.CONTCTSM15611F81D) violated even when there is no rows in the table. I am very confused on what is going on. I searched the forums. Can someone either tell me how to fix this or tell me how they would write it as a procedure. I have been struggling with this for a …
  3. Temporary tables usage in select statement
    Hi, I have created a global temporary table. In the stored proc, I have defined a cursor on the temp table. After that i am inserting data into the temp table. Then i am opening the cursor, fetching values from the cursor. Then i am using the fetched data from cursor in teh where clause of a select statement of a normal table. But i am getting error …
  4. Update statement
    I'm having general issues converting select statements into update statement in Oracle PL/SQL. With T-SQL it is far easier, but rearranging for PL/SQL I'm finding harder. Hopefully with the correct answer I can work out the general rules for converting. This is my current select statement which returns me the correct number of records I am ex…
  5. When and/or who is executing alter table state…
    Is there a view or a way to identify when and/or who is executing an alter table statement to shrink space check on a given table?


Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.

About this Solution
View This Solution - Start Your 30 Day Free Trial
merge variables
Participating Experts
Solution Grade


by: vik_neo

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.


All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

Stay Connected

Oracle Around the Web

The latest Oracle news, tips, and tricks

Oracle Unveils Netra SPARC T3 Servers

New Carrier-Grade Blade and Rackmount Servers Deliver Better Performance, Density and Power Efficiency for the Communications Industry ...

read more

Oracle fixes 21 flaws in Java SE, Java for Business

Oracle is fixing 21 flaws in its Java SE and Java for Business products in its February critical patch update issued this week ...

read more

Obama’s Silicon Valley “Tech Supper”

Why was he there? Who wasn’t invited and why? What did they talk about? Why was he really there? These are the questions being debated ...

read more

Featured Oracle Experts


slightwv has answered more than 2,000 Oracle questions and oversees database management within the U.S. Government. Slightwv


A regular presenter at the Collaborate conference, Oracle developer sdstuber is a top expert in PL/SQL and Oracle 9, 10 and 11. sdstuber


What users are saying about our experts

"The Oracle gurus provide answers, solutions and valuable workarounds"

User: schwertner

"Wow! Excellent, valuable explanation. Hats off to you"

User: aseshu70

"Solution worked fantastic and performs excellent! Thanks heaps"

User: klausbrandlhuber

Top Experts

  1. slightwv


    0 points yesterday


BrowseBecome an Expert