Syntax Error

I’m trying to add the following code to a stored procedure to capture Special Request Names, but I get a Syntax error right at ON:

 

Below is the code I’m using:

 

If @ude_no = 1 and @customer_no > 0

      Select    @ude_value =  coalesce(assoc.fname +' '+  assoc.lname ,'')

      From  T_CUSTOMER AS assoc ON assoc.customer_no = T_SPECIAL_REQ.assoc_customer_no

      Where customer_no = @customer_no

 

Anythoughts?

  • The code you provided does not specify your join to table T_SPECIAL_REQ.  I assume you intended the following:

     

     

    If @ude_no = 1 and @customer_no > 0

          Select    @ude_value =  coalesce(assoc.fname +' '+  assoc.lname ,'')

          From  T_CUSTOMER AS assoc

          JOIN  T_SPECIAL_REQ ON assoc.customer_no = T_SPECIAL_REQ.assoc_customer_no

          Where customer_no = @customer_no

     

     

    From: Tessitura Technical Forum [mailto:forums-technical@tessituranetwork.com] On Behalf Of Triland McConico
    Sent: Monday, November 12, 2012 4:46 PM
    To: Guy, Jackie
    Subject: [Tessitura Technical Forum] Syntax Error

     

    I’m trying to add the following code to a stored procedure to capture Special Request Names, but I get a Syntax error right at ON:

     

    Below is the code I’m using:

     

    If @ude_no = 1 and @customer_no > 0

          Select    @ude_value =  coalesce(assoc.fname +' '+  assoc.lname ,'')

          From  T_CUSTOMER AS assoc ON assoc.customer_no = T_SPECIAL_REQ.assoc_customer_no

          Where customer_no = @customer_no

     

    Anythoughts?




    This message was sent automatically to you by www.tessituranetwork.com because you subscribed to the Tessitura Technical Forum. You may reply to this message to post to the Technical forum or visit the site to search, read and post to the forums. In the interest of keeping the forum posts from becoming cluttered, we encourage you to delete previous message text from your reply before sending. Thank you!