473,404 Members | 2,137 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,404 software developers and data experts.

Regarding stored procedure help me

24
Hi
I want to know how to write storedprocedure when search creiteria is Present.

Here the query to give the list of

"select ID, Salesmennummer , Salesname Commision, Areacode from sales_master

Areacode Salesmennummer Salesname Commision
1 1000 Rams 200
2 2000 Johny 1000


I Want to search above list by areacode or Salesmennummer or Salesname.

so PlZ help me how to write storedprocedure for this.

Thanq.
Feb 12 '09 #1
5 1155
ammoos
100 100+
Create procedure [OWNER].[PROCEDURE NAME]
@areacode integer
as
begin
select ID, Salesmennummer , Salesname Commision, Areacode from sales_master
where Areacode=@areacode
end

GO
Feb 12 '09 #2
chinni1
24
Thanq for ur reply .I tried like

CREATE PROCEDURE [dbo].[salesearch]

@sales_code int,
@sales_name varchar(50),
@area_code int
AS

set nocount on;
select sales_code,sales_name,area_code from sales where sales_code=@sales_code and sales_name=@sales_name
and area_code=@area_code
GO


but i got err like" Procedure 'salesearch' expects parameter '@sales_code', which was not supplied."
what it mean
Thanq
Feb 12 '09 #3
gpl
152 100+
It means that you have not provided all 3 parameters when you ran it
Feb 12 '09 #4
chinni1
24
Iam new to storedprocedures will u tell me hw to provide parameters
Feb 12 '09 #5
dafodil
392 256MB
Different languages have different ways of passing parameters to SQL stored procedures. Try to read this and view the other links connected to this site:
http://msdn.microsoft.com/en-us/library/ms190669.aspx

Heres about parameters:
http://msdn.microsoft.com/en-us/library/ms189260.aspx
Feb 12 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Jeremy | last post by:
I am relatively inexperienced with SQL, and I am trying to learn how to analyze some data with it. I have a table with the following information. COMPANY ID , DATE, MarektValue I would like...
3
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my...
1
by: Neil | last post by:
Please could someone explain to me the differences between a stored procedure and a view. The reason for this question is I have two almost identical ASP pages. Both get the same results but one...
4
by: leodippolito | last post by:
Hello, It might be a basic question, but there it goes: I have a store procedure that first checks if the record exists and, if it doesn't, inserts the new record. Is the scenario below...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
4
by: annhere | last post by:
Hi, Could any one please shed some light as to how an jar whose copy has been deleted from the SQLLIB\FUNCTIONs\JAR\<schema> still be referred to from our projects? Even after installing a fresh...
4
hirak1984
by: hirak1984 | last post by:
Dear Sir/mam, I am new comers for DB2 .I Write a Stored Procedure below in line CREATE PROCEDURE AUS.PROCEDURE1 ( IN var0 VarCHAR(4000), OUT var1 CHAR(6) ) DYNAMIC RESULT SETS 1...
0
hirak1984
by: hirak1984 | last post by:
Dear Sir/mam, I am new comers for DB2 .I Write a Stored Procedure below in line CREATE PROCEDURE AUS.PROCEDURE1 ( IN var0 VarCHAR(4000), OUT var1 CHAR(6) ) DYNAMIC RESULT SETS 1...
1
by: rsreeni | last post by:
Hi, We are planning to use Cobol Stored procedures for doing our Data retrieval from DB2 Tables. The stored procedure(s) will be called from J2EE application via Db2 Connect. Does the linkage...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.