I see lot of debate of 'Select' being called as DML. Can some one explain me why its DML as its not manipulating any data on schema? As its puts locks on table should this be DML?
*In Wikipedia * I can see
"The purely read-only SELECT query statement is classed with the 'SQL-data' statements[2] and so is considered by the standard to be outside of DML. The SELECT ... INTO form is considered to be DML because it manipulates (i.e. modifies) data. In common practice though, this distinction is not made and SELECT is widely considered to be part of DML.[3]"
But in SELECT * FROM INSERT select will just perform selection nothing other than this!! Please someone help me in understanding this concept.
Thanks
Data Manipulation Language (DML) Statements The SELECT statement is a limited form of DML statement in that it can only access data in the database. It cannot manipulate data in the database, although it can operate on the accessed data before returning the results of the query.
if you refer to 11g Documentation as in HERE - Types of SQL Statements, you will find that Select is a DML statement, which is a limited form of DML, which can query the data and not manipulate it. SELECT .. INTO can manipulate (modify) data, even if it is not changing the stored data.
Examples of DML SELECT − Retrieve data from the database. INSERT − Insert data into a table. UPDATE − Update existing data within a table. DELETE − Delete records from a database table.
DDL stands for Data Definition Language and are the statements required to create the tables used in the SELECT statement examples.
The distinction that people usually make is between DDL (data definition language, i.e. managing schema objects) and DML (data manipulation language, i.e. managing data within the schema created by DDL). Clearly a SELECT is not DDL.
Data Manipulation Language (DML) is a vocabulary used to query/retrieve and work with data. Don't go by the word Manipulation, such statement allows both data accessing and processing. As you have tagged question with SQL Server 2005 following link can be referred:
http://technet.microsoft.com/en-US/library/ms177591(v=SQL.90).aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With