eseabrook2008
Technical User
I'm trying to created an INSERT statement to insert data from another table as well as explicit data. This is what I've tried:
**this statement gets all the agentid's I need**
INSERT INTO SYS2_CSIO_BROKERINFORMATION
(AGENTID)
SELECT DISTINCT agentID
FROM Sys2_AgentsAndDirectors AD
WHERE ad.companynumber = '101' and status = 'A' and agentid between '100000' AND '183000';
**this statement adds the explicit data I need**
INSERT INTO SYS2_CSIO_BROKERINFORMATION
(VENDORSYSTEM, COMPANYNUMBER, STATUSINDICATOR)
VALUES ('1', '101', '1');
I need to be able to combine the two so that with each 'agentid' added, the required explicit data is added as well. Am I able to combine the two? It won't even run the first Statement because the COMPANYNUMBER field cannot be null.
Thoughts?
**this statement gets all the agentid's I need**
INSERT INTO SYS2_CSIO_BROKERINFORMATION
(AGENTID)
SELECT DISTINCT agentID
FROM Sys2_AgentsAndDirectors AD
WHERE ad.companynumber = '101' and status = 'A' and agentid between '100000' AND '183000';
**this statement adds the explicit data I need**
INSERT INTO SYS2_CSIO_BROKERINFORMATION
(VENDORSYSTEM, COMPANYNUMBER, STATUSINDICATOR)
VALUES ('1', '101', '1');
I need to be able to combine the two so that with each 'agentid' added, the required explicit data is added as well. Am I able to combine the two? It won't even run the first Statement because the COMPANYNUMBER field cannot be null.
Thoughts?