• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

to create dynamic procedures

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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???
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic