Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

Record Set from Range table

AQHJun 19 2023

Greetings,

i do want to populate my table ‘TRANSTAB’ column ‘ACCOUNTCODE’ with numbers generated from provide range in table VG_RANGE columns FROMRANGE and TORANGE, please assist

table named vg_range with following columns
CREATE TABLE vg_range
(
FROMRANGE VARCHAR2(100 BYTE),
TORANGE VARCHAR2(100 BYTE),
ACCOUNTGROUP VARCHAR2(100 BYTE)
)
having following records
INSERT INTO vg_range (FROMRANGE, TORANGE, ACCOUNTGROUP) VALUES ('0060000000', '0069999999', 'ZS01');
INSERT INTO vg_range (FROMRANGE, TORANGE, ACCOUNTGROUP) VALUES ('0070000000', '0079999999', 'ZS02');
========================

CREATE TABLE transtab
(
ACCOUNTCODE VARCHAR2(100 BYTE),
ACCOUNTGROUP VARCHAR2(100 BYTE)
)

having following records

INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS01');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS01');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS01');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS01');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS01');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS01');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS01');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS01');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS01');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS01');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS01');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS02');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS02');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS02');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS02');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS02');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS02');
INSERT INTO transtab (ACCOUNTCODE, ACCOUNTGROUP) VALUES ('', 'ZS02');

This post has been answered by Solomon Yakobson on Jun 19 2023
Jump to Answer
Comments
Post Details
Added on Jun 19 2023
4 comments
92 views