A. sql语句的using到底什么用法
SQL中是没有USING的,我想你指的是PL/SQL吧。
他是给bind变量传入值用的,比如:
for
i2
in
1..1000
loop
execute
immediate
'select
*
from
tablex
where
id=:1'
using
i2;
end
loop;
这个语句被执行1000次,每次查询条件不一样,但是该语句只被parse一次
B. sql语句中using index是什么意思
USING INDEX可以让你在创建主键、唯一性约束的时候使用指定的索引或创建索引、或修改索引的存储结构。
官方解释:
Using Indexes to Enforce Constraints
When defining the state of a unique or primary key constraint, you can specify an index for Oracle to use to enforce the constraint, or you can instruct Oracle to create the index used to enforce the constraint.
using_index_clauseYou can specify theusing_index_clause only when enabling unique or primary key constraints. You can specify the clauses of theusing_index_clause in any order, but you can specify each clause only once.
If you specify schema.index, then Oracle attempts to enforce the constraint using the specified index. If Oracle cannot find the index or cannot use the index to enforce the constraint, then Oracle returns an error.
If you specify the create_index_statement, then Oracle attempts to create the index and use it to enforce the constraint. If Oracle cannot create the index or cannot use the index to enforce the constraint, then Oracle returns an error.
If you neither specify an existing index nor create a new index, then Oracle creates the index. In this case:
The index receives the same name as the constraint.
If table is partitioned, then you can specify a locally or globally partitioned index for the unique or primary key constraint.
Restrictions on theusing_index_clauseThe following restrictions apply to theusing_index_clause:
You cannot specify this clause for a view constraint.
You cannot specify this clause for a NOT NULL, foreign key, or check constraint.
You cannot specify an index (schema.index) or create an index (create_index_statement) when enabling the primary key of an index-organized table.
You cannot specify the domain_index_clause of index_properties or theparallel_clause ofindex_attributes.
希望能帮到您
C. oracle中的using怎么用啊
V_SQLSTR
:=
'INSERT
INTO
'
||
V_TABLENAME
||
'('
||
'
SELECT
DISTINCT
KBP,KPI_NO,DCTIME,:1
WRITETIME,TO_NUMBER(VALUE)
'
||
'
FROM
BIZMAN_PM_TEMP
)';
这是一个动态的SQL,即通侍洞局过EXECUTE
IMMEDIATE来执行一个字符串的SQL,而这里面老让通过冒号开头的是参数,EXECUTE
IMMEDIATE后边USING的顺序就是里面参数的顺序。您这里面对应的就是:1,即把V_CURRENTTIME的值代入到冒号1的位置,执行这个插入语句。
USING
OUT:如果动态SQL中有一个过程,而该过程的有个OUT
参数,此时就可以用USING
OUT
的方颤茄式
D. sql server 有using语句吗
SQL sever是不支持using的用法,
SQL sever只能用复杂的写法,其实也大概理解为c++,和Python的区别,c++中各种声明和规则对初学者非常不友好,Python相对来说没有严格的定义规则,就简单点,
oracle和MySQL都是支持using的,就是为了简化join语句的优化,
E. .NET中using(SqlConnection conn = new SqlConnection(connectionStr))解释这种using用法什么意思
using是一种方便的简写形式。当某个类型实现了IDisposable接口时,在使用这样的类型时就可以用using。它等价于:
SqlConnection conn = new SqlConnection(connectionStr);
....
conn.Dispose();//这个Dispose就是从IDisposable接口实现的方法。这个方法一般做一些清理工作