aspose file tools*
The moose likes JDBC and the fly likes to create dynamic procedures Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "to create dynamic procedures" Watch "to create dynamic procedures" New topic
Author

to create dynamic procedures

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
In the company in that work, a component was created in delphi 7 that creates dynamic procedures in any database type, but as it uses BDE and this has limitation. I am migrating for java and I already get to create procedures,
but when the procedure has comments happens the syntax mistake in the reading of the string of the procedure.

EX1: right procedure (MSSqlServer)
----------------------------------------------------------

create procedure spte0001
the
begin
select job_id, job_desc from jobs order by job_id
end
go

EX2: wrong procedure (MSSqlServer)
----------------------------------------------------------
create procedure spte0001
the
begin
--simple test de comentario
select job_id, job_desc from jobs order by job_id
end
go

How can I solve this problem?
Yu Tao
Greenhorn

Joined: Dec 12, 2004
Posts: 28
Mabe you try like this

create procedure test1
...........
create procedure test2
...........
create procedure control
@varchar(10) str;
begin
if(str='right code'){
call test1;
}else{
call test2;
}
END
go

do you understand???
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1129

Sergio,

a component ... that creates dynamic procedures in any database type

Wow, you mean it can create stored procedures for all these databases:
Informix
PostgreSQL
MySQL
SQL Server
Oracle
Sybase
(and all the other databases -- that support stored procedures -- that aren't in the above list?)
I'm impressed. But I'm also curious as to how you accomplish that, since each database has its own proprietary syntax for writing stored procedures -- which already seems to be giving you problems when it comes to writing comments.

Good Luck,
Avi.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: to create dynamic procedures