We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
insertBatch()
$db ->createCommand() ->createTable( '{{%user}}', [ 'id' => 'pk', 'number' => 'integer NOT NULL', 'email' => 'string(255) NOT NULL', 'balance' => 'float DEFAULT 0.0 NOT NULL', 'born_at' => 'date', ], ) ->execute(); $db ->createCommand() ->batchInsert( '{{%user}}', ['number', 'email', 'balance', 'born_at'], $fixtures, ) ->execute();
The above code generates SQL
INSERT ALL INTO "user" ("number", "email", "balance", "born_at") VALUES (1, 'foo@bar\baz', '10.25', NULL) INTO "user" ("number", "email", "balance", "born_at") VALUES (2, 'bar@foo', '1', NULL) INTO "user" ("number", "email", "balance", "born_at") VALUES (3, 'seed@beat', '100', NULL) INTO "user" ("number", "email", "balance", "born_at") VALUES (4, 'the@best', '500', NULL) INTO "user" ("number", "email", "balance", "born_at") VALUES (5, 'test@test', '42', TO_DATE('1990-01-01', 'yyyy-mm-dd')) SELECT 1 FROM SYS.DUAL
Which throws an error
SQLSTATE[HY000]: General error: 1 OCIStmtExecute: ORA-00001: unique constraint (SYSTEM.SYS_C007804) violated on table XE.user columns (id) ORA-03301: (ORA-00001 details) row with column values (id:1) already exists Help: https://docs.oracle.com/error-help/db/ora-00001/
Additioanal info
The text was updated successfully, but these errors were encountered:
DMLQueryBuilder::insertBatch()
No branches or pull requests
The above code generates SQL
Which throws an error
Additioanal info
The text was updated successfully, but these errors were encountered: