This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

to create dynamic procedures

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.
 
Rototillers convert rich soil into dirt. Please note that this tiny ad is not a rototiller:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic