Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Can't Insert Data To Multiple Table With DBI::Mysql

by chacham (Prior)
on Jun 27, 2016 at 12:49 UTC ( #1166658=note: print w/replies, xml ) Need Help??


in reply to Re: Can't Insert Data To Multiple Table With DBI::Mysql
in thread Can't Insert Data To Multiple Table With DBI::Mysql [SOLVED]

(and, I think, in any database that supports "Structured Query Language"), the "INSERT" statement only works on one table at a time.

Oracle supports INSERT ALL (INSERT ALL INTO A ... INTO B ... INTO C....) and INSERT FIRST.

Perhaps not what you meant, but SQL Server indirectly allows it, via Partitioned Views or Views with INSTEAD OF Triggers. Those, in a sense, extend the original INSERT statement to include multiple tables. Same goes for DB2.

Of course, a trigger can continue inserting into other tables, but that is mot definitely not the same statement.

  • Comment on Re^2: Can't Insert Data To Multiple Table With DBI::Mysql

Replies are listed 'Best First'.
Re^3: Can't Insert Data To Multiple Table With DBI::Mysql
by pakeidoprek (Novice) on Jul 16, 2016 at 14:40 UTC

    Yup, MySql doesn't support insert multiple table in one query. so i fix it with if elsif function :)

    ^_^

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1166658]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2021-04-13 01:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?