Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Create procedure to duplicate Table

0 Likes
402
  • SAP Managed Tags

Hi all,

I am trying to create a script that populates a database with test data by duplicating a set of test data tables that I have.

Am having trouble getting it to work, any suggestions?

Sander

DROP PROCEDURE TEST;

CREATE PROCEDURE TEST ()

LANGUAGE SQLSCRIPT

READS SQL DATA AS

BEGIN

DECLARE i INT;

FOR i IN 1 .. 40 DO

create column table concatenate(copySCR1;:i) AS (SELECT * from "SRC1");

create column table concatenate(copySCR2;:i) AS (SELECT * from "SRC2");

create column table concatenate(copySCR3;:i) AS (SELECT * from "SRC3");

create column table concatenate(copySCR4;:i) AS (SELECT * from "SRC4");

END FOR;

END;

call TEST(?);

0 REPLIES 0