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 7561051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T13:04:03+00:00 2026-05-30T13:04:03+00:00

I’m having some issues using checkboxes in combination with an insert/update statement. As it

  • 0

I’m having some issues using checkboxes in combination with an insert/update statement. As it stands, I have a report of available credit cards, with a checkbox next to each row. The user can select as many as they like to approve, then hit a submit button to have their profile updated. This is where I am stuck.

I would like to have a single PSQL process that will update the user profile table based on whether or not said credit card is there. If it doesn’t exist, then we insert all relevant information. If it already is there, all I want to do is update that record by changing ‘Approved_flag’ to ‘Y’. I’ve written this code chunk, which inserts new records and it works fine:

FOR i in 1..APEX_APPLICATION.G_F01.count
 LOOP
  INSERT INTO ls_credit_cards(credit_card_id, created_by, created_on, card_id,    user_id, approved_flag)
  VALUES (apex_application.g_f01(i), :F125_USER_ID,sysdate, :P58_CARDS, :P58_USER, 'Y');
 END LOOP;

I understand that ORACLE doesn’t support the usual if/else commands, so I’ve researched this a bit and found that I should probably be using the MERGE command, but everything I’ve seen makes it use two tables. All I’m using is one, with all data being taken from the report/check boxes so I’m kind of at a loss here. Can I still use the MERGE command in this instance, or is there something else that would serve my purposes better?

  • 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-30T13:04:05+00:00Added an answer on May 30, 2026 at 1:04 pm

    You can use MERGE. You just need to select your data from `DUAL’

    MERGE INTO ls_credit_cards dest
      USING( SELECT apex_application.g_f01(i) credit_card_id, 
                    :F125_USER_ID created_by,
                    sysdate created_on, 
                    :P58_CARDS card_id, 
                    :P58_USER user_id, 
                    'Y' approved_flag
               FROM dual) src
          ON( dest.credit_card_id = src.credit_card_id )
     WHEN MATCHED 
     THEN
       UPDATE SET dest.approved_flag = src.approved_flag
     WHEN NOT MATCHED
     THEN
       INSERT( credit_card_id, 
               created_by,
               created_on,
               card_id,
               user_id,
               approved_flag )
         VALUES( src.credit_card_id,
                 src.created_by,
                 src.created_on,
                 src.card_id,
                 src.user_id,
                 src.approved_flag );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
We're building an app, our first using Rails 3, and we're having to build
I have thousands of HTML files to process using Groovy/Java and I need to
I have some data like this: 1 2 3 4 5 9 2 6
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,

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.