Simple question about stored procedure

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • teresa

    Simple question about stored procedure

    Hi All,

    I am pretty new to stored procedure and I have a quick question. I
    appreciate any help offered.

    I am writing a stored procedure as follow. This is just an example:


    select field1, field2 from table1 where field1 = 1

    I need to change this stored procedure so that if field2=0 then it will
    be displayed on the web application as 'Yes', if field2=1 then I need
    to display the text 'No' on the web application.
    Field2's type is bit, ie: its' value is either 1 or 0.

    Thanks for any suggestion.

    Sincerely,
    Teresa

  • Seribus Dragon

    #2
    Re: Simple question about stored procedure

    I would say that the web application should do the convertion. BUt I
    think a CASE command is what you want.

    teresa wrote:
    Hi All,
    >
    I am pretty new to stored procedure and I have a quick question. I
    appreciate any help offered.
    >
    I am writing a stored procedure as follow. This is just an example:
    >
    >
    select field1, field2 from table1 where field1 = 1
    >
    I need to change this stored procedure so that if field2=0 then it will
    be displayed on the web application as 'Yes', if field2=1 then I need
    to display the text 'No' on the web application.
    Field2's type is bit, ie: its' value is either 1 or 0.
    >
    Thanks for any suggestion.
    >
    Sincerely,
    Teresa
    >

    Comment

    • teresa

      #3
      Re: Simple question about stored procedure

      Hi Seribus,

      Thanks for your reply. I wrote a CASE command and it works!

      Thank greatly,
      Teresa

      Seribus Dragon wrote:
      I would say that the web application should do the convertion. BUt I
      think a CASE command is what you want.
      >
      teresa wrote:
      Hi All,

      I am pretty new to stored procedure and I have a quick question. I
      appreciate any help offered.

      I am writing a stored procedure as follow. This is just an example:


      select field1, field2 from table1 where field1 = 1

      I need to change this stored procedure so that if field2=0 then it will
      be displayed on the web application as 'Yes', if field2=1 then I need
      to display the text 'No' on the web application.
      Field2's type is bit, ie: its' value is either 1 or 0.

      Thanks for any suggestion.

      Sincerely,
      Teresa

      Comment

      Working...