Good point. This is actually how i have it written before its processed:

"""
LOAD DATA LOCAL INFILE '[path]'
            INTO TABLE ps_cc
            CHARACTER SET UTF8
            FIELDS TERMINATED BY ',' ENCLOSED BY '"'
            LINES TERMINATED BY '\\r\\n'
            (
                fk_ps_server_id
                ,fk_school_number
                ,term_id
                ,section_id
                ,@date_enrolled
                ,@date_left
                ,teacher_number
                ,section_number
                ,course_number
                ,course_name
                ,expression
                ,student_number
            )
            SET date_enrolled = STR_TO_DATE(@date_enrolled, '%m/%d/%Y'), 
date_left = STR_TO_DATE(@date_left, '%m/%d/%Y')
"""

On Friday, November 6, 2015 at 5:28:17 PM UTC-5, Dave S wrote:
>
>
>
> On Friday, November 6, 2015 at 1:31:59 PM UTC-8, Benson Myrtil wrote:
>>
>> I am attempting to run the following within executesql on a MySQL 
>> database:
>>
>>             LOAD DATA LOCAL INFILE '[path]'
>>             INTO TABLE ps_cc
>>             CHARACTER SET UTF8
>>             FIELDS TERMINATED BY ',' ENCLOSED BY '"'
>>             LINES TERMINATED BY '\r\n'
>>             (
>>                 fk_ps_server_id
>>                 ,fk_school_number
>>                 ,term_id
>>                 ,section_id
>>                 ,@date_enrolled
>>                 ,@date_left
>>                 ,teacher_number
>>                 ,section_number
>>                 ,course_number
>>                 ,course_name
>>                 ,expression
>>                 ,student_number
>>             )
>>             SET date_enrolled = STR_TO_DATE(@date_enrolled, '%m/%d/%Y'), 
>> date_left = STR_TO_DATE(@date_left, '%m/%d/%Y')
>>
>> However I am getting the following error: 1148 The used command is not 
>> allowed with this MySQL version
>>
>> When I paste that same line of code inside of Workbench it executes just 
>> fine.
>>
>> Any ideas why?
>>
>
> There are lots of special characters in that string.  Are you running into 
> an issue with how they are escaped?
>
> Otherwise, the issue is way beyond me, and we will await the actual DBAs .
>
> /dps
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to