1 message in com.mysql.lists.mysql-esFw: Make a User Variable and assign a...
FromSent OnAttachments
Julio E. Salceda M.23 Nov 2003 09:39 
Subject:Fw: Make a User Variable and assign a value Dinamicaly
From:Julio E. Salceda M. (jesa@hotmail.com)
Date:11/23/2003 09:39:55 AM
List:com.mysql.lists.mysql-es

Please I am very new in MySql and I am making tests to learn the best way to do the job. In this time I need to know how can create a User Variable whith a Dinamic name and assign a value to it. below put more or less what I need.

Soy muy nuevo en MySql y estoy haciendo pruebas para aprender la mejor manera de realizar un proyecto In este momento necesoto saber si hay alguna manera de crear una variable de usuario y asignarle valor a la misma. Pero esta tiene que ser creada en forma dinamica. A continuacion pongo mas o menos lo que necesito.

SET @Vdb:='pepedb'; SET @Vtabla:='acm_mco'; SET @Vpepedb_hco_fecha:='2003-03-01'; SET @Vpepedb_hco_cuenta:=430000001; SET @Vpepedb_hco_dh:='H'; SET @Vpepedb_hco_valor:=300000;

I need something like that: SET
CONCAT('@V',@Vdb,'_',CONCAT(@Vtabla,'_',LOWER(@Vpepedb_hco_dh),CONV(MONTH(@Vpepedb_hco_fecha),10,10))):=CONCAT('@V',@Vdb,'_',CONCAT(@Vtabla,'_',LOWER(@Vpepedb_hco_dh),CONV(MONTH(@Vpepedb_hco_fecha),10,10)))
+ @Vpepedb_hco_valor;

and it have to be like: SET @Vpepedb_acm_mco_h3:=@Vpepedb_acm_mco_h3 + @Vpepedb_hco_valor;

Thank you very much

Muchas gracias de antemano por vuestra ayuda