Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Performance - my SP needs some
Message
From
03/10/2002 08:42:05
 
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00705044
Message ID:
00707269
Views:
15
Mike --

Thanks for your help. The code works fine in QA and returns 1 record. When I've run this, there's been only one datasession open. So, I remain puzzled.

The immediate issue yielded to another, better solution, so I've put this on the back burner. If I feel the final resolution is of interest, I'll continue this thread with the solution.

Jay

>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")
>>>>>>
>>>>>>
Previous
Reply
Map
View

Click here to load this message in the networking platform