Questions tagged [dml]

Data Manipulation Language(DML) is database syntax used for SQL commands, including the INSERT, UPDATE, and DELETE statements. DML triggers operate on INSERT, UPDATE, and DELETE statements, and help to enforce business rules and extend data integrity when data is modified in tables or views.

A data manipulation language (DML) is a family of syntax elements similar to a computer programming language used for inserting, deleting and updating data in a database. Performing read-only queries of data is sometimes also considered a component of DML.

A popular data manipulation language is that of Structured Query Language (SQL), which is used to retrieve and manipulate data in a relational database. Other forms of DML are those used by IMS/DLI, CODASYL databases, such as IDMS and others.

References:

DML related tags

539 questions
0
votes
2 answers

SQL to update with Unique Values

How will you update records with unique values in table by just using a single update statement ? e.g. Col1 ---- 1 1 2 2 3 o/p: Col1 ---- 1 2 3 4 5
James Bond
  • 2,825
  • 2
  • 15
  • 11
0
votes
0 answers

Table in Mysql with unique fields

I have a table in Mysql with the following fields: CREATE TABLE table_1( camp_1 boolean, tree varchar(50), name varchar(50), serv varchar(50), number varchar(50), PRIMARY KEY (camp_1, tree, name) ); then i can have something like that: select*…
Code Geas Coder
  • 1,839
  • 4
  • 23
  • 29
0
votes
1 answer

Do I need to COMMIT when interleaving DDLs and DMLs?

In Oracle, I am invoking the following querys (not from sqlplus) as part of an installation script: ALTER TABLE MYTABLE DISABLE CONSTRAINT PFTATTRS_ATTR_FK; INSERT INTO MYTABLE (PTF_ID, ATTR_ID) VALUES (1, 5); ALTER TABLE MYTABLE ENABLE CONSTRAINT…
crusaderky
  • 2,552
  • 3
  • 20
  • 28
0
votes
1 answer

The cursor for loop that contains DML statements should be refactored to use

If I compiled my procedure I dont get error but I see this text(how Can I use this advice): A cursor for loop that contains DML statements should be refactored to use BULK COLLECTION and FORALL If I compiled this I got always…
Przemek
  • 67
  • 1
  • 3
  • 12
0
votes
1 answer

T-SQL deletion of rows not working

I am using T-SQL to fetch some table names which satisfy a certain criteria - put the name of those tables in a temporary table - @MyTempTable and plan to delete all rows from all tables which have an entry in @MyTempTable. I notice that my…
Darth.Vader
  • 5,079
  • 7
  • 50
  • 90
0
votes
1 answer

Modify Id attribute (key) of a record if the value already exists in the table

I have gotten data from an external source that I need to use for an application. However this data isn't very clean. Namely, I have a table T, where T.id is not unique throughout the table. However, given 2 lines with the same id, they DO refer to…
Myna
  • 569
  • 2
  • 10
  • 24
0
votes
1 answer

SQL query to remove multiple columns (normalize)

one is often opposed with a filled-in denormalized table, which is although having a primary key, such as: | RowID | Column1 | Column2 | Column3 | Column4 | ... | 'Row1' | 'a1' | 'a2' | 'a3' | 'a4' | | 'Row2' | 'b1' | 'b2' | 'b3' …
0
votes
1 answer

DDL statements against deleted inserted in DML trigger

I am trying to find impact of doing DDL statement against deleted and inserted logical tables inside table trigger. I have: CREATE TRIGGER [Trigger52] ON [dbo].[Table1] FOR DELETE, INSERT, UPDATE AS BEGIN create table inserted (c1 int) …
user156144
  • 2,215
  • 4
  • 29
  • 40
0
votes
2 answers

SqlServer's XML DML Statement is converting Delta Symbol to question mark

I've xml column in a table. When i'm inserting the xml into the table, all the symbols in xml are normal. But when i'm trying to insert a node into the xml using Xml DML statement, if that node has symbols like "Delta", SqlServer is converting them…
Sandhya
  • 3
  • 3
0
votes
1 answer

DML operation in hibernate eventlistener

here's a sample of what I need: public class UserTransactionManager implements PreInsertEventListener, PreUpdateEventListener, ApplicationContextAware { private static final long serialVersionUID = -3535037001167635519L; private static Log …
Mystery
  • 1
  • 1
0
votes
0 answers

how to know whether a DML query executed on a particular date on Oracle table?

I have tried to search is there any system/log table which stores execution details of a DML query.
0
votes
1 answer

Is it possible to ALTER TABLE (DDL) in the middle of an DML transaction on the same table?

Say, you begin a SqlTransaction from C# inside which you are inserting data from a DataTable into a SQL table, but this data is A LOT of data, so you do it 'in chunks' with a SqlBulkCopy inside the SQL transaction and only commit the transaction if…
sergeidave
  • 662
  • 4
  • 11
  • 23
0
votes
3 answers

Is it necessary to explicitly specify single quotes in a DML statement that uses String.Format()?

I want to refactor some code like this: dSQL = "INSERT INTO inventory ( id, pksize, Description, supplier_id, UnitCost, UnitList," + " Qty, UPC, dept, subdept, upc_pack_size, supplier_item, bqu_id)" + " VALUES" + "('" + id +"'" + ", " +…
B. Clay Shannon-B. Crow Raven
  • 8,547
  • 144
  • 472
  • 862
0
votes
1 answer

Execute two DML statements in DB2 using JDBC

I'm trying to execute two DML statements in DB2 using JDBC and I keep getting a syntax error: ALTER TABLE "TEST" ALTER COLUMN "COL1" SET DATA TYPE INT; ALTER TABLE "TEST" ALTER COLUMN "COL1" SET NOT NULL; If I execute them one by one everything is…
rpvilao
  • 1,116
  • 2
  • 14
  • 31
0
votes
1 answer

How can I get DML syntax from existing tables in MySQL?

I have several tables in MySQL database and those tables are already filled; Is there any way to get DML, which fills tables with same name, with exact same data? for ex. if I have table (names) like this: name_id : 1 name_val : john name_id :…
Giorgi Margiani
  • 292
  • 1
  • 6
  • 17