Pl/sql procedure for match-merge operator

I have used the match-merge operator in OWB. I want to implement the same match-merge operation using a pl/sql procedure. Please help.

Yes sure. Lets say, we have a table tab1, which has the following structure and data:
First_name Last_name Address City
JACK ANDREWS XYZ NY
ANDREWS JACK NY
Now, i want to write a procedure which matches and merges the above two records, into a single record.The matching is done with the help of the first_name and last_name columns.

Similar Messages

  • Using the match/merge operator

    Hi guys,
    I have created a simple table with 4 columns:
    EMPLOYEES
    - employee_id
    - emp_firstname
    - emp_lastname
    - emp_telephone
    I have placed 5 entries in the table:
    11, jane, doe, 80980980
    12, william, gates,6876876868
    13, john, anderson, 545646546
    14, michelle, millo, 340580334
    15, john, anderson, 545646546
    Row 13 and 15 are duplicates, except for the employee_id. I'm trying to use the match-merge operator to check for matches on emp_firstname, emp_lastname and emp_telephone. I would like to merge the rows matching on firstname, lastname and telephone number, and would like to keep the lowest employee_id as PK.
    I have tried to use the match-merge operator with the following settings;
    Input connections:
    - employee_id
    - emp_firstname
    - emp_lastname
    - emp_telephone
    Merge output
    - employee_id
    - emp_firstname
    - emp_lastname
    - emp_telephone
    Xref output
    none
    Match bins:
    - emp_firstname
    - emp_lastname
    - emp_telephone
    Match rules:
    MA_0, all_match
    Merge rules:
    emp_firstname: all match
    emp_lastname: all match
    emp_telephone: all match
    When I debug the match merge operator I get " 4 in, 4 out", but I expected to have "5 in, 4 out". Am I using this match/merge operator the right way?
    thx for you help!
    michiel
    null

    Hi Robert,
    I tried on 3 database installations (all 10.2). there is no parameter DB_BLOCK_BUFFERS set. And i do not assume that there is a reasn for increasing the db_cache_size - means: why i did not get any error for that presumed case?
    btw: can you explain why i should increase db_cache_size?
    thanks,
    Andreas

  • Need to wite pl sql procedure for dynamic select statement

    Need pl sql procedure for a Dynamic select statement which will drop tables older than 45 days
    select 'Drop table'||' ' ||STG_TBL_NAME||'_DTL_STG;' from IG_SESSION_LOG where substr(DTTM_STAMP, 1, 9) < current_date - 45 and INTF_STATUS=0 order by DTTM_STAMP desc;

    I used this to subtract any data older than 2 years, adjustments can be made so that it fits for forty five days, you can see how I changed it from the originaln dd-mon-yyyy to a "monyy", this way it doesn't become confused with the Static data in the in Oracle, and call back to the previous year when unnecessary:
    TO_NUMBER(TO_CHAR(A.MV_DATE,'YYMM')) >= TO_NUMBER(TO_CHAR(SYSDATE - 365, 'YYMM'))

  • Using cron-job to call the PL/SQL procedure for every 5 min

    Hi All,
    i wrote one procedure. using cron-job to call this PL/SQL procedure for every 5 min. i don't have any idea about cron job & what is thescript file formate .where can i place that script file. what are the details we placed in that script

    Really appreciate you. I like this approach .
    please give me advice for the below thing
    job_action =>an i give my procedure name under this?
    BEGIN
    -- Job defined entirely by the CREATE JOB procedure.
    DBMS_SCHEDULER.create_job (
    job_name => 'Job_schedule_update',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN Schedule_update; END;',
    start_date => SYSTIMESTAMP,
    repeat_interval => 'FREQ=HOURLY;BYMINUTE=5',
    end_date => NULL,
    enabled => TRUE,
    comments => 'Job defined entirely by the CREATE JOB procedure.');
    END;

  • SQL Procedures for dimension maintenance?

    I can't seem to find any stored procedures for refreshing dimensions & measures in 10.2. Looking at version 10.1 of the OLAP reference lists procedures such as:
    execute dbms_awm.refresh_awdimension ('MYSCHEMA', 'MYAW', 'AW_PROD');Is there an equivalent in 10.2.0.3? The OLAP reference docs have changed quite significantly from 10.1 to 10.2, so I'd assume so too has the database and the methods it uses to refresh structure. Docs for 10.2 don't appear to mention refreshing structure anywhere.
    Can anyone point me in the right direction? We're essentially looking for the same functionality as is provided in AWM's Maintain Dimension/Measure wizards, only called from our own application.
    Thanks,
    Aaron

    Hi,
    Have you tried having AWM creating a maintenance script for you?
    In the end of the maintenance wizard theres an option for selecting "create to script" or something similar.
    This will generate an anonymous PL/SQL block you can put into whatever procedure or application you want as long as it can run PL/SQL.
    Ragnar

  • Optimizing Pl/SQL procedure for fast execution

    Hi All,
    What are the tips that we must take care while writing pl/sql procedure or function, that it execute smoothly without any strains or resources.
    And if any of the procedure or function is not running fast enough is there any DBMS package or something like EXPLAIN PLAN to see the execution path used by optimizer or to analyze the code in that procedure or function to establish what causing the problem ?
    Any help will be highly appriciated.
    Thanking you and best regards.

    And if any of the procedure or function is not running fast enough is there any DBMS package or something like EXPLAIN PLAN to see the execution path used by optimizer or to analyze the code in that procedure or function to establish what causing the problem ?
    Yes it is. :)
    Read this:
    http://download-uk.oracle.com/docs/cd/B14117_01/server.101/b10752/toc.htm
    Peter D.

  • Can any one please send me an update trigger (pl/sql procedure) for ap tables(ap_suppliers,ap_supplier_site_all,and contacts)

    Please send an query for update trigger for those tables .
         1: ap_suppliers
         2: ap_supplier_sites_all
         3: ap_supplier_contacts.
    Thanks,
    Chaitanya.

    Hi,
    Actually ID and Data are different names in my API. Here I mentioned like that.
    Am using Oracle 10g version.
    Yes I am going to get the multiple values using this Ref Cursor. The same ref cursor is used in another API of my package.
    In this API, the user actually enters Application_id and data. API should insert/update the version_master table with the inputs. See application_id is the foriegn key for app_master table.
    The requirement is whenever they enters application_id and data, if application_id already present in the version_master table, then the data should be updated and we should get a status flag for this using Out variable(i.e. using ref cursor only we are showing the status). if the application_id is not present in the version_master table, new record should be inserted. The sequence will generate the version_id for version_master table.
    But the Merge statement is working fine for update and insert also. Problem is am unable to see the success or failure through ref cursor. I don't know how exactly I can use this.
    If data is NULL the operation should be failed. i.e. I should get Failure status here. But am not getting this.
    Please remove the comments here and then check. If I use the NVL2 function I was able to get the status flag, i.e. S or F.
    OPEN resultset_o FOR
    SELECT NVL2 (data, 'S', 'F')
    FROM version_master
    WHERE application_id = application_id_i;
    1.How the value of data being not null will determine Success of the api and how null failure
    2.If the above select statement goes in to exception when others how I will no the failure
    I have to achieve the above scenarios.
    Please advice me.

  • PL/SQL procedure for database activity monitoring

    Can anyone help me in writing a procedure which will help me in monitoring the database, i.e. if anybody changes something inside a table say add, update or delete then this procedure will tell me about every operation on that table??

    This has nothing to do with forms whatsoever, and also is already invented. Search the documentation for "audit" or take a look at this: http://www.oracle-base.com/articles/10g/auditing-10gr2.php
    cheers

  • PL/SQL procedure for deleting rows

    We have to delete rows from a table by initiating parallel processes depending on no of connections, and also variable commit frequency. The procedure has to start by itself in case of failure of 1 or more parallel processes, by identifying the position where it stopped. Please some one help me what would be th elogic needed to write the [rocedure.
    Thanks in Advance
    Edited by: 864979 on Jun 9, 2011 10:02 PM

    Be careful of how this is designed and coded. It is very easy to do it horribly wrong, causing contention and problems.
    Have a look at DBMS_PARALLE_EXECUTE.
    If the package is not available on your Oracle version, then look at {message:id=1534900} for a manual approach.

  • Need PL/SQL procedure for file transfer local system to server location

    Hi Experts,
    The requirement is one file ex: text file,excel file is there in Local system suppose c:newfolder/test.txt.
    once run the concurrent program for this particular file in the local system should transfer into server location for the mentioned path.
    is it possible to do in PL/SQL or shell script.
    can you please share the code.
    Thanks
    Meher

    Meher Irk wrote:
    The requirement is one file ex: text file,excel file is there in Local system suppose c:newfolder/test.txt.
    once run the concurrent program for this particular file in the local system should transfer into server location for the mentioned path.Why do you want to copy a local file from the local client file system, via the Oracle database server, to a remote directory on the server?
    Why is the Oracle database server to be used? For what purpose?
    There are standard secure methods for a client to copy a file to a server. Such as sftp and scp. No complex Oracle database server layer needed in-between.
    So why do you want to use the Oracle database to act as the copy mechanism for you?
    It will only make sense if the local file is copied into the database (as a LOB or securefile) and managed by the database. I fail to see why Oracle should be acting as the go-between for the client file system copy process to the server file system. This introduces another moving part in the copy process. Adds more security issues. Adds more authentication issues. And what for?

  • Stored Procedures for Simple SQL statements

    Hi Guys,
    We are using Oracle 10g database and Web logic for frontend.
    The Product is previously developed in DotNet and SQL Server and now its going to develop into Java (Web Logic) and Oracle 10g database.
    Since the project is developed in SQL Server, there are lot many procedures written for simple sql queries. Now I would like to gather your suggestions / pointers on using procedures for simple select statements or Inserts from Java.
    I have gathered some list for using PL/SQL procedure for simple select queries like
    Cons
    If we use procedures for select statements there are lot many Ref Cursors opened for Simple select statements (Open cursors at huge rate)
    Simple select statements are much faster than executing them from Procedure
    Pros
    Code changes for modifying select query in PL/SQL much easier than in Java
    Your help in this regard is more valuable. Please post your points / thoughts here.
    Thanks & Regards
    Srinivas
    Edited by: Srinivas_Reddy on Dec 1, 2009 4:52 PM

    Srinivas_Reddy wrote:
    Cons
    If we use procedures for select statements there are lot many Ref Cursors opened for Simple select statements (Open cursors at huge rate)No entirely correct. All SQLs that hit the SQL engine are stored as cursors.
    On the client side, you have an interface that deals with this SQL cursor. It can be a Java class, a Delphi dataset, or a PL/SQL refcursor.
    Yes, cursors are created/opened at a huge rate by the SQL engine. But is is capable of doing that. What you need to do to facilitate that is send it SQLs that uses bind variables. This enables the SQL engine to simply re-use the existing cursor for that SQL.
    Simple select statements are much faster than executing them from ProcedureAlso not really correct. SQL performance is SQL performance. It has nothing to do with how you create the SQL on the client side and what client interface you use. The SQL engine does not care whether you use a PL/SQL ref cursor or a Java class as your client interface. That does not change the SQL engine's performance.
    Yes, this can change the performance on the client side. But that is entirely in the hands of the developer and how the developer selected to use the available client interfaces to interface with the SQL cursor in the SQL engine.
    Pros
    Code changes for modifying select query in PL/SQL much easier than in JavaThis is not a pro merely for ref cursors, but using PL/SQL as the abstraction layer for the data model implemented, and having it provide a "business function" interface to clients, instead of having the clients dealing with the complexities of the data model and SQL.
    I would seriously consider ref cursors in your environment. With PL/SQL servicing as the interface, there is a single place to tune SQL, and a single place to update SQL. It allows one to make data model changes without changing or even recompiling the client. It allows one to add new business logical and processing rules, again without having to touch the client.

  • Make EXE for Pl/sql procedure

    Hi all,
    I have one Pl/sql procedure for which i want make EXE.
    can we make EXE files for PL/sql procedures using ' Oracle Developer Tools for Visual Studio .NET'
    Thank you.

    Hi Al,
    Can you tell me in steps how to create EXE for pl/sql procedure using C# console application.
    I have one webservice link which i want to invoke and i have to put the webservice output in a saparate file.
    I wrote Pl/sql procedure which invokes/consumes the webservice using UTL_HTTP and also placed the output of Webservice in a saparate file using UTL_FILE.
    But i have to execute this procedure on a Workstation where there is No Oracle installed.
    as you suggested using C# console application. Will this Procedure with UTL_FILE & UTL_HTTP packages run in that c# console application.
    Thank you

  • Need PL SQL Procedure

    Hello All,
    I like to write a PL SQL Procedure for the below sql statements. I like to pass all values from first sql stmnt to update columns in second sql stmnt based on dund_cc that is selecting from first sql stmnt. Please help me out how can I put together in pl sql procedure.
    SELECT Y.DUND_CC, Y.DPPROP, Y.APPNMENT, Y.ALLOTMENT, Y.ALLOCATION, Y.BDGCT FROM ABCDX_TBL Y;
    UPDATE POSDGET b SET B.DPPROP = Y.DPPROP, b.APPNMENT = Y.APPNMENT, b.ALLOTMENT = Y.ALLOTMENT,
    b.Y.ALLOCATION = Y.ALLOCATION WHERE b.DUND_CC = Y.DUND_CC;
    Thanks in Advance!!!

    Hi,
    You don't need a stored procedure or PL/SQL to do that. You can use a single UPDATE or MERGE statement, like this:
    MERGE INTO       posdget     dst
    USING   (
               SELECT  dund_cc
            ,        dpprop
            ,        appnment
            ,        allotment
            ,        allocation
            ,        bdgct
            FROM        abcdx_tbl
            )               src
    ON     (src.dund_cc     - dst.dund_cc)
    WHEN MATCHED THEN UPDATE
    SET     dst.dpprop     = src.dpprop
    ,     dst.appnment     = src.appnment
    ,     dst.allotment     = src.allotment
    ,     dst.allocation     = src.allocation
    ;The statement above will also work in PL/SQL, if you have a reason for doing it that way.

  • Match / merge deployment

    Hello
    I am learning owb and got stuck with this one problem.
    i have successfully validated and generated map with match / merge. however i am having problems deploying it - everytime i try - i get the following errors:
    ANOTHERONE_MM
    Create
    Warning
    ORA-06550: line 1370, column 6:
    PL/SQL: Statement ignored
    ANOTHERONE_MM
    Create
    Warning
    ORA-06550: line 1372, column 26:
    PLS-00222: no function with name 'VIX_TEST_TIME1_4_SURNAME$1' exists in this scope
    Having looked into the repository where the package is generated i have found out that the function reported in the error is actually a variable. It is being declared in package body and no references to it exists in package speck.
    it is not an external variable - it is created by OWB. Debugging is going well until this varialbe is being applied like a function ?!
    I would really appreciate if someone could advise me where i am going or what i am doing wrong here.
    Thank you very much for all your help
    Kind Regards

    Hi,
    I have the same problem when deploying the mapping with Match-merge operator. did you find out a solution? Appreciate your help.
    Thanks,
    Saravana Kumar

  • Use of Sequence in Match-Merge

    Dear All,
    I have a source table containing name and address data. I want to do householding, which means I need to split the data using a match-merge operator. The address data is the merged output, and the name data is the cross-reference output. All well and good so far.
    I want eventually to load the outputs into two levels of a Customer dimension (although for testing right now, I'm just using two ordinary target tables). I know that I will need a 'business key' to link the merged and the cross-reference outputs (as the two dimensional levels). I decide that I shall create a column in both outputs called HH_SEQ, and load this Household Sequence number from a Sequence (which I prepared earlier).
    In Merge Rules, for the Attribute HH_SEQ, I use a Rule Type of Sequence, and select the appropriate Sequence from the drop-down list box. I map this attribute in the MERGE outgroup to the appropriate column in the target merged table, and MM_HH_SEQ in the XREF outgroup to the appropriate column in the target cross-reference table.
    Here is the issue: to get HH_SEQ to be available as a potential Output Attribute in either Merge Output or Cross-Reference Output, it must first be present as a Source Attribute. Which means I had to add it to Input Attributes first. But of course it is not on my input source table! And thus I get a "VLD-1000 Input parameter INGRP1.HH_SEQ does not have input" warning.
    Either I'm just not understanding how to use the Sequence rule type properly (the documentation is pretty atrocious, mind), or there is some technique required here that is just not apparent from several days of experimentation.
    All help gratefully received!
    Regards,
    Donna
    p.s. it does actually compile and run just fine!

    Hi Donna
    I think you are using it in the correct way! I've seen other examples like this from the MM creators.
    The warning can be ignored, I think it is there to highlight a potential issue if it was being used for a scenario other than what you are doing.
    Cheers
    David

Maybe you are looking for

  • My iPhone 5 does not connect to my Macbook via Bluetooth (this is so frustrating!!)

    Ok so i bought my iPhone 5 a couple days ago. So i installed and applications from app store ( on my mac ) which enables me to control my iphone through my mac (via bluetooth). It's very cool when my iphone is docked so i don't need to reach to it ev

  • Networked OJ 8500 that is extremely slow in job queuing.

    We recently installed an OJ 8500 and the job queuing is extremely slow.  The printer is networked (wired) and all users have the same problem.  We run a combination of XP, Vista and Windows7.  We have no problem getting the printer to print.  Its jus

  • My 4G touch appears in 'computer' but not in itunes, what should I do?

    Hi, I've tried all of the suggested fixes from the apple support page but none of them seem to work. I can't sync my ipod with iTunes and it's beginning to get really frustrating I'm running Windows 7 64-bit and have tried numerous system restores (b

  • Macbook Pro startup

    Hi, quite new to this but since upgradeing my Macbook pro from 10.7.4 to 10.7.5, the startup process is now showing a apple logo prior to going to the desktop. When I turn it on I see the normal, bright Apple screen with logo and spinning ring, this

  • Am gonna be a MAC soon, so what are the essential programs to have??

    Hi guys, I am suppose to be a MAC soon, want to get the new Macbook Pro 13" i've been using windows since i started using computers which is long enough to have it running in my blood!! but now i want to move to Mac, FINALLY what do you think are the