April 28, 2008 at 8:59 am
i am retrieving data from oracle and trying to put the result set into a temp table but the insert into the temp table does not work. the oracle query does work. i tried using memory,global and temp tables with no success. i also made sure the data transaction is turned on in the servers and my local computer. example of the code:
SELECT * INTO #DailyPons FROM EXECUTE
('select p.pon, pon_sales_rep, p.pon_macnum
from (select pon, max(pon_ver) as pon_ver from local_pon group by pon) p2 join local_pon p on p2.pon=p.pon and p2.pon_ver = p.pon_ver
where pon_status =''7''') AT CUSTOMER;
April 28, 2008 at 9:07 am
What doesn't work?
Can you create the table and then insert?
create table #sss
insert #sss exec ()
April 28, 2008 at 9:12 am
the oracle statement works fine (i ran it separetly in sql 2005). but when i run the script as a whole in SQL 2005 i get his error "Incorrect syntax near the work execute" instead of using open query i am using EXEC.
April 28, 2008 at 9:15 am
i did createa temp table and a global table but when i try to insert the data i get eh error incorrect syntax near execute
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply