INSERT的语法糖 [英] Syntactic sugar for INSERT

查看:66
本文介绍了INSERT的语法糖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是错误的论坛,但我认为它可能会开始讨论。


INSERT语句,以其当前形式,格式化问题

所以人类读者可以遵循它。特别是,对于具有许多

列的表,唯一将值放在与列

名称非常接近的位置是水平的,这可能导致1000s的行

长度的字符难以阅读和编辑。我想看到的是

来自INSERT语句的可选语句,其语法类似于UPDATE语句的SET子句

,它使值保持与

列名称,并允许合理的长度行为人类

读取和编辑。很明显,这只是语法糖,因为

新语法不会为INSERT语句添加任何功能或功能。

This is probably the wrong forum for this, but I thought it might start
some discussion.

The INSERT statement, in its current form, has problems being formatted
so a human reader can follow it. In particular, for a table with many
columns, the only to put the values in close proximity with the column
names is horizontally, which can lead to lines of 1000s of characters in
length which are difficult to read and edit. What I would like to see is
an optional from of the INSERT statement with syntax like the SET clause
of the UPDATE statement, which keeps the values in close proximity with
the column names and also allows reasonable length lines for human
reading and editing. Clearly this is just syntactic sugar because the
new syntax does not add any power or functionality to the INSERT statement.

推荐答案

Bob Stearns写道:
Bob Stearns wrote:
这可能是错误的论坛,但我认为它可能会开始讨论。

INSERT语句,在其当前形式,有格式化的问题
所以人类读者可以遵循它。特别是对于具有多列
的表,唯一将值与列名称紧密相邻的是水平的,这可能会导致长度为1000的字符行难以阅读和编辑。我希望看到的是INSERT语句中的可选语句,其语法类似于UPDATE语句的SET子句
,它使值与列名称保持紧密接近。允许合理的长度线进行人类阅读和编辑。很明显,这只是语法糖,因为
新语法不会为INSERT
语句添加任何功能或功能。
This is probably the wrong forum for this, but I thought it might start
some discussion.

The INSERT statement, in its current form, has problems being formatted
so a human reader can follow it. In particular, for a table with many
columns, the only to put the values in close proximity with the column
names is horizontally, which can lead to lines of 1000s of characters in
length which are difficult to read and edit. What I would like to see is
an optional from of the INSERT statement with syntax like the SET clause
of the UPDATE statement, which keeps the values in close proximity with
the column names and also allows reasonable length lines for human
reading and editing. Clearly this is just syntactic sugar because the
new syntax does not add any power or functionality to the INSERT
statement.



所以你想要一些类似的东西天然的QUOT;加入,就像一个自然插入一样。


INSERT INTO T NATURAL SELECT x AS a,Y as b FROM T

a和b是T列以某种顺序。


请注意,自然连接是一个连接,其中具有相同的列是

匹配。


干杯

Serge

-

Serge Rielau

DB2 SQL编译器开发

IBM多伦多实验室


So you want something similar to a "natural" join, just as a natural insert.

INSERT INTO T NATURAL SELECT x AS a, Y as b FROM T
with a and b being columns of T in some order.

Note that a natural join is a join in which columns with the same are
matched.

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab


Serge Rielau写道:
Serge Rielau wrote:
Bob Stearns写道:
Bob Stearns wrote:
这个可能是错误的论坛,但我认为它可能会开始讨论。

INSERT语句,以其当前的形式,有格式化的问题,所以人类的读者可以遵循它。特别是对于具有多列的表格,只有将值放在附近才能使列名称水平,这可能导致长度为1000的
字符行难以阅读和编辑。我希望看到的是INSERT语句中的可选语句,其语法类似于UPDATE语句的SET子句,它使
值与列名保持紧密接近,并且允许
合理长度的线条供人类阅读和编辑。很明显,这只是语法糖,因为新的语法不会给INSERT语句增加任何功能或功能。
This is probably the wrong forum for this, but I thought it might
start some discussion.

The INSERT statement, in its current form, has problems being
formatted so a human reader can follow it. In particular, for a table
with many columns, the only to put the values in close proximity with
the column names is horizontally, which can lead to lines of 1000s of
characters in length which are difficult to read and edit. What I
would like to see is an optional from of the INSERT statement with
syntax like the SET clause of the UPDATE statement, which keeps the
values in close proximity with the column names and also allows
reasonable length lines for human reading and editing. Clearly this is
just syntactic sugar because the new syntax does not add any power or
functionality to the INSERT statement.



所以你想要一些类似的东西天然的QUOT;加入,就像一个自然的
插入。

INSERT INTO T NATURAL SELECT x AS a,Y as b FROM T
a和b是某些顺序的T列。

请注意,自然连接是一个连接,其中相同的列匹配。

干杯
Serge



So you want something similar to a "natural" join, just as a natural
insert.

INSERT INTO T NATURAL SELECT x AS a, Y as b FROM T
with a and b being columns of T in some order.

Note that a natural join is a join in which columns with the same are
matched.

Cheers
Serge



这似乎正是我的想法。不幸的是,我可以在SQL参考手册或

信息中心的参考资料中找不到''NATURAL'的引用。你指出的行为是,当然是
所需的行为,但我想了解更多关于

NATURAL修饰符,特别是因为这不是一个连接。 />


That appears to be just what I was thinking about. Unfortunately, I can
find no reference to ''NATURAL'' either in the SQL Reference manuals or in
the reference material at the infocenter. The behavior you indicate is,
of course, the desired one, but I would like to read more about the
NATURAL modifier especially since this is not a join.


Bob Stearns写道:
Bob Stearns wrote:
这似乎正是我的想法。不幸的是,我可以在SQL参考手册中或在信息中心的参考资料中找不到''NATURAL'的引用。你指出的行为当然是理想的行为,但我想更多地了解一下
NATURAL修饰符,特别是因为这不是一个连接。
That appears to be just what I was thinking about. Unfortunately, I can
find no reference to ''NATURAL'' either in the SQL Reference manuals or in
the reference material at the infocenter. The behavior you indicate is,
of course, the desired one, but I would like to read more about the
NATURAL modifier especially since this is not a join.




是否还有UNNATURAL选择? ;-)


Dan

-

Daniel A. Morgan
http://www.psoug.org
da ****** @ x.washington.edu

(用你的x代替x)



Is there also an UNNATURAL select? ;-)

Dan
--
Daniel A. Morgan
http://www.psoug.org
da******@x.washington.edu
(replace x with u to respond)


这篇关于INSERT的语法糖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆