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
7
votes
1 answer

Use a UDF as the default value in a table column in SQL Server

I created a scaler UDF (called sCurrentAppUser()) in SQL Server 2012 Express and I would like to use this UDF as a default value when defining a table. But every time I try, I get an error of "'sCurrentAppUser' is not a recognized built-in function…
Jason
  • 349
  • 3
  • 9
7
votes
2 answers

SQL Server TOP(1) with distinct

I am trying to extract the first row I get after ordering the result by i_version_id. If I do not use TOP(2), my query works as expected ans returns all results sorted by i_version_id. But when I add the TOP(2) (as shown below), it says that there…
Darth.Vader
  • 5,079
  • 7
  • 50
  • 90
7
votes
3 answers

Select the SECOND LAST record in each group

There is a table Remark that contains data as shown below: SerialNo | RemarkNo | Desp ============================================= 10 | 1 | rainy 10 | 2 | sunny 11 | 1 | sunny …
Kim Stacks
  • 10,202
  • 35
  • 151
  • 282
6
votes
2 answers

How can I stop a managed trigger from executing while running a test class?

Usually, when a trigger runs, we check what kind of a profile the user has, and if it's the kind where we don't want the triggers to run, then we exit the trigger before running any other code. Problem: we have a SF package installed that we…
Kirill Yunussov
  • 1,955
  • 1
  • 21
  • 24
6
votes
0 answers

Are Stored Procedures DDL or DML?

Where DDL and DML are basically: DDL = Data Definition Language DML = Data Manipulation Language I have always classified Stored Procedures as DDL since they uses Structured Query language. But recently I was debated that Stored Procedures…
Marco Vargas
  • 1,232
  • 13
  • 31
6
votes
2 answers

mysql @@identity vs sql-server last_insert_id()

Am I correct in understanding that mysql's LAST_INSERT_ID() function doesn't reset between insert attempts (as @@identity does in sql-server)... that if the immediately preceding insert operation fails, LAST_INSERT_ID() will return the pk of…
codemonkey
  • 2,661
  • 2
  • 24
  • 34
5
votes
2 answers

What's the PostgreSQL equivalent of SQL Servfer's CONTEXT_INFO?

In relation to my other question "What’s the best way to audit log DELETEs?". What's the PostgreSQL equivalent of CONTEXT_INFO? I want to log deletes using a trigger, but since I'm not using the database user as my app's logical user, I cannot log…
Hao
  • 8,047
  • 18
  • 63
  • 92
5
votes
1 answer

Oracle get id of inserted row with identity always

Currently I have a table with this structure: CREATE TABLE "DUMMY_SCHEMA"."NAMES" ( "ID" NUMBER(10,0) GENERATED ALWAYS AS IDENTITY (START WITH 1 INCREMENT BY 1 CACHE 20) NOT NULL , "NAME" NVARCHAR2(1024) NOT NULL , CONSTRAINT "NAMES_PK" PRIMARY…
AceVentur4
  • 53
  • 1
  • 1
  • 3
5
votes
2 answers

Using WITH + DELETE clause in a single query in postgresql

I have the following table structure, for a table named listens with PRIMARYKEY on (uid,timestamp) Column | Type | Modifiers …
Pinkesh Badjatiya
  • 346
  • 1
  • 5
  • 15
5
votes
0 answers

QDR expressions in OLAP cube calculated measures

I'm becoming crazy with a calculated measure into OLAP Analytic Workspace Manager, that is defined like next OLAP Expression syntax: NVL(CUBE.MEASURE1[DIM1= 'A'], 0) + NVL(CUBE.MEASURE2[DIM2= 'B'], 0) Where: CUBE.MEASURE1 and CUBE.MEASURE2 are not…
ignalva
  • 51
  • 1
5
votes
3 answers

SQL DML: Incorrect date value (MySQL)

I created a table in my database: CREATE TABLE official_receipt( student_no INT UNSIGNED, academic_year CHAR(8), trimester ENUM('1', '2', '3'), or_no MEDIUMINT UNSIGNED, issue_date DATE NOT NULL, received_from VARCHAR(255)…
user2539182
5
votes
1 answer

Dynamically replacing the value of a node in XML DML

I am struggling with this now: How do you replace the value of a node in an untyped XML column where the text is equal to a certain variable value? Is it possible? My XML: ManualInsert ManualInsert2
Eon
  • 3,833
  • 10
  • 46
  • 75
5
votes
2 answers

how to assign IDs to xml nodes in the same level

I'm trying to modify a third party xml so that all the elements have Id's from T-SQL. This is the original xml (section):
checamon
  • 63
  • 6
4
votes
1 answer

Does WebSQL support primary keys?

I'm creating a WebSQL table in Chrome with the following statement: 'CREATE TABLE IF NOT EXISTS recs(id, fname,lname,email,country,comments, synced integer,PRIMARY KEY(id))' Inserting records does not appear to be creating primary keys. How…
Fred
  • 3,786
  • 7
  • 41
  • 52
4
votes
1 answer

Tool to auto generate DML stored procedures for all the tables in my schema -MySQL

I was looking for a tool which can can auto-generate the DML stored procedures (Insert, Update, Delete, Select) for my MySQL database from the schema.
Saanch
  • 1,814
  • 1
  • 24
  • 38
1
2
3
35 36