Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird problem
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01519939
Message ID:
01519971
Views:
49
>TEXT to lcS NOSHOW 
>if object_id('tempdb..#csrI_Item') is not null
>   drop table #csrI_Item
>select * 
>  into #csrI_Item
>  from i_items  
>  where 1 = 0
>ENDTEXT  
>
>mysqlexec(m.lcS, '', PROGRAM()) && no cursor is created, so call this function as it should :-)
>
>
>TEXT to lcS NOSHOW 
>INSERT INTO #csrI_Item
>select * 
>  from i_items  
>  where department = ?m.cDep
>  and category = ?m.cCat
>  and item = ?m.cItem
>SELECT * from #csrI_Item
>ENDTEXT  
>
>mysqlexec(m.lcS, 'i_items', PROGRAM())
>
>TEXT to lcS NOSHOW 
>
>select * from i_attlnk WHERE invent_id in (select invent_id FROM #csrI_Item)
>DROP TABLE #csrI_Item
>ENDTEXT  
>mysqlexec(m.lcS, 'i_attlnk', PROGRAM())
>
>Something like that.

Right, but two problems:

1) Now the query became a bit more complex
2) We have some code in MySQLExec that always uses the main handle and not replicated handle unless it's explicitly passed if the query uses insert/update/delete (it doesn't check if the temp tables are used).

So, the mySQLExec call will need to be slightly changed also.

All and all, it's not worth the trouble, IMHO. But important lesson learned.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform