Re: Execute more sql statments in one step.



PdG wrote:
I've this script:

DROP TABLE IF EXISTS `rivenditori`;

CREATE TABLE `rivenditori` (
  `id` varchar(255) NOT NULL default '',
  `ragione_sociale` varchar(255) default NULL,
  `licenza` varchar(255) NOT NULL default '',
  `ultimo_accesso` timestamp NULL default NULL,
  PRIMARY KEY  (`id`,`licenza`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;


INSERT INTO `rivenditori` VALUES ('101010','aaa','blabla',NULL); INSERT INTO `rivenditori` VALUES ('101010','aaa','bbbb',NULL); INSERT INTO `rivenditori` VALUES ('333','ccc','333-223',NULL); INSERT INTO `rivenditori` VALUES ('partita','ragiones','s',NULL);

and i need to execute it into a mysql database in one step.
But i obtain an exception: "You have an error in your SQL syntax;", and, cutting and pasting the same script inside a mysql front end (mysqlfront for example) it's executed with no errors.


Have i to use a specific method to run multiple instructions? I've tried execute, executeBatch() but the results are the same...

Please be more specific about what 'execute it into a mysql database in one step' actually means. Why are several stmt.execute () not an option?


Daniel
.



Relevant Pages

  • Execute more sql statments in one step.
    ... `id` varcharNOT NULL default '', `ragione_sociale` varchardefault NULL, `licenza` varcharNOT NULL default '', `ultimo_accesso` timestamp NULL default NULL, PRIMARY KEY ... INSERT INTO `rivenditori` VALUES; ... and i need to execute it into a mysql database in one step. ... I've tried execute, executeBatchbut the results are the same... ...
    (comp.lang.java.databases)
  • Re: Execute more sql statments in one step.
    ... `id` varcharNOT NULL default '', `ragione_sociale` varchardefault NULL, `licenza` varcharNOT NULL default '', `ultimo_accesso` timestamp NULL default NULL, PRIMARY KEY ... INSERT INTO `rivenditori` VALUES; ... and i need to execute it into a mysql database in one step. ... I've tried execute, executeBatchbut the results are the same... ...
    (comp.lang.java.databases)
  • RE: Error on: my $sth->execute;
    ... > To: Perl ... > a MySQL database. ... > Can't call method "execute" on an undefined value at ...
    (perl.beginners)
  • Re: MySql +DBI problem
    ... into a mysql database. ... when i execute the script only aroud 31000 to 37000 ...
    (comp.lang.perl.misc)
  • Urgent: Cannot Connect to Database Mysql+PHP
    ... I am having a problem connecting to mysql database. ... Everytime I execute the script the server gives me a message: ...
    (comp.lang.php)