Welcome! Log In Create A New Profile

Advanced

Webdev and MS SQL stored procedure

Posted by Peter Zhou 
Peter Zhou
Webdev and MS SQL stored procedure
October 12, 2018 05:26PM
Hi,

How easy it is to implement webdev and the interaction with the DB via MS SQL stored procedure?

I have no experience in running MS SQL stored procedure.

Regards,

Peter zhou
pao
Re: Webdev and MS SQL stored procedure
October 12, 2018 05:48PM
If you use the native access you can see some samples of the use of stored procedures in MSSQL in this help page [doc.windev.com]

Regards

Paulo Oliveira
Peter Zhou
Re: Webdev and MS SQL stored procedure
October 30, 2018 05:15AM
Hi,

Is it possible to execute ms sql stored procedures without the native driver from windev/webdev (using ole db) ?

Regards,

Peter Zhou
Re: Webdev and MS SQL stored procedure
October 30, 2018 09:42AM
Peter

try something like this where I run a procedure called SP_Journal with 3 parameters. I'm not sure how to retrieve a value from that procedure.

ds1 is Data Source
sSQL is string
bResult is boolean

sSQL = StringBuild("EXEC " + "SP_Journal %1, %2, %3 ", "Test1",123,2)
bResult = HExecuteSQLQuery(ds1,gctYourConnection,hQueryWithoutCorrection,sSQL)

Arie
Peter Zhou
Re: Webdev and MS SQL stored procedure
November 01, 2018 02:38PM
ArieM Wrote:
-------------------------------------------------------
> Peter
>
> try something like this where I run a procedure
> called SP_Journal with 3 parameters. I'm not sure
> how to retrieve a value from that procedure.
>
> ds1 is Data Source
> sSQL is string
> bResult is boolean
>
> sSQL = StringBuild("EXEC " + "SP_Journal %1, %2,
> %3 ", "Test1",123,2)
> bResult =
> HExecuteSQLQuery(ds1,gctYourConnection,hQueryWithoutCorrection,sSQL)

Hi Arie,

Thank you for the sample code, I got it working.
Peter Zhou
Re: Webdev and MS SQL stored procedure
November 14, 2018 10:09AM
Hi,

How to execute insert stored procedure with the following in windev

INSERT_ITEM @CODE, @ITEMNAME

ds1 is date source
sSQL is string = stringbuild("EXEC INSERT_ITEM %1, %2", "ABC","Item ABC")

HexecuteSQLQuery(ds1, "MyConnection",hQueryWithoutCorrection, sSQL)


Returns OLE DB access error 170129
Re: Webdev and MS SQL stored procedure
November 14, 2018 01:06PM
Peter,

I think you need single quotes around ABC and Item ABC

Otherwise the statement is interpreted wrong resulting in an error.

Arie
PETER ZHOU
Re: Webdev and MS SQL stored procedure
November 14, 2018 03:32PM
ArieM Wrote:
-------------------------------------------------------
> Peter,
>
> I think you need single quotes around ABC and Item
> ABC
>
> Otherwise the statement is interpreted wrong
> resulting in an error.

Hi Arie,

ds1 is data source
sSQL is string = stringbuild("EXEC INSERT_ITEM %1, %2", " 'ABC' "," 'Item ABC' ")
HexecuteSQLQuery(ds1, "MyConnection",hQueryWithoutCorrection, sSQL)


With the single quotes around 'ABC' and 'Item ABC' , it still return same error code.


Regards,

PETER ZHOU
pao
Re: Webdev and MS SQL stored procedure
November 14, 2018 06:24PM
Did you try with:

sSQL is string = stringbuild("EXEC INSERT_ITEM @CODE=%1, @ITEMNAME =%2", "ABC","Item ABC")

Regards

Paulo Oliveira
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: