Macro Variables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thegate

    #1

    Macro Variables

    Hola a todos:
    Me gustaria saber si hay alguna manera de expandir una variable.

    Ejemplo;

    Drop table if exists myDatabase.Text ;
    create table myDatabase.Text (
    emp char(3) not null default '',
    Nom varchar(30) not null default '' ) engine myisam;
    insert into myDatabase.Text (emp, nom) select emp, nom from
    OtraDatabase.Te xt;
    set @vMyTable:="Tex t";
    select * from myDatabase.@vMy Table order by emp;

  • Thomas Bartkus

    #2
    Re: Macro Variables

    Por favor - disculpe me espanol malo.
    pero
    No creo que es posible usar una variable MySQL a especificar un nombre de
    mesa. Tiene que formar el SQL decleracion con el nombre de mesa en la
    integridad con la ayuda de un otra lengua de programacion.

    I don't believe it is possible to use a MySQL variable to specify a table
    name.
    You would have to form the SQL statement with the table name in it's
    entirety with the help of another programming language.

    Thomas Bartkus

    "Thegate" <mysoft@ono.com > wrote in message
    news:1145374664 .355061.326310@ i39g2000cwa.goo glegroups.com.. .[color=blue]
    > Hola a todos:
    > Me gustaria saber si hay alguna manera de expandir una variable.
    >
    > Ejemplo;
    >
    > Drop table if exists myDatabase.Text ;
    > create table myDatabase.Text (
    > emp char(3) not null default '',
    > Nom varchar(30) not null default '' ) engine myisam;
    > insert into myDatabase.Text (emp, nom) select emp, nom from
    > OtraDatabase.Te xt;
    > set @vMyTable:="Tex t";
    > select * from myDatabase.@vMy Table order by emp;
    >[/color]


    Comment

    • Thegate

      #3
      Re: Macro Variables

      Thank you.

      Comment

      Working...