Reputation: 65
I have this table called A and it has id and have another table called B having blank id column.I want to add these id from table A to B .Suppose first it will add ID 1 in table B then ID 2 3 4 5 so on .. whenever i add value to table A it automatically gets add into the table B with time of 3 min .means table B will be refreshed by 3 min and fetch record from table A.But you have to check previous record value in table B and then add next value
--------------
| ID |
---------------
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
| 6 |
| 7 |
| 8 |
| 9 |
| 10 |
----------------
Upvotes: 2
Views: 1780
Reputation: 1804
SAS data sets (tables) are not the same as Relational database tables so you can't add triggers on SAS tables. But you can schedule a sas program to run every 3 mins. to copy new values from table A to table B. Example code below.
Steps:
Code:
data a;
input id;
datalines;
1
2
3
4
5
;
run;
data b;
input id;
datalines;
1
2
;
run;
proc sql;
create table lookup as select distinct id from b; quit;
proc sql;
insert into work.b select * from a where a.id not in (select id from lookup) ;
quit;
Output: Table B post insert
id=1
id=2
id=3
id=4
id=5
Upvotes: 2