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

what is wrong with my select for the retrieval of function data - getting error 216

USE [PATEST]
GO
/****** Object: StoredProcedure [dbo].[ndform5queryforxml] Script Date: 12/22/2010 09:03:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: cculwell
-- Create date: 10/29/10
-- Description: nd form 5 query
-- =============================================
ALTER PROCEDURE [dbo].[ndform5queryforxml]
-- Add the parameters for the stored procedure here
@YearMonth VARCHAR(20) = ''
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
SELECT [dbo].[ufn.GetWellSummaryInformation] ( [WellID], [YrMonth], [AllocBegInventory], [AllocEndInventory], [AllocOil], [DaysOn],
[AllocOilSold], [AllocOilUsed], [AllocWater] )FROM [dbo].[ufn.GetWellSummaryInformation] AS [WellID], [YrMonth], [AllocBegInventory], [AllocEndInventory], [AllocOil], [DaysOn],
[AllocOilSold], [AllocOilUsed], [AllocWater] where (wellid is Not null)



-- Insert statements for procedure here
SELECT Company_Info.Name as CompName, Co_Info.ContactStreet as CompAddress,Co_Info.ContactSuite as CompSuite, Company_Info.City as CompCity, Company_Info.State as CompState, Company_Info.Zip as CompZip, Co_Info.CompanyID as Company,Co_Info.ContactFirstName as ContactfirstName,Co_Info.ContactLastName as ContactlastName, Co_Info.ContactPhone as ContactPhone, Co_Info.ContactTitle as ContactTitle, Co_Info.RptAmend as facAmend, Co_Info.RptComment as FacComment, Wells.APICode as FacId, Well_Summary.YearMonth as facreport, Co_Info.RptFacType as FacType, Wells.UserField9 as FacFormation, Wells.WellName as FacName, Wells.Status as FacGroup, Co_Info.RptProdType as ProdType, round(Well_Summary.AllocBegInventory,0) as prodbeginv,
round(Well_Summary.AllocEndInventory,0) as prodendinv,Co_Info.RptUnits as produnits, round(Well_Summary.AllocOil,0) as prodquantity, Well_Summary.DaysOn as proddaysproducing, Co_Info.RptDispType1 as disptype, round(Well_Summary.AllocOilSold,0) as oilsolddispqty, Co_Info.RptDispType2 disptype2,
round(Well_Summary.AllocOilSold,0) as dispquantity2, Co_Info.RptDispType3 as disptype3, round(Well_Summary.AllocOilUsed,0) as dispquantity3, Co_Info.RptProdType1 as prodtype1, Co_Info.RptUnits as produnits1, round(Well_Summary.AllocWater,0) as waterprodqty,.
Well_Summary.DaysOn as proddaysproducing1, Wells.State AS Wstate, Wells.WellOperator as WellOperator, Wells.Status as wstatus, Leases.ClientId as lclient
FROM Wells INNER JOIN
Leases ON Wells.LeaseID = Leases.LeaseID CROSS JOIN
Well_Summary CROSS JOIN Co_Info CROSS JOIN
Company_Info inner join
dbo.ufnGetWellSummaryInformation on Wells.Wellid = wellid
WHERE (Leases.ClientID = 15) AND (Wells.WellOperator LIKE 'PETRO%') AND (Wells.State = 'ND') AND (Wells.APICode IS NOT NULL)
AND (Wells.Status NOT LIKE '%P&A%') AND (Well_Summary.YearMonth=@YearMonth) AND (Co_Info.ReportId = 'ND5')
ORDER BY Wells.APICode, Wells.WellName
END
getting the following error:
Msg 216, Level 16, State 1, Procedure ndform5queryforxml, Line 29
Parameters were not supplied for the function 'dbo.ufnGetWellSummaryInformation'.
Dec 22 '10 #1
1 1792
Rabbit
12,516 Expert Mod 8TB
You can't select from a stored procedure, you will need to create a temp table, insert into the temp table, and then select from that.
Dec 22 '10 #2

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

Similar topics

6
by: Steve Strik | last post by:
Hi, I'm using access 97 SR2 on win XP and keep getting the Sub or Function not defined error message. The code for the function is in a module called mod_Public and is as follows. Function...
0
by: alan | last post by:
Dear all, I'm trying to do a data binding for a ListView and I rewrite the code from some example but there is a error while I execute. Can anybody tell me what's wrong with it?? Thank you!! ...
6
by: Ecohouse | last post by:
I have a field in a recordset which is a string. It can look like this: 13-15-67-56 I need to break out this string into numbers to run in queries to open recordsets. But when I try to open...
1
by: bagya | last post by:
please help me out the following is the small code i have <html> <head> <script type="text/javascript"> function validate() { if (document.abc.region.value==0)
8
by: ipy2006 | last post by:
In my HTML I have, <input type="button" class="cartonsumkey" value="Sum Cartons" onclick="sumup(this);" /> In an external file that is called in Head area, I have, function sumup( o ) { ...
1
by: dereski | last post by:
Hey all, I am trying to connect to my database but I am getting error "80004005 Could Not Find File" Any Ideas as to why? I tried recreating the database again, just in case it was corrupted...
10
by: joestevens232 | last post by:
Ok everything is good...I read in all my grades into each of the different arrays that they need to go in. Now Im trying to write a function that takes the grades and computes the average on a...
1
by: kigoobe | last post by:
Hi friends, I'm having three queries that works perfectly ... SELECT ib.id as id, ib.titre as title, ib.date_expire as date_fin, ib.created_at as date_creation, eb.content as content, '' FROM...
21
vikas251074
by: vikas251074 | last post by:
I am getting error while entry in userid field. When user enter his user id, an event is fired immediately and user id is verified using AJAX method. But I am getting error 'Object doesn't support...
1
by: mohit1286 | last post by:
my stored procedure in db2 is---> create procedure temp_bill(in UPC_cd character(6)) language sql begin declare prod_cd character(8);declare prod_desc varchar(30);declare discount...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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.