dml Questions
16
Solved
Why doesn't a TRUNCATE on mygroup work?
Even though I have ON DELETE CASCADE SET I get:
ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key constraint (mytest.instance, CONST...
Prohibitionist asked 27/3, 2011 at 21:57
40
Solved
In SQL Server, it is possible to insert rows into a table with an INSERT.. SELECT statement:
INSERT INTO Table (col1, col2, col3)
SELECT col1, col2, col3
FROM other_table
WHERE sql = 'cool'
Is i...
Penal asked 25/2, 2010 at 14:36
2
Solved
In PostgreSQL, the MVCC concurrency control mechanism says that:
MVCC locks acquired for querying (reading) data do not conflict with
locks acquired for writing data, and so reading never block...
Staunch asked 30/5, 2015 at 12:30
13
Solved
I have heard the terms DDL and DML in reference to databases, but I don't understand what they are.
What are they and how do they relate to SQL?
3
Solved
I have tried adding a foreign key like this...
ALTER TABLE OrderLineItem
ADD CONSTRAINT
FK_OrderLineItem_ShippingType_name FOREIGN KEY
(shippingType)
REFERENCES ShippingType(name);
Or like this...
Ferrand asked 18/11, 2011 at 22:10
1
I checked this solution but it did not work for my case - https://mcmap.net/q/1357248/-hibernate-hql-return-updated-rows-id-list-after-execute-update-query
I am working with Mysql.
If I do the foll...
3
Solved
For some reason, on a MySQL 5.5.30 machine, a trigger which deletes a row from a second table does no longer fire the delete trigger on the second table.
This works perfectly on our local MySQL ve...
5
Solved
Hello is possible to switch between DML commands/operations (Insert,Delete,Update) on Trigger Body?, I try to snippet some T-SQL for understand me better :
CREATE TRIGGER DML_ON_TABLEA
ON TABLEA...
Iseabal asked 17/11, 2009 at 20:58
3
I have a table that contains mamy columns and I want to update the one or few columns of the row without effecting remaining columns
I can write query:
update table as t set t.a=:a set t.b=:b wher...
Slave asked 7/10, 2014 at 21:47
5
Solved
I was going through the different commands in SQL and I came across ALTER command which is referred as DDL (Data Definition Language). We can alter the column and values in it, so we can manipulate...
3
How can I select all columns and add a column with a constant value in Oracle?
With MS SQL Server, I can use:
Select *,5 From TableA;
I will get this:
column1 column2 5
xx xx 5
xx xx 5
1
I'm familiar with the definitions of DDL, DML, and DCL as applied to SQL. There are lots of web sites and books that define and explain them. But no one seems to give an authoritative reference.
I...
3
Solved
Is there any way to combine these two replace values with 1 update statement?
UPDATE dbo.MyTable
SET MyXmlColumn.modify('replace value of (/node/@att1)[1] with "1"')
WHERE id = 1
UPDATE dbo.MyTab...
Viscera asked 6/9, 2011 at 23:51
2
Solved
I have the following table structure, for a table named listens with PRIMARYKEY on (uid,timestamp)
Column | Type | Modifiers
----------------+-----------------------------+----------------------...
Tonometer asked 14/5, 2016 at 9:35
5
Solved
How do I go about granting DML (SELECT,INSERT,UPDATE,DELETE) on all tables in a schema in PostgreSQL 8.4? I'd also like this grant to persist for new table creation in the future as well.
I've see...
Bhatt asked 22/7, 2012 at 10:32
2
I am using Delphi XE8 with FireDAC to load a large SQLite database. To do so, I'm using the Array DML execution technique to efficiently insert a large number of records at once, like this:
FDQuer...
Tincture asked 20/7, 2015 at 17:19
1
Solved
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 "'sCu...
Pique asked 22/5, 2015 at 17:0
3
Solved
I'm trying to implement a FIFO queue using a sql table.
I have the following SQL (modified for posting), the join and param usage are important to the way this process works.
With cte as (
sel...
Snath asked 31/3, 2014 at 12:48
2
I am a beginner in XML with SQL. How can I specify index within an insert statement as below. The following statement gives throws exception with invalid path to update.
set @xmldata.modify('inser...
Mcquoid asked 28/1, 2014 at 16:42
3
Solved
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 N...
Gautier asked 22/7, 2013 at 17:40
3
Solved
There is a table Remark that contains data as shown below:
SerialNo | RemarkNo | Desp
=============================================
10 | 1 | rainy
10 | 2 | sunny
11 | 1 | sunny
11 | 2 | rainy...
Karolynkaron asked 16/3, 2013 at 18:48
1
Solved
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:
<attrs>
<attr...
Aparri asked 15/3, 2013 at 14:54
2
Solved
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.
Pr...
Kinna asked 26/1, 2012 at 18:35
2
Solved
If a user changes table HelloWorlds, then I want 'action they did', time they did it, and a copy of the original row insert into HelloWorldsHistory.
I would prefer to avoid a separate triggers for...
Goldeye asked 8/12, 2010 at 19:22
2
Solved
How do I combine executing of a stored procedure and using its result or parameters in a regular SQL query?
For example I would like to do something like the following:
-- passing result of SELE...
Channel asked 1/4, 2010 at 19:38
1 Next >
© 2022 - 2025 — McMap. All rights reserved.