Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird problem
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Weird problem
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01519939
Message ID:
01519939
Views:
149
Hi everybody,

I had a perfectly working form that used embedded parameters into strings used for SQL Exec. Today I decided to change it to use parameters.

Now, the code that used to work just fine is failing. What may be the reason before I change it back?

Here are the queries that used to work and now it can not find the temp table:
if object_id('tempdb..#csrI_Item') is not null drop table #csrI_Item
select * 
  into #csrI_Item
  from i_items  
  where department = ?m.cDep
  and category = ?m.cCat
  and item = ?m.cItem
SELECT * from #csrI_Item

8/2/2011 1:43:10 PM	49390.85	ADMIN 	NAOMIN	      	MY_DATAFORM.DATAENVIRONMENT.OPENTABLES()	WEBPAGES
MySqlExec successfully executed in 0.005 seconds. - i_items has 7 records

8/2/2011 1:43:10 PM	49390.85	ADMIN 	NAOMIN	        	MAKE_VIEW_UPDATABLE()	WEBPAGES

{call siriussp_get_keyfields('i_items')}

8/2/2011 1:43:10 PM	49390.88	ADMIN 	NAOMIN	        	MAKE_VIEW_UPDATABLE()	WEBPAGES
MySqlExec successfully executed in 0.009 seconds. - csrKeyFields has 1 record

8/2/2011 1:43:10 PM	49390.88	ADMIN 	NAOMIN	      	MY_DATAFORM.DATAENVIRONMENT.OPENTABLES()	WEBPAGES

select * from i_attlnk WHERE invent_id in (select invent_id FROM #csrI_Item)
DROP TABLE #csrI_Item

8/2/2011 1:43:24 PM	49404.06	ADMIN 	NAOMIN	      	MY_DATAFORM.DATAENVIRONMENT.OPENTABLES()	WEBPAGES
MySqlExec resulted in error in 0.001 seconds.
The error message is: [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name '#csrI_Item'.
So, why would csrI_Item table no longer exist when I switched to using parameters?
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform