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介面實現的方法。這個方法一般做一些清理工作