|
| MSSQL or Oracle stores procedures |
| Iniciado por guest, 06,oct. 2015 16:07 - 2 respuestas |
| |
| | | |
|
| |
| Publicado el 06,octubre 2015 - 16:07 |
Hi,
Is webdev capable of running existing stored procedures in MSSQL or Oracle ?
Regards,
Peter Zhou |
| |
| |
| | | |
|
| | |
| |
| Publicado el 06,octubre 2015 - 17:44 |
| |
| |
| | | |
|
| | |
| |
| Publicado el 08,octubre 2015 - 13:19 |
Hi Peter,
With WinDev or WebDev you do not need Native SQL Server Access to run MSSQL store procedures or queries.
To connect your database, you must use SQLConnect() function with OLEDB parameter.
http://doc.windev.com/…<=en-US&productversion=01A190056s
IF SQLConnect(server name or IP addres, user, password, database, "OLEDB", hOledbSQLServer,"Trusted_Connection=NO")=False THEN SQLInfo() Error("Error in connection with database " + CR + ... "Error code: " + SQL.Error + CR + SQL.MesError) EndProgram() END
Do not missing SQLDisconnect() in Closing project event code.
If you have this store procedure:
CREATE PROCEDURE dbo.Client_List AS SET NOCOUNT ON
SELECT LastName, FirstName FROM Customer ORDER BY LastName, FirstName
Use T-SQL "EXEC" command in SQLExec() function and read query with SQLFetch() and SQLGetCol()
s_CmdSQL, s_ErrorMessage are string s_LastName, s_FirstName are string s_CmdSQL = "EXEC dbo.Client_List" IF SQLExec(s_CmdSql,"dsSQL")=False THEN SQLInfo("dsSQL") s_ErrorMessage = SQL.MesError SQLClose("dsSQL") Error("SQL error: " + s_ErrorMessage ) RETURN END WHILE SQLFetch("dsSQL") = 0 s_LastName = SQLGetCol("dsSQL",1) s_FirstName = SQLGetCol("dsSQL",2) END SQLClose("dsSQL")
Regards JJM |
| |
| |
| | | |
|
| | | | |
| | |
|