Is there a limit as to the length a SQLsommandtext can be ?
I keep getting the error: Fatal error encountered during command execution.
I'm connecting to a Mysql 5.6 db from powershell 2.0 on win 7.
I'm trying to load MS DHCP audit logs in a database.
If I shorten the SQL statement it works.
Here is the statement that causes the error:
$sql = "load data infile $sqlfullpath into table audit_rec FIELDS TERMINATED BY ',' IGNORE 33 LINES " + `
"(rec_code, @daterec, rec_time, Rec_description, rec_ip_addr, rec_hostname, rec_mac, rec_user, " + `
"rec_trans_id, rec_Qresult, rec_probationtime, rec_correlation_id, rec_dhcid) " + `
"SET rec_date = str_to_date(@daterec, '%m/%d/%y')"
$command.ExecuteNonQuery()
##### $sqlfullpath is the full path to the dhcp audit log file with '\\' bwetween folder names.
Now I have tried this command in workbench and it works like a charm. Loads all the records correctly. Just trying to do this in powershell to read multiple files and import them. Processing one file at a time.
Thanks
I keep getting the error: Fatal error encountered during command execution.
I'm connecting to a Mysql 5.6 db from powershell 2.0 on win 7.
I'm trying to load MS DHCP audit logs in a database.
If I shorten the SQL statement it works.
Here is the statement that causes the error:
$sql = "load data infile $sqlfullpath into table audit_rec FIELDS TERMINATED BY ',' IGNORE 33 LINES " + `
"(rec_code, @daterec, rec_time, Rec_description, rec_ip_addr, rec_hostname, rec_mac, rec_user, " + `
"rec_trans_id, rec_Qresult, rec_probationtime, rec_correlation_id, rec_dhcid) " + `
"SET rec_date = str_to_date(@daterec, '%m/%d/%y')"
$command.ExecuteNonQuery()
##### $sqlfullpath is the full path to the dhcp audit log file with '\\' bwetween folder names.
Now I have tried this command in workbench and it works like a charm. Loads all the records correctly. Just trying to do this in powershell to read multiple files and import them. Processing one file at a time.
Thanks