SHAPE problem with Stored Procs in SQL Server

SHAPE problem with Stored Procs in SQL Server

Post by Thomas Eyd » Thu, 15 Apr 1999 04:00:00



Anyone having an answer on this:

Using hierarcical or shaped recordset using this syntax:



Client_No )

Does work, but has a puzzling side-effect in SQL Servers stored procedure:


queries, the T-SQL is something like this:


    -- Do the detail query here
end

else begin
    -- Do the no-detail query here
end

Guess what? The if statement is completely ignored when the sp is called
using the SHAPE syntax, that is the else part is always executed. When

command has to return a recordset.

Executing the same sp in the query window in SQL Server Enterprice Manager
gives all the expected results.

 
 
 

1. SHAPE Command and Stored Procs

If anyone has experience with using SPs instead of SELECT statements with
data shaping, I would appreciate some advice.

This works:
SHAPE {EXECUTE spProductObjectList 1} AS VLObjects
APPEND ({EXECUTE spProductPropValueList 1, 1} AS VLProperties
RELATE 'ID' TO 'OwnerID',
                 'TypeID' TO 'TypeID') AS VLProperty

This does not.
SHAPE {EXECUTE spProductObjectList 1} AS VLObjects
APPEND ({EXECUTE spProductPropValueList ?, ?} AS VLProperties
RELATE 'ID' TO PARAMETER 0,
                'TypeID' TO PARAMETER 1) AS VLProperty

Any comments or suggestions would be appreciated.  I would prefer that you

newsgroup.

Thanks in advance,

Jeff Jones

2. Does order by affect the index that will be used?

3. Returning a shaped ADO.Recordset using Stored Procs

4. dbload problem

5. CR no LF problem in SQL server Stored Procs

6. Removing Member from the role Public

7. SHAPE Command and Stored Procs

8. Help a learner with a problem

9. Returning a shaped ADO.Recordset using Stored Procs

10. Using Stored Procs w/ Data Shaping

11. Use Stored Procs In Data Shaping?

12. ADO, Parameters and SQL Strings (not stored procs) in SQL Server

13. Triggers, Stored Procs and SQL Mail problem