Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Performance - my SP needs some
Message
From
02/10/2002 19:36:21
 
 
To
02/10/2002 09:23:38
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00705044
Message ID:
00707163
Views:
22
I have no idea. Are you sure that a record exists for '706652 11 0'? Maybe the cursor is being openned in another datasession?

-Mike

>Mike --
>
>SQLEXEC() returns 1.
>
>Here's the output from SHOWPLAN_ALL:
>
>
>declare @csrAPItem  table (fpokey Char (12) NOT NULL) ; INSERT INTO @csrAPItem (fpokey) VALUES ('706652 11  0') ;
>  |--Table Insert(OBJECT:(@csrAPItem), SET:(@csrAPItem.[fpokey]=RaiseIfNull('706652 11  0')))
> SELECT a.* from apitem a inner join @csrAPItem b ON a.fPOKey = b.fPOKey
> |--Compute Scalar(DEFINE:([a].[fmdescr]=[a].[fmdescr], [a].[fmnotes]=[a].[fmnotes], [a].[fvptdes]=[a].[fvptdes]))
>      |--Bookmark Lookup(BOOKMARK:([Bmk1000]), OBJECT:([M2MDATA40].[dbo].[apitem] AS [a]))
>            |--Nested Loops(Inner Join, OUTER REFERENCES:([b].[fpokey]))
>                 |--Table Scan(OBJECT:(@csrAPItem AS [b]))
>                 |--Index Seek(OBJECT:([M2MDATA40].[dbo].[apitem].[pokey] AS [a]), SEEK:([a].[fpokey]=[b].[fpokey]) ORDERED FORWARD)
>
>
>I'm new to this information, but nothing unusual pops up. In other columns, there are no errors indicated.
>
> Jay
>
>
>
>>What value is being returned by SQLEXEC()? Have you tried using SQL Profiler to see what's being sent to SQL Server?
>>
>>-Mike
>>
>>>Thanks, I'd missed the separator between lines.
>>>
>>>I'm still not getting a cursor on the VFP side. I've played around with some other variations, to no avail. Code fine works in QA.
>>>
>>>Any other thoughts, or suggestions on debugging SPT?
>>>
>>> TIA,
>>>
>>> Jay
>>>
>>>>Terminate each line with a semi-colon.
>>>>
>>>>-Mike
>>>>
>>>>>Michael --
>>>>>
>>>>> SQL access is set up through our internal framework.
>>>>>
>>>>> This is a very simple test program. lnResult is 1. But, csrAPItems doesn't appear in the current data session.
>>>>>
>>>>>
>>>>>
>>>>>*     Create SP string with:
>>>>>*     1.  Table variable.
>>>>>
>>>>>lcSQL = "declare @csrAPItem  table (fpokey Char (12) NOT NULL) "
>>>>>
>>>>>*     2.  Insertion of a value into table variable
>>>>>lcSQL = lcSQL + "INSERT INTO @csrAPItem (fpokey) VALUES ('706652 11  0') "
>>>>>
>>>>>*     3.  Join with main table
>>>>>lcSQL = lcSQL + "SELECT a.* from apitem a inner join @csrAPItem b ON a.fPOKey = b.fPOKey"
>>>>>
>>>>>lnResult =  SQLEXEC (lnHandle, lcSQL, "csrAPItems")
>>>>>
>>>>>
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform