PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Accessing SQL Server functions
Accessing SQL Server functions
Iniciado por guest, 26,may. 2015 15:54 - 2 respuestas
Publicado el 26,mayo 2015 - 15:54
Hello, Is there any options to use stored function of SQL Server in webdev? I am accessing a database that is in SQL Server and now I need to access it's functions. Can anyone help me please?
Best regards,
Kozeta Leka?
Publicado el 26,mayo 2015 - 17:14
I don't know exactly what you want to do but for instance with some system function you can get their values using one select (don't forget to use the hQueryWithoutCorrection constant) like:
select @@version
select app_name()

you can use them in some stored procedure and execute the SP
http://doc.windev.com/en-US/…
Publicado el 26,mayo 2015 - 20:12
Hi

Here is an example that I wrote in 2013 of a sqlServer function
that can call from windev/webdev.

//simply just use wdSql.exe from windev program to test out eg as below:

SELECT dbo.pad('123',6) or
SELECT dbo.pad(123,6)
// returns 000123


alter function pad
(
@sValue varchar(64),
@nLen int
)
returns varchar(64)
as
begin
declare @sPADDED varchar(64)
SET @sPADDED = replicate('0', @nLen-LEN(cast(@sValue as varchar))) + CAST(@sValue AS VARCHAR)
return @sPADDED
end

HTH

Cheers

King