Create the procedure to check existing data, then update, if not then insert.

Dear all,

Help, please
I create a procedure to check the current data are available or not tables, if not match, the row in the table will insert another table, if matched, data will be updated.
table source: Table_read;
check table: stor_matdata;
key to two table ID is (assy_no and t.produced_number).
Here's the code I create, but he still has an error...
---------------------------------------------------------------------

create or replace
procedure Matched
as
Start
Fusion in stor_matdata m using double on (m.assy_no = t.produced_number)
When not matched then insert into stor_matdata (sequence_id, assy_no, package, basic_type, materialnumber, factor, mattype)
Select rownum, t.producednumber, t.package_name, t.basic_type, t.consumed_number, t.factor, t.mattype FROM (select * from Table_read xxxx) t
when matched, then update package set = t.package_name, basic_type = t.basic_type, materialnumber = t.consumed_number, = t.factor, mattype = t.mattype, sequence_id = rownum factor;
end Matched;


Thank you and best regards,

Hadi

There is a support missing after values

        VALUES (
                t.r
               ,t.producednumber
               ,t.package_name
               ,t.basic_type
               ,t.consumed_number
               ,t.factor
               ,t.mattype
               );

Concerning
Marcus

Tags: Database

Similar Questions

  • Create the privilege granted procedure, but cannot create the procedure

    I have a user that I have given the following privileges:
    CREATE THE SESION
    SELECT ANY TABLE
    CREATE A PROCEDURE
    CREATE PROCEDURE
    RUN THE PROGRAM
    RUN THE PROCEDURE

    But when I try to create a procedure with this user I get, error proveleges not enough. What I am doing wrong?

    What's wrong? You open the doors of barn proverbial ito security. This isn't how security should be made - allowing a schema create any code of procedure anywhere in the database. Or select data from any table.

    How do you think that Sony's PS network has been hacked and millions of stolen credit card data users?

    By this precarious type of stuff-security approach to security.

    A schema has the minimum privileges in order to achieve its goals and its requirements. Nothing more.

    For example

    // standard logical database schema, 10Gb space allocation
    create user HRDB
      identified by 
      default tablespace USERS
      quota 10G on USERS;
    
    // configure the basic security layer for the schema
    grant
      create session, --// allow client-server connections to schema
      create table, create trigger, --// allow to create standard db objects
      create sequence, create view, --// allow access to defining extended objects
      create procedure --// allow creating stored proc code
    to HRDB;
    

    In addition, you can decide on assign a profile of resources and specific roles and so on. In some cases, you can also leave the schema create types, synonyms and private database links, views materialized, etc.

    Don't grant access. No access to the SYS code and objects. By default. Everything else is a security exception requiring a valid justification.

  • Hi, I created the procedure and its code is / / DELETE FROM <? = odiRef.getObjectName ("L", "TRG_SALES", "ORACLE_ORCL_LOCAL_SALES", "", "D")? > / / and when I'm running, the error appeared //com.sunopsis.tools.core.exception.SnpsSimpleMessageExcepti

    Hi, I created the procedure and its code is / / DELETE FROM <? = odiRef.getObjectName ("L", "TRG_SALES", "ORACLE_ORCL_LOCAL_SALES", "", "D")? > / / and when I'm running, the error appeared.

    com.sunopsis.tools.core.exception.SnpsSimpleMessageException: ODI-17517: error in the interpretation of the task.

    Task: 1

    java.lang.Exception: the application script threw an exception: com.sunopsis.tools.core.exception.SnpsSimpleMessageException: Exception getObjectName ("L", "TRG_SALES", "ORACLE_ORCL_LOCAL_SALES", "DEVELOPMENT", "D"): SnpLSchema.getLSchemaByName (): SnpLschema is no information OSB: Delete_Tar_Sales on line: column 0: columnNo

    at com.sunopsis.dwg.codeinterpretor.SnpCodeInterpretor.transform(SnpCodeInterpretor.java:489)

    at com.sunopsis.dwg.dbobj.SnpSessStep.createTaskLogs(SnpSessStep.java:737)

    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:465)

    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2128)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ 2.doAction(StartSessRequestProcessor.java:366)

    at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)

    at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$ 0 (StartSessRequestProcessor.java:292)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ StartSessTask.doExecute (StartSessRequestProcessor.java:855)

    at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)

    to oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$ 2.run(DefaultAgentTaskExecutor.java:82)

    at java.lang.Thread.run(Thread.java:662)

    Caused by: java.lang.Exception: the application script threw an exception: com.sunopsis.tools.core.exception.SnpsSimpleMessageException: Exception getObjectName ("L", "TRG_SALES", "ORACLE_ORCL_LOCAL_SALES", "DEVELOPMENT", "D"): SnpLSchema.getLSchemaByName (): SnpLschema is no information OSB: Delete_Tar_Sales on line: column 0: columnNo

    at com.sunopsis.dwg.codeinterpretor.SnpCodeInterpretor.transform(SnpCodeInterpretor.java:476)

    ... 11 more

    Caused by: org.apache.bsf.BSFException: the application script threw an exception: com.sunopsis.tools.core.exception.SnpsSimpleMessageException: Exception getObjectName ("L", "TRG_SALES", "ORACLE_ORCL_LOCAL_SALES", "DEVELOPMENT", "D"): SnpLSchema.getLSchemaByName (): SnpLschema is no information OSB: Delete_Tar_Sales on line: column 0: columnNo

    at bsh.util.BeanShellBSFEngine.eval (unknown Source)

    at bsh.util.BeanShellBSFEngine.exec (unknown Source)

    at com.sunopsis.dwg.codeinterpretor.SnpCodeInterpretor.transform(SnpCodeInterpretor.java:471)

    ... 11 more

    Text: REMOVE OF <? = odiRef.getObjectName ("L", "TRG_SALES", "ORACLE_ORCL_LOCAL_SALES", "", "D")? >.

    at com.sunopsis.dwg.dbobj.SnpSessStep.createTaskLogs(SnpSessStep.java:764)

    at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:465)

    at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2128)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ 2.doAction(StartSessRequestProcessor.java:366)

    at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)

    at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$ 0 (StartSessRequestProcessor.java:292)

    to oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$ StartSessTask.doExecute (StartSessRequestProcessor.java:855)

    at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)

    to oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$ 2.run(DefaultAgentTaskExecutor.java:82)

    at java.lang.Thread.run(Thread.java:662)

    If you do this in a procedure, use the following syntax:

    <%=odiRef.getObjectName("L", "TRG_SALES", "D")%>

    and set the relevant logical schema in the options on the target tab of the procedure. Also, make sure you only select the correct technology type in the options on the target tab.

  • The backup disk image ' / Volumes/Data/iMac.sparsebundle ' could not be found (error (null))

    Hello

    I have a 27-inch iMac late 2013, 3.2 Ghz intel Core i5, 8 GB 1600 Mhz DDR3. I get the tracking error when you try to save it on my time capsule.

    The backup disk image ' / Volumes/Data/iMac.sparsebundle ' could not be found (error (null))

    I have another iMac and Mac Pro that save in the capsule of time without any problem.

    Can anyone help?

    Thank you

    You try Time Capsule stop and unplug for 1 minute. Then reset the SMC on the iMac by Intel iMac LANDAU and SMC will reset and restart the iMac and restart the TC and retest Time Machine.

  • When I reboot after installation of service pack 2, the message comes out and says that updates are not configured correctly, returning from changes

    When I reboot after installation of service pack 2 on a computer laptop with Windows Vista Home Premium 32-bit Dell XPS M1530, the message comes out and says that updates are not configured correctly, returning from changes. Do not turn off your computer. I installed update readiness tool, but it does still every time. I tried to disable the antivirus software prior to installation.

    Hello
     
     
     
    1. how you try to install Service Pack 2?
    2. are you able to boot to the desktop?
     
     
    Method:
    Step 1: If you are able to start the computer in normal mode, then try a clean boot.

    To help resolve the error and other messages, you can start Windows Vista or Windows 7 by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135
    Please note: after troubleshooting, start the computer in normal mode.

     
    Step 2: Try to install Service Pack 2 manually.
     
    How to obtain the latest Windows Vista service pack

     
     
    If you are unable to start the computer, then you can follow this link to start the computer in safe mode.
    Start your computer in safe mode
    http://Windows.Microsoft.com/en-us/Windows-Vista/start-your-computer-in-safe-mode
     
     
     
     
    If you are unable to install Service pack 2, you can consult this article.
    Error: Failed to setup of the Windows updates. Restoration of the changes. Do not turn off your computer when you try to install Windows updates
    http://support.Microsoft.com/kb/949358
    Please note: method 2 refers about upgrade on site.  Perform a repair installation/place will not damage files and applications that are currently installed on your computer.   However, I suggest you to back up all important data on the computer before you perform the upgrade on the spot.
     
     
     
     
     
     
     
  • Creating the file must already exist

    The problem that I am struggling with, is that when you create an Excel file, the user is prompted for the file name. They can search for the file by clicking the folder icon, but once they arrive at the directory they want, if they type in a file that does not exist, LabVIEW says that the file is not found. So the user has to click on a file that already exists, and then change just the end of the file name for what they want, it's more work, I want the user to do. Any suggestions?

    Thank you

    GJ

    Check in options for any function you use pop open the file dialog box.  I bet that you have defined for existing files when it should be defined for new or existing files.

    If it is a file IO path control, right click on the Browse button and choose Properties.

  • steps to create the new table using existing metadata

    Hi all


    That's what I want to achieve,

    I want to create a procedure that will take an input parameter as a table name lets say 'EMP ',.
    This procedure checks if this table exists or not?
    If they don't exist
    It will create a new table with the name _dummy join the existing table name (ex: new table will be EMP_DUMMY).
    and new table should have the same structure of the table, indexes, and constraints on the EMP table.


    NB: It should not be created using select as create table EMP_DUMMY select * from EMP where = condition false;



    Can someone help me please how to achieve this?

    Please, don't post duplicate discussions.

    Check your thread previous stored procedure to create a new table with the existing table structure to further discussions

  • Create the user with privileges only data entry.

    Hello guys,.

    A very basic question. I created the request of APEX, well obviously the user with whom I created this application has developer access, now I want to create a user who is able to see the developed application, I tried to find the user options, but could not.  Someone can help me to find the option, I need to follow, so that the newly created user is only able to enter data into forms and run reports and should not be able to make changes in the application developed.

    Concerning

    Faisal Niazi says:

    A very basic question. I created the request of APEX, well obviously the user with whom I created this application has developer access, now I want to create a user who is able to see the developed application, I tried to find the user options, but could not.  Someone can help me to find the option, I need to follow, so that the newly created user is only able to enter data into forms and run reports and should not be able to make changes in the application developed.

    Create 'end users' by selecting No for the user is an administrator of the workspace and the user is a developer account privilege options create new user accounts. These users connect to the APEX Application Builder. It can be given direct access to a request by specifying the ID of the application or alias to the URL:

    apex.oracle.com/pls/apex/f?p=

    or

    apex.oracle.com/pls/apex/f?p=

    Using an alias for the application is recommended.

    To restrict user access to pages, components and specific applications, create authorisation schemes and the apply to the application level.

  • Create the procedure using time as a variable

    Dear team,

    Please find below the details.

    Database version:-11g Release 2

    I want to create a procedure to help if another condition. Can someone help me how declare TIME as variable. just for example

    If the time < 6 pm.

    Start-> run, loop

    Another thing,

    end of the program.

    My doubt is how to initialize with time as a variable

    Dear Sybrand,

    k do not write the code for free... And I don't do any kind of work. I'm a businessman. Just for Oracle knowledge point of view, I asked the question. And the next time suggest me.

    Kind regards

    Vivek

    Director-general

  • How can I uninstall Adobe PSE9?  All I get is an error message "Error 1316.  The specified account already exists. "  Then the Unistaller cancels and the program just sits there, partially uninstalled and unusable.

    I have upgraded to PSE13 and want to unistall PSE9.  When I try to do it all I get is an error message "Error 1316.  The specified account already exists. "  Uninstaller restores then I'm left with a partially uninstalled version is unusable.  I tried to reinstall the software from the original disc of PSE9 but everything he tries to do is to uninstall the version already on my computer and then did it, the same thing as above. How to completely uninstall PSE9?

    See here:

    How can I remove older versions of Photoshop?

  • Cannot create the p12 certificate with existing certificate of distribution

    Hello

    I published apps before using my employers apple developer account that is simple enough forward if you follow the instructions. Asked me to create an application for distribution with the apple store using the developer account. I need to create the final application .zip and pass it to the customer who shall submit the actual application is.

    My problem is that I can't create a p12 certificate to attach to the DPS App Builder app. The customer has three certificates of distribution in their account, but had third party create them on their behalf. To my knowledge, the best way to handle this would be to revoke old certificates three distribution in their apple developer account and create a new linked to my machine that would allow me to create all the necessary certificates. It seems that 3 certificates of distribution is the limit they may have at any given time.

    My questions are:

    1. is my solution, right?

    2. If so, revoke a certificate of distribution would cause problems for one of their other applications that are published or in progress?

    The only other option that I could see was the creator of one of the certificates in distribution create a p12 certificate that I relate to the DPS App Builder app.

    Any help, advice or pointing me in the right direction would be greatly appreciated. I've never had a problem of edition following the directions, so it is a new issue for me.

    Kind regards

    C

    If you have access to your Apple dev account, you can create certificates on your machine, but if they have existing certificates in their account, could cause confusion and don't want to mess with their existing certificates.

    You advise to ask your client to create and pass the CERT, create the app with their certificates and pass back the zip for them to download

  • HEEELP: Re-create the procedure for the Essbase.sec file in 11.1.2.0

    Hello
    What is the procedure for recreating the file Essbase.sec in 11.1.2.0 Essbase environment... In older versions, it has been used to remove Essbase.sec, start the Essbase server and it has been recreated a file void essbase.sec... But in 11.1.2.0 with Shared services... is the procedure? If it is deleted from the file essbase.sec... start Essbase Service recreates and will update SSP Outlook2003?


    Please someone help...

    Thank you...

    Hi Alex,

    Unfortunately, I have about 20 questions to ask in order to really be able to provide useful guidance, but at least I recommend checking out 'The Essbase security file management' section of the Essbase DBAG and eventually the Oracle Hyperion Enterprise Performance Management System Backup and Recovery Guide.

    11.1.2.1 SER60-online http://docs.oracle.com/cd/E17236_01/epm.1112/esb_dbag/frameset.htm?launch.html

    11.2.1.1-online http://docs.oracle.com/cd/E17236_01/epm.1112/epm_backup_recovery_11121/frameset.htm?launch.html BURG

    Thank you

    Todd Rebner

  • Create the procedure - drop index

    Hello

    Using Oracle 10.2, I want to create the following procedure:

    Create or replace procedure Procedure_X IS
    BEGIN
    DROP INDEX TablespaceX.index11;
    end;
    /

    However, this becomes an error PLS-00103:

    Met the 'DROP' symbol during the expected in the following way:

    begin case declare exit end exception for goto if loop mod
    pragma raise return null select update while with
    < an ID > < a between double quote delimited identifiers of >
    < a variable binding > < < close current delete fetch locking insert
    Open restore savepoint sql set run commit forall fusion
    pipe

    Any ideas?

    Sedso

    Try this:

    Create or replace procedure Procedure_X IS
    BEGIN
    EXECUTE IMMEDIATE 'DROP INDEX TablespaceX.index11';
    end;
    

    You must use EXECUTE IMMEDIATE to perform DDL operations in stored programs.

  • create the http client to retrieve data from web service

    Hello

    I am newbie on our webworks. I need to retrieve data from web service. How to connect to this service and analyzed. There is a tutorial that can help me get started with it.

    Can any one advice me how can I start working with webworks on blackberry 10

    Thanks for any help

    In general, you will need to use an AJAX call to the server

    It really depends on what the server returns as to how the information is easy to digest

    JQuery provides a simple interface, and returns information easy to use

    If you deal with things gets complicated XML according to namespace

    If you look at the raw XML data and it goes something like fred: name you will have questions requiring an implementation of SAX - JSON is simple if you don't get that even if (nothing too confusing here)

    If using an external data source JSON go if you have the choice

    As examples go - just look to the top of JQuery Ajax [JSON / XML] and you will get where you're going quickly

    SAX is MUCH harder because of the namespace - Dublin is the most common and same XML without namespace is not simple to handle, so avoid it if you can

  • Create the outline and loads of data to confirm at 11.1.2.2

    Hi all, Feelin' kinda stupid here, since this task really should not be as difficult as it seems.
    I am trying to load the application of TBC in 11.1.2.2 Essbase. I followed the documentation
    1. install EIS
    2. create the metadata repository and load the provided xml file

    I must now create the cube essbase from this repository of metadata, I can't find actual measurements on how to do it, all I found was related to the creation of the repository. Can anyone help to define what needs to be done and what steps I should take, I am new to the SIE and so simple Studio better :)

    thanx

    You may have been hit this issue

    "Catalog of Integration Services migration is not supported on 64-bit UNIX platforms or on the Windows 2008 64-bit platform."

    See you soon

    John
    http://John-Goodwin.blogspot.com/

Maybe you are looking for