UNIDAC and stored procedures

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
pimentel_flores
Posts: 31
Joined: Wed 15 Aug 2007 16:30
Location: mexico

UNIDAC and stored procedures

Post by pimentel_flores » Thu 11 Jun 2009 06:04

Hi Devart Team.
i have been thinking in how to make my application truly database independent over the dbms that already unidac support.
i have read the info about the unified sql structure and macros, but here is my question.
What about the stored procedure (and also functions and triggers etc..)?
as you know the stored procedures sintaxis between the dbms are different, does the unidac provides a common sintaxis to parse over the distinct data bases? i mean like the {fn } {oj } {if } {else} functions that arleady exists?
maybe something like

Code: Select all

{fn create procedure} spDemo {inv vID varchar(10)},{inv vMov varchar(100
{sp begin}
{declare vResult varchar(100)}

{set vResult} = select xresutl from demot where id = {vid} and mov= {vmov}

{sp end}

and when parsing to mysql could be like

Code: Select all

create procedure spDemo (vID varchar(10),vmov varchar(100))
begin
declare vResult varchar(100);
set vResult = select xresutl from demot where id = vid and mov= vmov
end/
And when parsing to SQL Server

Code: Select all

Create procedure spDemo 
@vID varchar(10),
@vmov Varchar(100).
As 
Begin
declare @vResult varchar(100),

select @vResult = xresutl from demot where id = @vid and mov= @vmov

end
GO
and so on with the other dbms

i hope to be clear,
Please suggest

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Fri 12 Jun 2009 06:38

We will consider your suggestion.

Post Reply