Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLEXEC and Shared Connection Problems
Message
From
12/11/2004 15:16:55
 
 
To
12/11/2004 04:16:17
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8
OS:
Windows XP SP1
Database:
MS SQL Server
Miscellaneous
Thread ID:
00960314
Message ID:
00960996
Views:
8
Hi Fabio,

>But!, you can to explain we as this behavior in synchronous modality can be useful ?
>With synchronous execution VFP it downloads all the cursor before returning the execution,
>

This is true for SQLEXEC, but not for remote view or CursorAdapter.

>and therefore I do not see the simultaneous execution.
>

We are not talking about simultaneous execution, we are talking about fetch process.


>On the web don't exists ONE, I say ONE, example where
>AllowSimultaneousFetch it is used.
>
>You can arrange this lack today ?
>

Here is an example, it uses new cursor properties introduced in VFP9 to check how many records have been fetched for a remote view cursor, but VFP8 behavior is the same.
CLEAR 

CLOSE DATABASES all

DELETE FILE TestSimultaneousFetch.dbc
CREATE DATABASE TestSimultaneousFetch

CREATE CONNECTION testConn CONNSTRING 'driver=SQL SERVER;server=(local);database=Northwind'

CREATE SQL VIEW testView1 REMOTE CONNECTION testConn SHARE as select * from categories
DBSETPROP('testView1','view', 'AllowSimultaneousFetch',.T.)
DBSETPROP('testView1','view', 'fetchasneeded', .T.)
DBSETPROP('testView1','view', 'fetchsize', 1)

CREATE SQL VIEW testView2 REMOTE CONNECTION testConn SHARE as select * from categories
DBSETPROP('testView2','view', 'AllowSimultaneousFetch',.T.)
DBSETPROP('testView2','view', 'fetchasneeded', .T.)
DBSETPROP('testView2','view', 'fetchsize', 2)

USE testView1 IN 0
USE testView2 IN 0

*?SQLGETPROP(CURSORGETPROP("ConnectHandle","testView1"),"ODBChdbc")
*?SQLGETPROP(CURSORGETPROP("ConnectHandle","testView2"),"ODBChdbc")
*?SQLGETPROP(CURSORGETPROP("ConnectHandle","testView1"),"ODBChstmt")
*?SQLGETPROP(CURSORGETPROP("ConnectHandle","testView2"),"ODBChstmt")

IF SQLGETPROP(CURSORGETPROP("ConnectHandle","testView1"),"ODBChdbc")!= ;
	SQLGETPROP(CURSORGETPROP("ConnectHandle","testView2"),"ODBChdbc")
	? "Connection is not shared!!!"
ENDIF	

DO WHILE !EOF("testView1")
	?"Fetched for testView1", ;
		CURSORGETPROP("RecordsFetched","testView1"),;
		"Fetch is complete",CURSORGETPROP("FetchIsComplete","testView1")
	?"Fetched for testView2", ;
		CURSORGETPROP("RecordsFetched","testView2"),;
		"Fetch is complete",CURSORGETPROP("FetchIsComplete","testView2")
	
	SKIP IN testView1
	SKIP IN testView2
ENDDO 

?"Fetched for testView1", ;
	CURSORGETPROP("RecordsFetched","testView1"),;
	"Fetch is complete",CURSORGETPROP("FetchIsComplete","testView1")
?"Fetched for testView2", ;
	CURSORGETPROP("RecordsFetched","testView2"),;
	"Fetch is complete",CURSORGETPROP("FetchIsComplete","testView2")
Thanks,
Aleksey.
Previous
Reply
Map
View

Click here to load this message in the networking platform