[Postfix-br] RES: RES: Melhor forma de instalação Postfix em Centos 6.2 e randomizando saída de IPs

Ramon Gadelha ramongadelha em gmail.com
Sexta Setembro 28 15:29:06 BRT 2012


Segue,

Banco e tabelas:

*CREATE DATABASE `postfix`;*

*CREATE TABLE `current` (
`transportId` int(10) DEFAULT NULL
) ENGINE=MyISAM;*

CREATE TABLE `transports` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`transport` varchar(50) NOT NULL DEFAULT ’0′,
PRIMARY KEY (`id`)
) ENGINE=MyISAM;


Procedure:


*CREATE FUNCTION `f_transport`() RETURNS varchar(50) CHARSET latin1
BEGIN
DECLARE current_transport INT(11);
DECLARE count_transport INT(11);
DECLARE result varchar(50);*

*SELECT * INTO @current_transport FROM current;
SELECT count(*) INTO @count_transport FROM transports;*

*IF @current_transport < @count_transport THEN
SELECT @current_transport + 1 INTO @current_transport;
ELSE
SET @current_transport = 1;
END IF;*

*UPDATE current SET transportId = @current_transport;*

SELECT transports.transport INTO @result
FROM transports,current
WHERE transports.id=current.transportId
AND transports.id = @current_transport;

*RETURN @result;*

*END*


Mais detalhes:
http://rgadelha.wordpress.com/2011/10/13/postfix-balanceando-carga-de-e-mails-de-saida-entre-varios-links/

Infelizmente não posso dar muita atenção no momento porque estou no
trabalho.

Em 28 de setembro de 2012 15:24, Bruno Menoli <brunomenoli at gmail.com>escreveu:

>  Opa,
>
> O próprio está aqui!! rs tem como me enviar a SQL completa? Alguem tem
> para me enviar? Obrigado
>
>
>
>
> On 09/28/2012 03:20 PM, Ramon Gadelha wrote:
>
> Olá, o problema está nas aspas, que no wordpress viram "abre aspas e fecha
> aspas" ao invés de apenas "aspas" :), esse é o problema de sintaxe.
>
>  Algumas pessoas encontram problemas ao criar a procedure também, o que
> eu recomendo é modificar os delimitadores antes e depois da procedure,
> exemplo:
>
>  DELIMITER $$
>
>  CREATE STORED FUNCTION....
>
>  $$
>
>
>
> Em 28 de setembro de 2012 15:08, V. Feitoza <vfeitoza at gmail.com> escreveu:
>
>> Boa tarde,
>>
>> Também pode executar sem as aspas.
>> Elas são apenas para quando se utiliza nomes internos do mysql, tipo
>> uma prevenção contra as variáveis internas do mysql.
>>
>> Virtual Word - O mundo ao seu alcance.
>> Victor Feitoza
>> Gerente de TI
>>  _______________________________________________
>> Postfix-br mailing list
>> Postfix-br at listas.softwarelivre.org
>> http://listas.softwarelivre.org/cgi-bin/mailman/listinfo/postfix-br
>>
>
>
>
>  --
>
> ------------------------------------------
> Ramon Gadelha C. Marques
>
> LPIC-3, NCLA, NDCTS,
> VSP, VTSP, TFC, TCSP
>
> +55 85 9609 1474
>
>
>
> _______________________________________________
> Postfix-br mailing listPostfix-br at listas.softwarelivre.orghttp://listas.softwarelivre.org/cgi-bin/mailman/listinfo/postfix-br
>
>
>
> _______________________________________________
> Postfix-br mailing list
> Postfix-br at listas.softwarelivre.org
> http://listas.softwarelivre.org/cgi-bin/mailman/listinfo/postfix-br
>
>


-- 

------------------------------------------
Ramon Gadelha C. Marques

LPIC-3, NCLA, NDCTS,
VSP, VTSP, TFC, TCSP

+55 85 9609 1474
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/postfix-br/attachments/20120928/cf834650/attachment.html>


More information about the Postfix-br mailing list