Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating empty cursor using SQLEXEC()
Message
From
23/07/2003 08:41:53
Dorin Vasilescu
ALL Trans Romania
Arad, Romania
 
 
To
23/07/2003 08:03:44
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00812705
Message ID:
00812725
Views:
11
What about this code that create the DDL command based on alias passed as parameter and store it to clipboard?
LPARAMETERS tcTable
SELECT (tcTable)
lnFields = AFIELDS(laFlds)
SET TEXTMERGE on
SET TEXTMERGE TO memvar _cliptext 
\\CREATE CURSOR <<tcTable>> (
FOR i=1 TO lnFields
	IF i>1
		\\, 
	ENDIF
	\\<<laFlds[i,1]>> <<laFlds[i,2]>>
	IF INLIST(laFlds[i,2],'N','F','C')
		IF laFlds[i,4] <> 0
			\\(<<laFlds[i,3]>>,<<laFlds[i,4]>>)
		ELSE	
			\\(<<laFlds[i,3]>>)
		ENDIF
	ENDIF
	IF laFlds[i,5] = .f. 
		\\ NOT NULL 
	ENDIF
NEXT
\\)
SET TEXTMERGE to
>Dorin, thanks for the reply.
>
>>>You can use CREATE CURSOR command in LOAD event to build a temporary cursor with the same structure until you issue SQLEXEC and refresh it with data.>>
>
>The problem is that I would like to define the cursor based on the structure of the back-end table(s), and not have to define the structure of each field in code.
>
>Regards,
>Alan
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform