Page 1 of 1

UNIDAC and stored procedures

Posted: Thu 11 Jun 2009 06:04
by pimentel_flores
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

Posted: Fri 12 Jun 2009 06:38
by Plash
We will consider your suggestion.