SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Addict matt_12511's Avatar
    Join Date
    Feb 2004
    Location
    Michigan
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    creating stored procedure

    hello all,

    I am working my way through a book using SQL Server and ASP to create an ecommerce website. The book is a little old and now I see the code for creating a SQL stored procedure has an error.

    Code:
    /* Retrieves the last basket for the shopper */
    
    Create Procedure sp_RetrieveLastBasket AS
    
    /* Pass in the ID of the shopper */
    @idShopper int
    
    AS
    
    /* Select the basket data for all baskets assigned to the shopper
    and where the order was never finished.  We sort the data in 
    descending order so that the last basket is returned first. */
    select * from basket
    where idShopper = @idShopper and intOrderPlaced =0 and intTotal =0
    order by dtCreated DESC
    The error happens where it passes the id of the shopper. @idShopper int

    and another error that happens where @idShopper is referenced.

    Thanks
    Matt

  2. #2
    Database Jedi MattR's Avatar
    Join Date
    Jan 2001
    Location
    buried in the database shell (Washington, DC)
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    remove the first AS

  3. #3
    SitePoint Addict matt_12511's Avatar
    Join Date
    Feb 2004
    Location
    Michigan
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks!

    Debugging...

    Matt


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •