Avatar of fadyg
fadyg

asked on 

Delphi UDFs DLL using MsSql 2000

Hello,  

I have been using Interbase 6.0 with Delphi 6.0.  I used to build DLLs out of my functions to be used in Interbase SQL commands.  Those UDFs are basically string functions.  Recently I migrated to MsSql server (client request).  All those UDFs are returning strange integer results instead of strings.  I have tried replacing the string type definitions by PChars,  but I still get the same result. Any opinion ?
Delphi

Avatar of undefined
Last Comment
modulo
Avatar of fadyg
fadyg

ASKER

forgot to mention:
- using Delphi 6 and MSSQL 2000
Avatar of kretzschmar
kretzschmar
Flag of Germany image

hmm,
udf are as my point of knowledge a properitary addon for interbase,
for mssql you would this udfs recode into database Functions/procedures

meikl ;-)
Avatar of fadyg
fadyg

ASKER

You can register DLLs in MSSql server.  And those function become available to use in SQL statements.  The only weird thing is that returned values are erratic.
Avatar of kretzschmar
kretzschmar
Flag of Germany image

hmm,

i don't have mssql, but i would guess a change from cdecl to ... (not in mind yet)
could maybe then solve this

meikl ;-)
Avatar of fadyg
fadyg

ASKER

Already tried both: with and without cdecl.  Both give same wrong result.

What is this other command (instead of cdecl) that you're talking about ?

Fady
Avatar of kretzschmar
kretzschmar
Flag of Germany image

well, recherched a bit

Cdecl/stdcall/safecall

are the calling conventions, where is defined how the values are tranfered (in and out)

try stdcall

meikl ;-)
Avatar of fadyg
fadyg

ASKER

Sorry for being late answering this,

I tried the three of them... no luck.

However I came across the following tutorial:

Writing MS SQL Server Extended Stored Procedures with Delphi http://www.berenddeboer.net/article/1293/1293.html

I've tried it and preliminary tests show that it is working fine .

thanks
Fady
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Delphi
Delphi

Delphi is the most powerful Object Pascal IDE and component library for cross-platform Native App Development with flexible Cloud services and broad IoT connectivity. It provides powerful VCL controls for Windows 10 and enables FMX development for Windows, Mac and Mobile. Delphi is your choice for ultrafast Enterprise Strong Development™. Look for increased memory for large projects, extended multi-monitor support, improved Object Inspector and much more. Delphi is 5x faster for development and deployment across multiple desktop, mobile, cloud and database platforms including 32-bit and 64-bit Windows 10.

60K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo