Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3793974
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:51:30+00:00 2026-05-19T12:51:30+00:00

Is there any Oracle function that indicate the existence of a record, or any

  • 0

Is there any Oracle function that indicate the existence of a record, or any other useful technique to achieve this?

EDIT: using the MERGE statement I did:

MERGE
 INTO  lims_min.mytab src
 USING lims_min.mytab tgt
    ON (    src.col1 = tgt.col1
        AND tgt.col1 = p_val1
        AND src.col2 = tgt.col2
        AND tgt.col2 = p_val2
       )

 WHEN MATCHED
 THEN
 UPDATE
  SET tgt.col3=p_val3,
      tgt.col4=p_val4

 WHEN NOT MATCHED
 THEN
 INSERT  (col1, col2, col3, col4)
 VALUES  (val1, val2, val2, val4);

I get the error saying that col3 is invalid identifier. No typos, and it is existing column.p_val1, p_val2, p_val3 and p_val4 are string parameters that are passed to the stored procedure. i am thinking that the issue may lie in these params, perhaps they should be placed inside a WHERE statement?
Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T12:51:30+00:00Added an answer on May 19, 2026 at 12:51 pm

    You are looking for merge in Oracle.

    MERGE
           INTO  target_table tgt
          USING source_table src
             ON  ( src.object_id = tgt.object_id ) //The key to check if the record exists
           WHEN MATCHED // if exists
           THEN
         UPDATE
            SET   tgt.object_name = src.object_name //update it
            ,     tgt.object_type = src.object_type
           WHEN NOT MATCHED                         // if not exists
           THEN
         INSERT ( tgt.object_id                    //then insert
                , tgt.object_name
                , tgt.object_type )
         VALUES ( src.object_id
                , src.object_name
                , src.object_type );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any other way to get datetime field from oracle database in 24hour
Is there any possibility of using EF Code First for Oracle DB. Even though
Is there any way to add dates/times that will be portable between Oracle and
Is there any way in Oracle to determine whether a package has state or
is there any way in Oracle, to get only the dd-mm-yyyy part from an
is there any problem to install different oracle 11g versions. I mean if I
Are there any Open Source tools to compare different Oracle Schemas and provide the
Is there any way to stop or terminate long running Oracle query in JDBC
I want to migrate schema from Oracle to MySQl, so are there any free
I'm deploying a PHP application that connects to an Oracle 9i server using the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.