<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>29 Oct 2015 06:58:00 Z</lastBuildDate><pubDate>27 Oct 2015 19:42:00 Z</pubDate><description>Hi all,&#13;
I have a very simple stored procedure like this one:&#13;
CREATE PROCEDURE MyProc ( -- Add the parameters for the stored procedure here @p1 int, @p2 int, @res int output ) AS BEGIN SET NOCOUNT ON; SET @res = @p1 + @p2 END GO&#13;
&#13;
In SQL we can call it in this way:&#13;
Declare @Result INT; EXEC MyProc @p1 = 5, @p2 = 4, @Res = @Result OUTPUT;SELECT @Result&#13;
And the result is, of course, 9.&#13;
Now I'm trying the same with WD20, keep in mind that I have no analysis, just a connection to SQL (native access). The only way to get this running is using this:&#13;
dsQuery is Data Source sQuery is string = "Declare @@Result INT; " + ... "EXEC MyProc " + EDT_Param1 + ", " + EDT_Param2 + ", @@Result OUTPUT ;" + ... "SELECT @@Result " IF HExecuteSQLQuery(dsQuery, gctMyConnection, hQueryWithoutCorrection, sQuery) THEN HReadFirst(dsQuery) Info(HRetrieveRecord(dsQuery)) ELSE Error(HErrorInfo(hErrFullDetails)) Trace(sQuery) END&#13;
But I want to send the parameters of the stored procedure, I mean @p1 and @p2, like this:&#13;
sQuery is string = "Declare @@Result INT; " + ... "EXEC MyProc @p1 = " + EDT_Param1 + ", @p2 = " + EDT_Param2 + ", @res = @@Result OUTPUT ;" + ... "SELECT @@Result "&#13;
However this does not work and I'm getting an error. (http://screencast.com/t/R2kUfT77). Is there a way to get this working?&#13;
Thanks in advance.&#13;
&#13;
Mauricio</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output/read.awp</link><title>[WD 20] MS SQL: call a stored procedure with OUTPUT</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54705/read.awp</comments><pubDate>29 Oct 2015 06:58:00 Z</pubDate><description>@Jorge, my sp was just an example. There are already several sp that I cannot change because the current system is working. I ju…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54705/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54705/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output/read.awp">[WD 20] MS SQL: call a stored procedure with OUTPUT</source><title>Re: [WD 20] MS SQL: call a stored procedure with OUTPUT</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54702/read.awp</comments><pubDate>29 Oct 2015 03:26:00 Z</pubDate><description>m_conn is Connection&#13;
m_conn..Provider = hOledbSQLServer&#13;
m_conn..Server = "192.168.1.1"&#13;
m_conn..Database = "mydb"&#13;
m_conn..Use…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54702/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54702/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output/read.awp">[WD 20] MS SQL: call a stored procedure with OUTPUT</source><title>Re: [WD 20] MS SQL: call a stored procedure with OUTPUT</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54701/read.awp</comments><pubDate>29 Oct 2015 01:53:00 Z</pubDate><description>Hi Mauricio,&#13;
&#13;
I work for several years with WD + MS SQL and OLEDB connection.&#13;
&#13;
Never I used "output" in store procedure.&#13;
&#13;
…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54701/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54701/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output/read.awp">[WD 20] MS SQL: call a stored procedure with OUTPUT</source><title>Re: [WD 20] MS SQL: call a stored procedure with OUTPUT</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54699/read.awp</comments><pubDate>28 Oct 2015 19:30:00 Z</pubDate><description>@Paulo, you're right. I was calling the sp like this:&#13;
"MyProc" (taken from example) and it has to be like this: "MyProc @p1, @p…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54699/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54699/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output/read.awp">[WD 20] MS SQL: call a stored procedure with OUTPUT</source><title>Re: [WD 20] MS SQL: call a stored procedure with OUTPUT</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54697/read.awp</comments><pubDate>28 Oct 2015 19:07:00 Z</pubDate><description>Maurico,&#13;
As i told you before i only have WD18, i can't open your project (WD20).&#13;
&#13;
My code in WD18 &amp; MSSQL 2005 to run your p…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54697/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54697/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output/read.awp">[WD 20] MS SQL: call a stored procedure with OUTPUT</source><title>Re: [WD 20] MS SQL: call a stored procedure with OUTPUT</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54695/read.awp</comments><pubDate>28 Oct 2015 18:20:00 Z</pubDate><description>@kingdr, thanks for your suggestion but that's not the point. I know that the sp can be replace by a function in this case but t…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54695/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54695/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output/read.awp">[WD 20] MS SQL: call a stored procedure with OUTPUT</source><title>Re: [WD 20] MS SQL: call a stored procedure with OUTPUT</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54694/read.awp</comments><pubDate>28 Oct 2015 18:17:00 Z</pubDate><description>@Paulo, it doesn't work. If you want to try, here you can download the project:&#13;
https://www.dropbox.com/s/xuzp8rpwt592rje/Store…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54694/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54694/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output/read.awp">[WD 20] MS SQL: call a stored procedure with OUTPUT</source><title>Re: [WD 20] MS SQL: call a stored procedure with OUTPUT</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54688/read.awp</comments><pubDate>28 Oct 2015 13:08:00 Z</pubDate><description>Try this:&#13;
&#13;
CREATE FUNCTION add2int&#13;
(&#13;
@p1 int,&#13;
@p2 int&#13;
)&#13;
returns int&#13;
AS&#13;
BEGIN&#13;
return @p1 + @p2&#13;
END&#13;
GO&#13;
&#13;
// just by u…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54688/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54688/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output/read.awp">[WD 20] MS SQL: call a stored procedure with OUTPUT</source><title>Re: [WD 20] MS SQL: call a stored procedure with OUTPUT</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54686/read.awp</comments><pubDate>28 Oct 2015 10:51:00 Z</pubDate><description>No, I don't have any stored procedure in my analysis and it works.&#13;
&#13;
I'm using it in WD18 andWB18 with DB-Library, i never used…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54686/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54686/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output/read.awp">[WD 20] MS SQL: call a stored procedure with OUTPUT</source><title>Re: [WD 20] MS SQL: call a stored procedure with OUTPUT</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54685/read.awp</comments><pubDate>28 Oct 2015 10:40:00 Z</pubDate><description>Hi Paulo,&#13;
I've already tried that and it didn't work. I guess that case is when you have your stored procedure defined in your …</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54685/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54685/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output/read.awp">[WD 20] MS SQL: call a stored procedure with OUTPUT</source><title>Re: [WD 20] MS SQL: call a stored procedure with OUTPUT</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54683/read.awp</comments><pubDate>28 Oct 2015 10:15:00 Z</pubDate><description>Mauricio, check this help page http://doc.windev.com/en-US/?5515009</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54683/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output-54683/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/54670-20-sql-call-stored-procedure-with-output/read.awp">[WD 20] MS SQL: call a stored procedure with OUTPUT</source><title>Re: [WD 20] MS SQL: call a stored procedure with OUTPUT</title></item></channel></rss>
