List:General Discussion« Previous MessageNext Message »
From:Morning Star Date:October 4 2012 1:17am
Subject:Re: passing shell variable to the SET data type in parentheses
View as plain text  
Thanks guys for all the corrections.
I fix it by executing:

mysql -u $user -p${password} --skip-column-names -e 'ALTER TABLE
'$table' MODIFY '$kolom' SET( '$var' );' $database ;

:)

Greetings,

Marco

On Thu, Oct 4, 2012 at 4:49 AM,  <hsv@stripped> wrote:
>>>>> 2012/10/03 20:35 +0700, Morning Star >>>>
> $ echo $var
> "value1","value2","value3"
>
> what i did:
> mysql -u $user -p${password} --skip-column-names -e 'ALTER TABLE
> '$table' MODIFY '$kolom' SET(" '$var' ");' $database ;
>
> the result:
> ERROR 1064 (42000) at line 1: You have an error in your SQL syntax;
> check the manual that corresponds to your MySQL server version for the
> right syntax to use near 'value1","value2","value3' at line 1
>
> what do i have to do? please help me.
> <<<<<<<<
> If your "var" really has three pairs of double-quotes, with the double-quotes within
> the single-quotes, you get that this
> ... SET(" "value1","value2","value3" ");
> is passed to MySQL client, which is not valid.
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql
>
Thread
passing shell variable to the SET data type in parenthesesMorning Star3 Oct
  • Re: passing shell variable to the SET data type in parenthesesMichael Dykman3 Oct
    • Re: passing shell variable to the SET data type in parenthesesGarot Conklin3 Oct
      • Re: passing shell variable to the SET data type in parenthesesGarot Conklin3 Oct
  • Re: passing shell variable to the SET data type in parentheseshsv4 Oct
    • Re: passing shell variable to the SET data type in parenthesesMorning Star4 Oct