sql-insert

PHP oci_execute for Multiple Statements

帅比萌擦擦* 提交于 2020-08-05 05:35:20
问题 I'm trying to issue multiple INSERT statements within a single oci_execute() call on PHP. The problem is that I get this error: ORA-00911: invalid character I'm guessing it's the ; after each statement. So now, my question is how do I make multiple INSERT statements that would work within oci_execute() ? Here's my query so far: INSERT INTO tbl (id, name) VALUES(1, 'John'); INSERT INTO tbl (id, name) VALUES(2, 'Martha'); INSERT INTO tbl (id, name) VALUES(3, 'Richard') EDIT : Note that there is

Oracle 12c - Ambiguous column in Insert Into Select Query, ORA-00918

陌路散爱 提交于 2020-07-23 02:05:42
问题 I am trying to execute multiple insert with single statement to achieve this I am using Insert into select statement. But I am facing when two columns have same value in insert. Error message that I am getting is ORA-00918: column ambiguously defined . Query INSERT INTO sample ( HOST, TOTAL_PING, TOTAL_UNAVAILABLE_PING ) SELECT * FROM ( SELECT 'FR3158-73-1', 82, 82 FROM DUAL UNION ALL SELECT 'FR3158-76-2', 80, 10 FROM DUAL ) Issue is there in first select statement where two values are 82 and

Oracle 12c - Ambiguous column in Insert Into Select Query, ORA-00918

荒凉一梦 提交于 2020-07-23 02:04:22
问题 I am trying to execute multiple insert with single statement to achieve this I am using Insert into select statement. But I am facing when two columns have same value in insert. Error message that I am getting is ORA-00918: column ambiguously defined . Query INSERT INTO sample ( HOST, TOTAL_PING, TOTAL_UNAVAILABLE_PING ) SELECT * FROM ( SELECT 'FR3158-73-1', 82, 82 FROM DUAL UNION ALL SELECT 'FR3158-76-2', 80, 10 FROM DUAL ) Issue is there in first select statement where two values are 82 and

Oracle 12c - Ambiguous column in Insert Into Select Query, ORA-00918

拟墨画扇 提交于 2020-07-23 02:03:08
问题 I am trying to execute multiple insert with single statement to achieve this I am using Insert into select statement. But I am facing when two columns have same value in insert. Error message that I am getting is ORA-00918: column ambiguously defined . Query INSERT INTO sample ( HOST, TOTAL_PING, TOTAL_UNAVAILABLE_PING ) SELECT * FROM ( SELECT 'FR3158-73-1', 82, 82 FROM DUAL UNION ALL SELECT 'FR3158-76-2', 80, 10 FROM DUAL ) Issue is there in first select statement where two values are 82 and