Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make an insert query in DQL

I'm working with symfony and I would like to know how I can do a simple insert using the doctrine:dql task.

./symfony doctrine:dql "<what should I put here?>"
like image 912
greg0ire Avatar asked Jun 22 '11 16:06

greg0ire


People also ask

How do you create a insert query?

There are two basic syntax of INSERT INTO statement is as follows: INSERT INTO TABLE_NAME (column1, column2, column3,... columnN)] VALUES (value1, value2, value3,... valueN);

Is an insert statement a query?

Data and DML Data Manipulation Statements can be categorized into four different types : INSERT statements - These add new data into a database table. SELECT statements - Also referred to as Queries; these retrieve existing data from database tables.

Is insert a SQL command?

The SQL INSERT INTO StatementThe INSERT INTO statement is used to insert new records in a table.


1 Answers

You officially cannot INSERT using DQL. Only SELECT, UPDATE and DELETE.

like image 66
Yura Avatar answered Sep 19 '22 18:09

Yura