473,396 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

a question on "High performance SQL"

Hi Serge,

I have a question on your exciting recent article on High Perf. SQL: why do
we have to describe datatype for include columns in an INSERT .... INCLUDE
.... statement - in your example, the columns come from the DATA CTE, so
datatype are well known ?

Secondly, you can create such SQL: WITH CTE AS (VALUES(1),(2)) SELECT * FROM
CTE; and DB2 does not need to have a datatype, but will choose an integer.
So why in some cases, no datatype is needed, in some cases, datatype are
needed; what I find "strange" is to have a "mix" kind of DDL in DML?

Thanks in advance & Best regards,

Jean-Marc

Nov 12 '05 #1
1 1557
You are correct that the data type could be derived from the insert source.
Indeed development had many debates on the topic.
The reason to go with explicit typing was that the other types (i.e. the
columns of the insert target) are also explicitly typed.
Note that long term nothing is lost.
We could make the data type optional in the future.
Note that typing is not a DDL feature and type derivation is not a DML
feature. DML supports the CAST specifiction and DDL supports type
derivation in CREATE VIEW and CREATE TABLE AS. (CREATE VIEW in a way
supports both with typed views having explicit column types)
So the language is sufficiently flexible to roll with the punches and
still look consistent.

Here is some hypothetical SQL:
SELECT * FROM T AS Q(a1 INT, b1 DOUBLE)
CREATE VIEW v1(c1 INT, c2 DOUBLE) AS ....

Cheers
Serge
Cheers
Serge
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: sql-db2-dba | last post by:
When I did db2batch to benchmark a query, it performance details came back with this reading ... "High water mark for database heap = 4291373408" Does this mean it would have caused memory...
5
by: Serge Rielau | last post by:
Contains a major blurp on SELECT FROM INSERT and some other hopefully useful tricks. http://www-106.ibm.com/developerworks/db2/library/techarticle/dm-0411rielau/ Enjoy Serge
2
by: Gianluca_Venezia | last post by:
Talking about high number of record seem ridiculus, if this number is about 88.000 but when I open a form, linked via ODBC to a MYSQL table, the open and the use of that form is slow, and very...
8
by: Tamir Khason | last post by:
I just testing my program on Windows PE with Framework 1.1 pre-installed and got a message "high encryption pack not installed" - what's the hell? The only information I found in inet is related to...
5
by: Kivak Wolf | last post by:
Hey everyone, I have a textbox in my web page that is going to be used to enter an E-mail into (just plain text, no HTML). Now, this will interact with a SQL database where the contents of the...
2
by: Joel Vazquez | last post by:
Visual Basic.NET Application RunTime Crashes and Stalls Im a newbie if you could say in .NET ive been working with it the past 3 months and have done lots of things with it, without any prior...
2
by: Julio Allegue | last post by:
I am getting the wrong Count(*) on vb.net using the ExecuteScalar . It returns all the rows. It doesn't seem to look at the WHERE clause. At the same time, I am getting the correct count on "SQL...
1
by: Mark R. Dawson | last post by:
A while ago there was a post where someone asked how to find if a type was derived from another type, three ways were mentioned: Solution1:...
2
by: samyuktha takkellapati | last post by:
create or replace trigger emp_trigger after update or delete on employee for each row begin if updating then insert into empupdate(empno,ename,job,mgr,sysdate,sal,comm,deptno)...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.