Stored Procedure using another Stored Procedure 
Author Message
 Stored Procedure using another Stored Procedure

I have a UNION query (SP) and I want to use this as a
basis for another stored procedure to group the results.

It comes up with the following error:
Server: Msg 208, Level 16, State 3, Procedure
qryInShiftTimes, Line 2
Invalid object name 'qryfoinshifttime'.

Why is this? the query qryfoinshifttime does exist and
works ok.

Thanks

Alison

I have the following:

CREATE PROCEDURE qryInShiftTimes AS
SELECT Sum(qryfoinshifttime.inshifttime) AS
SumOfinshifttime, qryfoinshifttime.qryDates.InDT,
qryfoinshifttime.qryDates.OutDT, qryfoinshifttime.LogNo,
qryfoinshifttime.JobNo, qryfoinshifttime.PrimaryFault,
qryfoinshifttime.SecondaryFault,
qryfoinshifttime.PrimaryFault2,
qryfoinshifttime.SecondaryFault2,
qryfoinshifttime.PrimaryFault3,
qryfoinshifttime.SecondaryFault3,
qryfoinshifttime.QCStampNo, qryfoinshifttime.DateIn,
qryfoinshifttime.TimeIn, qryfoinshifttime.DateOut,
qryfoinshifttime.TimeOut, qryfoinshifttime.MachineNo,
qryfoinshifttime.CellID, qryfoinshifttime.OpSeq,
qryfoinshifttime.Comments, qryfoinshifttime.PartNo,
qryfoinshifttime.Customer, qryfoinshifttime.Passed,
qryfoinshifttime.LastUpdated, qryfoinshifttime.ShiftType,
qryfoinshifttime.qryDates.InDT,
qryfoinshifttime.qryDates.OutDT
FROM qryfoinshifttime
GROUP BY qryfoinshifttime.qryDates.InDT,
qryfoinshifttime.qryDates.OutDT, qryfoinshifttime.LogNo,
qryfoinshifttime.JobNo, qryfoinshifttime.PrimaryFault,
qryfoinshifttime.SecondaryFault,
qryfoinshifttime.PrimaryFault2,
qryfoinshifttime.SecondaryFault2,
qryfoinshifttime.PrimaryFault3,
qryfoinshifttime.SecondaryFault3,
qryfoinshifttime.QCStampNo, qryfoinshifttime.DateIn,
qryfoinshifttime.TimeIn, qryfoinshifttime.DateOut,
qryfoinshifttime.TimeOut, qryfoinshifttime.MachineNo,
qryfoinshifttime.CellID, qryfoinshifttime.OpSeq,
qryfoinshifttime.Comments, qryfoinshifttime.PartNo,
qryfoinshifttime.Customer, qryfoinshifttime.Passed,
qryfoinshifttime.LastUpdated, qryfoinshifttime.ShiftType,
qryfoinshifttime.qryDates.InDT,
qryfoinshifttime.qryDates.OutDT;
GO



Sun, 21 Aug 2005 01:10:02 GMT
 Stored Procedure using another Stored Procedure

Perhaps an object owner issue?

--
Tibor Karaszi, SQL Server MVP
For help on TSQL, please provide code we can execute in Query Analyzer

Quote:

> I have a UNION query (SP) and I want to use this as a
> basis for another stored procedure to group the results.

> It comes up with the following error:
> Server: Msg 208, Level 16, State 3, Procedure
> qryInShiftTimes, Line 2
> Invalid object name 'qryfoinshifttime'.

> Why is this? the query qryfoinshifttime does exist and
> works ok.

> Thanks

> Alison

> I have the following:

> CREATE PROCEDURE qryInShiftTimes AS
> SELECT Sum(qryfoinshifttime.inshifttime) AS
> SumOfinshifttime, qryfoinshifttime.qryDates.InDT,
> qryfoinshifttime.qryDates.OutDT, qryfoinshifttime.LogNo,
> qryfoinshifttime.JobNo, qryfoinshifttime.PrimaryFault,
> qryfoinshifttime.SecondaryFault,
> qryfoinshifttime.PrimaryFault2,
> qryfoinshifttime.SecondaryFault2,
> qryfoinshifttime.PrimaryFault3,
> qryfoinshifttime.SecondaryFault3,
> qryfoinshifttime.QCStampNo, qryfoinshifttime.DateIn,
> qryfoinshifttime.TimeIn, qryfoinshifttime.DateOut,
> qryfoinshifttime.TimeOut, qryfoinshifttime.MachineNo,
> qryfoinshifttime.CellID, qryfoinshifttime.OpSeq,
> qryfoinshifttime.Comments, qryfoinshifttime.PartNo,
> qryfoinshifttime.Customer, qryfoinshifttime.Passed,
> qryfoinshifttime.LastUpdated, qryfoinshifttime.ShiftType,
> qryfoinshifttime.qryDates.InDT,
> qryfoinshifttime.qryDates.OutDT
> FROM qryfoinshifttime
> GROUP BY qryfoinshifttime.qryDates.InDT,
> qryfoinshifttime.qryDates.OutDT, qryfoinshifttime.LogNo,
> qryfoinshifttime.JobNo, qryfoinshifttime.PrimaryFault,
> qryfoinshifttime.SecondaryFault,
> qryfoinshifttime.PrimaryFault2,
> qryfoinshifttime.SecondaryFault2,
> qryfoinshifttime.PrimaryFault3,
> qryfoinshifttime.SecondaryFault3,
> qryfoinshifttime.QCStampNo, qryfoinshifttime.DateIn,
> qryfoinshifttime.TimeIn, qryfoinshifttime.DateOut,
> qryfoinshifttime.TimeOut, qryfoinshifttime.MachineNo,
> qryfoinshifttime.CellID, qryfoinshifttime.OpSeq,
> qryfoinshifttime.Comments, qryfoinshifttime.PartNo,
> qryfoinshifttime.Customer, qryfoinshifttime.Passed,
> qryfoinshifttime.LastUpdated, qryfoinshifttime.ShiftType,
> qryfoinshifttime.qryDates.InDT,
> qryfoinshifttime.qryDates.OutDT;
> GO



Mon, 22 Aug 2005 06:12:28 GMT
 Stored Procedure using another Stored Procedure
SInce this procedure is unparameterized and is only doing a single select,
why don't you make it a view instead?

How are you calling this procedure inside the other procedure? Are you using
the word EXECUTE to call it?

--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com


Quote:
> I have a UNION query (SP) and I want to use this as a
> basis for another stored procedure to group the results.

> It comes up with the following error:
> Server: Msg 208, Level 16, State 3, Procedure
> qryInShiftTimes, Line 2
> Invalid object name 'qryfoinshifttime'.

> Why is this? the query qryfoinshifttime does exist and
> works ok.

> Thanks

> Alison

> I have the following:

> CREATE PROCEDURE qryInShiftTimes AS
> SELECT Sum(qryfoinshifttime.inshifttime) AS
> SumOfinshifttime, qryfoinshifttime.qryDates.InDT,
> qryfoinshifttime.qryDates.OutDT, qryfoinshifttime.LogNo,
> qryfoinshifttime.JobNo, qryfoinshifttime.PrimaryFault,
> qryfoinshifttime.SecondaryFault,
> qryfoinshifttime.PrimaryFault2,
> qryfoinshifttime.SecondaryFault2,
> qryfoinshifttime.PrimaryFault3,
> qryfoinshifttime.SecondaryFault3,
> qryfoinshifttime.QCStampNo, qryfoinshifttime.DateIn,
> qryfoinshifttime.TimeIn, qryfoinshifttime.DateOut,
> qryfoinshifttime.TimeOut, qryfoinshifttime.MachineNo,
> qryfoinshifttime.CellID, qryfoinshifttime.OpSeq,
> qryfoinshifttime.Comments, qryfoinshifttime.PartNo,
> qryfoinshifttime.Customer, qryfoinshifttime.Passed,
> qryfoinshifttime.LastUpdated, qryfoinshifttime.ShiftType,
> qryfoinshifttime.qryDates.InDT,
> qryfoinshifttime.qryDates.OutDT
> FROM qryfoinshifttime
> GROUP BY qryfoinshifttime.qryDates.InDT,
> qryfoinshifttime.qryDates.OutDT, qryfoinshifttime.LogNo,
> qryfoinshifttime.JobNo, qryfoinshifttime.PrimaryFault,
> qryfoinshifttime.SecondaryFault,
> qryfoinshifttime.PrimaryFault2,
> qryfoinshifttime.SecondaryFault2,
> qryfoinshifttime.PrimaryFault3,
> qryfoinshifttime.SecondaryFault3,
> qryfoinshifttime.QCStampNo, qryfoinshifttime.DateIn,
> qryfoinshifttime.TimeIn, qryfoinshifttime.DateOut,
> qryfoinshifttime.TimeOut, qryfoinshifttime.MachineNo,
> qryfoinshifttime.CellID, qryfoinshifttime.OpSeq,
> qryfoinshifttime.Comments, qryfoinshifttime.PartNo,
> qryfoinshifttime.Customer, qryfoinshifttime.Passed,
> qryfoinshifttime.LastUpdated, qryfoinshifttime.ShiftType,
> qryfoinshifttime.qryDates.InDT,
> qryfoinshifttime.qryDates.OutDT;
> GO



Tue, 23 Aug 2005 01:48:05 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. using SQL stored procedure results in stored procedure

2. Using Resultset in Stored Procedure in another stored procedure

3. Using Stored Procedure's results in a Stored Procedure

4. Using the result from one stored procedure in a second stored procedure

5. Using Results Of Stored Procedure As Input Into Another Stored Procedure

6. Using stored procedures within stored procedures

7. Stored procedures problem using DB2 Stored Procedure Builder

8. Calling a Java Stored Procedure from another Java Stored Stored Procedure

9. Stored Procedure calling Stored Procedure

10. Executing a Stored Procedure in a Stored Procedure and selecting on the result

11. Call a stored procedure from another stored procedure

12. Calling a stored procedure with parameters from another stored procedure


 
Powered by phpBB® Forum Software