i try to load a text file to mysql DB wit shell script but the handler MySQLLOadFile() does not work, i am dommi in shell script, can any body help me?
property mysql : load script (file "vike:Library:ASXtras:mySQL4AppleScript:mysql")
(*tell mysql to CreateLogInString("root", "", "localhost")
tell mysql to SetTheDataBase("ecsa")
tell mysql to ShowDataBases()*)
property mySQLarchivo : (choose file) as string
property mySQLFile : POSIX path of mySQLarchivo
property usuario : mysql's SetCurrentUser("root")
property pass : mysql's SetCurrentPassword("")
property DB : mysql's SetTheDataBase("ecsa")
property GetDB : mysql's GetTheDataBase()
property CPLOgSTR : mysql's CreateLogInString(usuario, pass, "localhost")
property CPdataBaseString : " -D " & "'" & DB & "'"
property CPmySQLCommand : "/usr/local/mysql/bin/mysql"
MySQLLOadFile()
on conecta()
set CPmySQLDescribe to " -e \"" & "DESCRIBE " & "\\`pantones\\`" & "\""
set CPmySQLCommand to CPmySQLCommand & CPLOgSTR & CPdataBaseString & CPmySQLDescribe
--do shell script CPmySQLCommand
end conecta
on MySQLLOadFile()
set CPLoadLocal to " -e \"" & "LOAD DATA LOCAL INFILE " & "\\`" & mySQLFile & "\\`" & " INTO TABLE" & "\\`" & "colores" & "\\`" & " " & "\""
set CPmySQLCommand to CPmySQLCommand & CPLOgSTR & CPdataBaseString & CPLoadLocal
do shell script CPmySQLCommand
end MySQLLOadFile