PL/SQL (MOSC)

MOSC Banner

LOOP - Iteration based on Profile Value

edited May 7, 2020 10:55AM in PL/SQL (MOSC) 6 commentsAnswered

Hello All,

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionPL/SQL Release 11.2.0.4.0 - ProductionCORE 11.2.0.4.0 ProductionTNS for IBM/AIX RISC System/6000: Version 11.2.0.4.0 - ProductionNLSRTL Version 11.2.0.4.0 - Production

Based on User Profile Value, data should be inserted into the table.

Profile value must be always greater than 1. i.e. 2,3,4.....

Table - TEST_XML of 5 records.

If the Profile Value is 2, then Filename should remains unique for every 2 values update of records into the table.

CREATE SEQUENCE customers_seq START WITH     1 INCREMENT BY   1 NOCACHE NOCYCLE;

drop TABLE TEST_XML;CREATE TABLE TEST_XML (UNIQUE_ID VARCHAR2(200),NAME VARCHAR2(200),flag VARCHAR2(200),filename VARCHAR2(200),cnt NUMBER );Insert into APPS.TEST_XML(UNIQUE_ID, NAME,flag,filename,cnt) Values('1234-5678-1', 'Customer_JPMorgan_1','N',NULL,0);Insert into APPS.TEST_XML(UNIQUE_ID, NAME,flag,filename,cnt) Values('222-333-444', 'Walmart','N',NULL,0);Insert into APPS.TEST_XML(UNIQUE_ID, NAME,flag,filename,cnt) Values('444-555-666', 'Pepsi','N',NULL,0);Insert into APPS.TEST_XML(UNIQUE_ID, NAME,flag,filename,cnt) Values('666-777-888', 'Coco-Cola','N',NULL,0);Insert into APPS.TEST_XML(UNIQUE_ID, NAME,flag,filename,cnt) Values('9303-78-1', 'New_Yrk','N',NULL,0);COMMIT;
Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center