473,385 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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

Dec 4 '06 #1
2 1169
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
Dec 4 '06 #2
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
Dec 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Lili | last post by:
I'm having problems creating a simple stored procedure in DB2. Can someone help? Here is the screen dump when I tried to load the stored procedure. Thanks for any help. Create procedure...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
3
by: Nils Magnus Englund | last post by:
Hi, I've made a HttpModule which deals with user authentication. On the first request in a users session, it fetches data from a SQL Server using the following code: using (SqlConnection...
1
by: E.T. Grey | last post by:
I have been busting my nut over this for pretty much most of the day and it is driving me nuts. I posted this to an mySQL ng yesterday and I have not had any response (I'm pulling my hair out...
4
by: James | last post by:
How can I see/set the timeout for a postback? I have a button click event which loops through a DataSet and calls a stored procedure for every record in the dataset. This can be a very large...
1
by: peaceburn | last post by:
Hi, I'm gonna pull my hair in the coming days with these DB2 stored procedures. So the issue, let's assume a simple stored procedure like this : CREATE PROCEDURE MYSCHEMA.PROCEDURE1 ( )...
7
by: Materialised | last post by:
Hi Folks, Just a quickie, I am inserting some records (individually) into a SQL Server Table. I am wondering how can I detect primary key violations on this data which I am inserting into the...
1
by: Ted | last post by:
In MS SQL I used the following to create a stored procedure. USE AdventureWorks; GO IF OBJECT_ID ( 'HumanResources.usp_My_Search', 'P' ) IS NOT NULL DROP PROCEDURE HumanResources.usp_My_Search;...
7
by: CSharper | last post by:
Yesterday I had a heated discussion with my colleagues on what is a data centric application and having business logic in sql. I have group of people who wants to include all the business logic in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.