Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLExec works but no data is returned from SQLserver
Message
From
07/09/2005 14:13:59
 
 
To
07/09/2005 13:42:54
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows 2000 SP4
Database:
MS SQL Server
Miscellaneous
Thread ID:
01047408
Message ID:
01047434
Views:
11
This message has been marked as the solution to the initial question of the thread.
>I have a series of commands I am sending to my SQLserver. When I execute the string it works and I get 1 back from the SQLexec but I don't get a data set. When I execute the command in QA is works too. Here is the command string. I have made blank lines between commands but it goes as a single string from VFP. I have also tried taking the two 'drop table' commands off the end of the string but I still don't get data back.
>
>
>select a.repcode,  a.purord,  count(a.sernum) as qty , b.stuff   into #select1
> from scraps a  LEFT OUTER JOIN redcode b ON a.scrapcode = b.number  where
>a.purord in (select distinct purord from income where  custnum = 'AF' OR
>custnum = 'AF3') and a.actiondate >= '01/01/05' and a.actiondate <= '09/07/05'
>and b.stuff not like 'INPUT ERROR%'  group by a.repcode,  a.purord,
>a.scrapcode, b.stuff  order by a.repcode, a.purord,  a.scrapcode, b.stuff ;
>
>select distinct purord, recdate into #select2 from income;
>
>select a.*, b.recdate from #select1 a left outer join #select2 b
>on a.purord = b.purord order by a.purord ;
>
>drop table #select1;
>
>drop table #select2
>
Sergey is right, VFP7 the sql odbc parser don't support a complex script.

Why you uses 2 temp tables, this is slow in SQL Server.
SELECT a.*, b.recdate
FROM 
(select a.repcode,  a.purord,  count(a.sernum) as qty , b.stuff 
 from scraps a  LEFT OUTER JOIN redcode b ON a.scrapcode = b.number  where
 a.purord in (select distinct purord from income where  custnum = 'AF' OR
 custnum = 'AF3') and a.actiondate >= '01/01/05' and a.actiondate <= '09/07/05'
 and b.stuff not like 'INPUT ERROR%'  group by a.repcode,  a.purord,
 a.scrapcode, b.stuff  order by a.repcode, a.purord,  a.scrapcode, b.stuff ) a
left outer (select distinct purord, recdate from income) b
on a.purord = b.purord order by a.purord
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform