Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

·ÀÖ¹Ò³ÃæÔÚÌøתµÄʱºò±»SQL×¢Èë

Ê×ÏÈдһ¸öSQL×¢Èë¹ýÂ˵ÄÀࣺ
public class SqlFilter
{
#region SQL×¢Èëʽ¹¥»÷´úÂë·ÖÎö
/// <summary>
/// ´¦ÀíÓû§Ìá½»µÄÇëÇó
/// </summary>
public void StartProcessRequest()
{
string getkeys = "";
string sqlErrorPage = "~/no.html";//תÏòµÄ´íÎóÌáʾҳÃæ
try
{
if (System.Web.HttpContext.Current.Request.QueryString != null)
{
for (int i = 0; i < System.Web.HttpContext.Current.Request.QueryString.Count; i++)
{
getkeys = System.Web.HttpContext.Current.Request.QueryString.Keys[i];
if (!ProcessSqlStr(System.Web.HttpContext.Current.Request.QueryString[getkeys]))
{
System.Web.HttpContext.Current.Response.Redirect(sqlErrorPage,false);
System.Web.HttpContext.Current.ApplicationInstance.CompleteRequest();
//System.Web.HttpContext.Current.Response.End();
}
}
}
if (System.Web.HttpContext.Current.Request.Form != null)
{
for (int i = 0; i < System.Web.HttpContext.Current.Request.Form.Count; i++)
{
getkeys = System.Web.HttpContext.Current.Request.Form.Keys[i];
if (getkeys == "__VIEWSTATE") continue;
if (!ProcessSqlStr(System.Web.HttpContext.Current.Request.Form[getkeys]))
{
System.Web.HttpContext.Current.Response.Redirect(sqlErrorPage,false);
System.Web.HttpContext.Current.ApplicationInstance.CompleteRequest();
//System.Web.HttpContext.Current.Response.End();


Ïà¹ØÎĵµ£º

SQL¡¢PL/SQLѧϰ±Ê¼Ç


 
1£®SQL²¢Ðвéѯ
alter session enable parallel dml execute immediate 'alter session enable parallel dml'; --Ð޸ĻỰ²¢ÐÐDML      select /*+parallel(a,4)*/ * from table_name a       select /*+parallel(a,8)*/ * from table_name a &nbs ......

SQL ConvertµÄÓ÷¨

CONVERT º¯Êý [Êý¾ÝÀàÐÍת»»]
--------------------------------------------------------------------------------
¹¦ÄÜ 
·µ»Øת»»³ÉÌṩµÄÊý¾ÝÀàÐ͵ıí´ïʽ¡£
Óï·¨ 
CONVERT ( data type, expression [ , format-style ] )
²ÎÊý 
data&nbs ......

SQL ³£ÓÃÓï¾ä

(1)Êý¾Ý¼Ç¼ɸѡ£º
sql="select*fromÊý¾Ý±íwhere×Ö¶ÎÃû=×Ö¶ÎÖµorderby×Ö¶ÎÃû[desc]"
sql="select*fromÊý¾Ý±íwhere×Ö¶ÎÃûlike'%×Ö¶ÎÖµ%'orderby×Ö¶ÎÃû[desc]"
sql="selecttop10*fromÊý¾Ý±íwhere×Ö¶ÎÃûorderby×Ö¶ÎÃû[desc]"
sql="select*fromÊý¾Ý±íwhere×Ö¶ÎÃûin('Öµ1','Öµ2','Öµ3')"
sql="select*fromÊý¾Ý±íwhere× ......

sqlÃüÁî¡¢º¯Êý

--Óï ¾ä ¹¦ ÄÜ 
--Êý¾Ý²Ù×÷ 
SELECT --´ÓÊý¾Ý¿â±íÖмìË÷Êý¾ÝÐкÍÁР
INSERT --ÏòÊý¾Ý¿â±íÌí¼ÓÐÂÊý¾ÝÐР
DELETE --´ÓÊý¾Ý¿â±íÖÐɾ³ýÊý¾ÝÐР
UPDATE --¸üÐÂÊý¾Ý¿â±íÖеÄÊý¾Ý 
--Êý¾Ý¶¨Òå 
CREATE TABLE --´´½¨Ò»¸öÊý¾Ý¿â±í 
DROP TABLE --´ÓÊý¾Ý¿âÖÐɾ³ý±í 
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ