Encerrado

Perl MySQL Stored Procedures generator

Write a Perl script that will pass a variable to a series of templates and create MySQL Stored Procedures from the templates.

## Deliverables

Inputs: a variable table name and location of the templates will be given as a command line arguments to the script.

Ex:

> [url removed, login to view] table_name /path/to/templates

Every file with specific extension /path/to/templates will be parsed as a template. One MySQL SP will be created from each template each time the script is called.

Sample template:

CREATE DEFINER=`root`@`localhost` FUNCTION `proc_$variable`() RETURNS int(11)

BEGIN

DECLARE raw_info CURSOR FOR SELECT email FROM table_$variable;

DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' BEGIN END;

OPEN raw_info;

main: LOOP

<do something>

END LOOP main;

CLOSE raw_info;

RETURN SELECT count(*) FROM table_$variable;

END

Assuming sample template in /opt/templates and script called like this:

> [url removed, login to view] 55 /opt/templates

Script will read templates and create the following SP in the MySQL DB:

CREATE DEFINER=`root`@`localhost` FUNCTION `proc_55`() RETURNS int(11)

BEGIN

DECLARE raw_info CURSOR FOR SELECT email FROM table_55;

DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' BEGIN END;

OPEN raw_info;

main: LOOP

<do something>

END LOOP main;

CLOSE raw_info;

RETURN SELECT count(*) FROM table_55;

END

Habilidades: Engenharia, Linux, MySQL, Perl, PHP, Arquitetura de software, Teste de Software, UNIX

Ver mais: return path, stored, stored procedures, Procedures, sample generator, sample perl, php table generator, mysql specific, perl sample, mysql time series, php loop command, read file specific line, mysql create table table template, mysql create table template, table perl, perl table, variable mysql, loop table, write php extension, email count read script, php pass path variable, loop table php, perl template, count templates, php template generator

Acerca do Empregador:
( 3 comentários ) Santa Monica, United States

ID do Projeto: #3065649

5 freelancers are bidding on average $52 for this job

b0tivw

See private message.

$80.75 USD in 14 dias
(17 Comentários)
5.1
spx2vw

See private message.

$85 USD in 14 dias
(38 Comentários)
4.7
myvisl

See private message.

$11.05 USD in 14 dias
(71 Comentários)
4.6
exspritesvw

See private message.

$42.5 USD in 14 dias
(17 Comentários)
4.2
bydevteam

See private message.

$42.5 USD in 14 dias
(0 Comentários)
0.0