mySQL值语句作为参数?
是否可以将代码的整个值块作为参数插入MySQL表中?
参数将是:
("(638) 833-5496","[email protected]","Spain"),
("(293) 742-0229","[email protected]","Belgium"),
("1-265-156-4304","[email protected]","Ireland"),
("1-833-780-2553","[email protected]","France"),
("(619) 691-0656","[email protected]","Costa Rica");
插入语句是否
INSERT INTO `myTable` (`phone`,`email`,`country`)
VALUES
{parameter}
可以作为插入语句,存储过程或其他任何内容进行?
is it possible to insert into a MySQL table with the whole VALUES block of code being a parameter?
Parameter would be:
("(638) 833-5496","[email protected]","Spain"),
("(293) 742-0229","[email protected]","Belgium"),
("1-265-156-4304","[email protected]","Ireland"),
("1-833-780-2553","[email protected]","France"),
("(619) 691-0656","[email protected]","Costa Rica");
Insert statement would be
INSERT INTO `myTable` (`phone`,`email`,`country`)
VALUES
{parameter}
Is it possible to do as an Insert statement, stored procedure, or anything?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我能够通过使用execute命令并将字符串作为变量,然后将其编译到一个SQL语句中来解决此问题。
I was able to solve this by utilizing the EXECUTE command and passing the string as a variable and then compiling it into one SQL statement.