Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Does sqlexec() any kind of clearing ????
Message
From
27/10/2005 10:44:54
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
27/10/2005 10:14:32
Albert Beermann
Piepenbrock Service Gmbh & Cokg
Osnabrück, Germany
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
Database:
MySQL
Miscellaneous
Thread ID:
01062617
Message ID:
01062628
Views:
11
>Hello Everybody !
>
>I'm working with FOXPRO 9 against a maxdb database !
>ODBC with SQL-Passthrough
>
>L_cmd="Select .... from ...."
>sqlexec(connection,l_cmd,"mycursor)
>
>Now i have a problem with temporary resultcursors in the maxdb
>
>I create a temporary cursor with a complex recursive select and want to use this cursor for another sql-command
>
>l_cmd="create complexcursor as select ..... FOR REUSE"
>sqlexec(connection,l_cmd)
>
>l_cmd="update table xxx set yyy = 'A' where tablekey in (select tablekey from complexcursor)"
>sqlexec(connection,l_cmd)
>
>error: unkown table complexcursor
>
>The MAxDB-Folks told me that the syntax for creating the complexcursor is ok and normaly it has to be there, but
>some programming languages will do some "clearing" before each task ???!!!
>
>Can someone explain me, what foxpro does with a sequence of sqlexecutes
>Is there any kind of "clearing" befor passing a new command to the database ??????
>
>Any help welcomed
>Best regards
>Albert

Albert,
VFP doesn't do such clearing on itself. I don't know maxdb but with SQL server you can create local or global temporary tables and use them as long as they are in scope. ie:
Text to m.lcSQL noshow
CREATE TABLE #myTemp (myVal varchar(10))
INSERT INTO #myTemp VALUES ('hello')
INSERT INTO #myTemp VALUES ('there')
INSERT INTO #myTemp VALUES ('from fox')
EndText

lnHandle = SQLStringConnect('Driver=SQL server;Trusted_Connection=Yes;Server=(local)')
SQLExec(m.lnHandle,m.lcSQL)
SQLExec(m.lnHandle,"SELECT * FROM #myTemp where myVal like '%fox%'",'myResult')
SQLDisconnect(m.lnHandle)
Select myResult
browse
It should be something related to MaxDb syntax or driver.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform