|
-
haha, yup that works. However before I heard back from you I figured another way to do it. Much more involved. this is the script I used:
create table AXIUM.RESRCHTMP
(
"Patient" NUMBER(10)
);
insert into AXIUM.RESRCHTMP ("Patient") SELECT "Patient" FROM PATIENT WHERE "Patient" NOT IN ( SELECT a."Patient" FROM PATIENT A, PFORM B WHERE a."Patient"= b."Patient" and "FormCode"='RESRCH' );
ALTER TABLE AXIUM.RESRCHTMP
ADD (
"FormCode" CHAR(6 BYTE),
"Date" DATE,
"User" NUMBER(10),
"PForm" NUMBER(10),
"Description" VARCHAR2(30 BYTE),
"OwnerType" NUMBER(5),
"OwnerId" NUMBER(10),
"CreatedDate" DATE,
"Approved" NUMBER(5),
"LastAppUser" NUMBER(10),
"LastAppDate" DATE,
"Inactive" NUMBER(5),
"InactiveAppUser" NUMBER(10),
"InactiveAppDate" DATE,
"InactiveReason" VARCHAR2(50 BYTE),
"FStatus" CHAR(6 BYTE),
"AssignedUser" NUMBER(10),
"AssignedUGroup" CHAR(6 BYTE)
);
update RESRCHTMP set "FormCode"='RESRCH',
"Date"=trunc(sysdate),
"User"='20240',
"PForm"=PFORM_PFORM_SEQ.nextVal,
"Description"='Research Consent & Info',
"OwnerType"='0',
"OwnerId"="Patient",
"CreatedDate"=trunc(sysdate),
"Approved"='1',
"LastAppUser"='20240',
"LastAppDate"=trunc(sysdate),
"Inactive"= '0',
"InactiveAppUser"='0',
"AssignedUser"= '0';
INSERT INTO PFORM SELECT * FROM RESRCHTMP;
DROP TABLE RESRCHTMP;
It did what I needed, just more involved.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|