GithubHelp home page GithubHelp logo

INSERT SELECT Statement about priscilla HOT 2 CLOSED

bedorlan avatar bedorlan commented on July 21, 2024 2
INSERT SELECT Statement

from priscilla.

Comments (2)

bedorlan avatar bedorlan commented on July 21, 2024

Hi. Can you provide me with some test code please?

from priscilla.

yapnel avatar yapnel commented on July 21, 2024

CREATE OR REPLACE PROCEDURE TEST1
AS
BEGIN
INSERT INTO WH_F WT (BUSINESS_DATE, AMOUNT)
( SELECT BUSINESS_DATE, SUM (PL) AS AMOUNT
FROM WH_LOAN_F
GROUP BY BUSINESS_DATE);

COMMIT;
END TEST1;
/

CREATE OR REPLACE PROCEDURE TEST2
AS
V_HIER_START DATE;
BEGIN
SELECT HIER_START
INTO V_HIER_START
FROM CIN_BUILD_LOG CBL
WHERE CBL.BUSINESS_DATE = V_VERDATE;

COMMIT;
END TEST2;
/

CREATE OR REPLACE PROCEDURE TEST3
AS
BEGIN
MERGE INTO member_staging x
USING (SELECT member_id,
first_name,
last_name,
RANK
FROM members) y
ON (x.member_id = y.member_id)
WHEN MATCHED
THEN
UPDATE SET
x.first_name = y.first_name,
x.last_name = y.last_name,
x.RANK = y.RANK
WHERE x.first_name <> y.first_name
OR x.last_name <> y.last_name
OR x.RANK <> y.RANK
WHEN NOT MATCHED
THEN
INSERT (x.member_id,
x.first_name,
x.last_name,
x.RANK)
VALUES (y.member_id,
y.first_name,
y.last_name,
y.RANK);

COMMIT;
END TEST3;
/

from priscilla.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.