From: Garot Conklin Date: October 3 2012 8:04pm Subject: Re: passing shell variable to the SET data type in parentheses List-Archive: http://lists.mysql.com/mysql/228303 Message-Id: <1349294646.36652.YahooMailNeo@web140506.mail.bf1.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="1594581660-987415558-1349294646=:36652" --1594581660-987415558-1349294646=:36652 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Should have included an example:=0A=0Aecho $var=0A"value1","value2","value3= "=0A=0Aecho mysql -u $user -p${password} --skip-column-names -e 'ALTER TABL= E=0A' $table' MODIFY '$kolom' SET(" '$var' ");' $database ;=0A=0Amysql -u -= p --skip-column-names -e ALTER TABLE=0A=A0 MODIFY=A0 SET(" "value1","value2= ","value3" ");=0A=0Aecho mysql -u $user -p${password} --skip-column-names -= e 'ALTER TABLE=0A' $table' MODIFY '$kolom' SET(" $var ");' $database ;=0A= =0Amysql -u -p --skip-column-names -e ALTER TABLE=0A=A0 MODIFY=A0 SET(" $va= r ");=0A=0Aecho mysql -u $user -p${password} --skip-column-names -e 'ALTER = TABLE=0A' $table' MODIFY '$kolom' SET( '$var' );' $database ;=0A=0Amysql -u= -p --skip-column-names -e ALTER TABLE=0A=A0 MODIFY=A0 SET( "value1","value= 2","value3" );=0A=0A=0AI believe that this is what Michael was eluding to a= s well...=0A=0A=0Agarotconklin@stripped=0A=0A=0A__________________________= ______=0A From: Garot Conklin =0ATo: Michael Dykman= ; Morning Star =0ACc: "my= sql@stripped" =0ASent: Wednesday, October 3,= 2012 3:50 PM=0ASubject: Re: passing shell variable to the SET data type in= parentheses=0A =0Aare you trying to get the value of var encapsulated with= =A0 ' ' marks? =0ATypical shell expansion while within " " will output the = literal:=0A=0Avar=3D10=0Aecho "'$var'"=0A'10'=0A=0A=0AHave you tried removi= ng the single quotes?=A0 The shell can be funny with ' and "=0A=0A=0A=0A=A0= =0Agarotconklin@stripped=0A=0A=0A________________________________=0AFrom: = Michael Dykman =0ATo: Morning Star =0ACc: mysql@stripped =0ASent: Wednesday, October 3, 2012 3= :41 PM=0ASubject: Re: passing shell variable to the SET data type in parent= heses=0A=0AWhat is the result if you echo that line instead of running it?= =A0 ie:=0A=0Aecho mysql -u $user -p${password} --skip-column-names -e 'ALTE= R TABLE=0A' $table' MODIFY '$kolom' SET(" '$var' ");' $database ;=0A=0AI'm = not clear exactly what the text is of the command you are trying to run.=0A= =0A- michael dykman=0A=0AOn Wed, Oct 3, 2012 at 9:35 AM, Morning Star=0A wrote:=0A> Hi guys,=0A> i have a problem when tr= ying to pass shell variable to the SET data=0A> type in parentheses.=0A> i = have a variable like this:=0A>=0A> $ echo $var=0A> "value1","value2","value= 3"=0A>=0A> what i did:=0A> mysql -u $user -p${password} --skip-column-names= -e 'ALTER TABLE=0A> '$table' MODIFY '$kolom' SET(" '$var' ");' $database ;= =0A>=0A> the result:=0A> ERROR 1064 (42000) at line 1: You have an error in= your SQL syntax;=0A> check the manual that corresponds to your MySQL serve= r version for the=0A> right syntax to use near 'value1","value2","value3' a= t line 1=0A>=0A> what do i have to do? please help me.=0A>=0A> Greetings,= =0A>=0A> Marco=0A>=0A> --=0A> MySQL General Mailing List=0A> For list archi= ves: http://lists.mysql.com/mysql=0A> To unsubscribe:=A0 =A0 http://lists.m= ysql.com/mysql=0A>=0A=0A=0A=0A-- =0A- michael dykman=0A- mdykman@stripped= =0A=0AMay the Source be with you.=0A=0A-- =0AMySQL General Mailing List=0AF= or list archives: http://lists.mysql.com/mysql=0ATo unsubscribe:=A0 =A0 htt= p://lists.mysql.com/mysql --1594581660-987415558-1349294646=:36652--