BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Obtaining result from a storred procedure (D6e, MSSQL, ado)

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
DA Brookes
Guest





PostPosted: Wed Jul 21, 2004 2:57 pm    Post subject: Obtaining result from a storred procedure (D6e, MSSQL, ado) Reply with quote



Hi appologies for the long post.

I have the following stored procedure

CREATE PROCEDURE wc_name

@con_ref varchar(10),
@group_no varchar(3),
@wc_no varchar(6)
as
set nocount on

select d10, wc_desc, scope from dbo.wclist
where con_ref = @con_ref and group_no = @group_no and wc_no = @wc_no
GO
----------------------------------------------------
How do I obtain a result for "wc_desc" from the above..?

I have tried adding a parameter for output, but the best I can get is zero,
when there is a company name displayed when I try the same input in the
MS-SQL debugger.

with adostoredproc1 do
begin
label63.caption := label9.caption + label56.Caption;
parameters[1].Value := 'NB-75020'
parameters[2].Value := '001'
parameters[3].Value := 'B04';
execproc;
label62.caption := adostoredproc1wc_desc.value;
end;

Anyone have any ideas / examples ?
Regards
Dave


Back to top
Kevin Frevert
Guest





PostPosted: Wed Jul 21, 2004 3:10 pm    Post subject: Re: Obtaining result from a storred procedure (D6e, MSSQL, a Reply with quote



"DA Brookes" <david_dot_brookes_at_interserveprojects.com> wrote

Quote:

with adostoredproc1 do
begin
label63.caption := label9.caption + label56.Caption;
parameters[1].Value := 'NB-75020'
parameters[2].Value := '001'
parameters[3].Value := 'B04';
execproc;
label62.caption := adostoredproc1wc_desc.value;
end;

Anyone have any ideas / examples ?
Regards
Dave

Dave,

Use the Open method instead of ExecProc.

Good luck,
krf



Back to top
DA Brookes
Guest





PostPosted: Thu Jul 22, 2004 7:21 am    Post subject: Re: Obtaining result from a storred procedure (D6e, MSSQL, a Reply with quote



Thanks Kevin!
Regards
Dave


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.