Implement IndexOf and LastIndexOf features in Oracle SQL, substr and InStr Usage Blog Category: Oraclepl/sql instrsubstrlastindexofindexoforacle. Implementing IndexOf and LASTINDEXOF capabilities in Oracle SQL Oracle, SQL, INDEXOF, lastIndexOf today, there is a problem that requires a string that is formatted as 1_2_3 to be split into 1_3 strings, Use SQL to update the database. In Oracel, this function can be implemented with the SUBSTR and
Generic anti-SQL Injection code ASP edition
Code
Dim sql_injdata
Sql_injdata = "' |and|exec|insert|select|delete|update|count|*|%| Chr|mid|master|truncate|char|declare "
Sql_inj = Split (Sql_injdata, "|")
If request.querystring
For each sql_get in Request.QueryString
For Sql_data=0 to Ubound (Sql_inj)
If InStr (Request.QueryString (Sql_get), Sql_inj (sql_data)) >0 Then
' Response.Write (Request.QueryString)
Response.Write ""
Response.End
E
= CsetBytestobstr = objstream. ReadTextObjstream. CloseSet objstream = NothingEnd Function
Public Sub Steal () ' The HTML code/method that steals the destination URL addressIf src_Dim HttpSet Http=server.createobject ("MSXML2. XMLHTTP ")Http.open "Get", Src_, FalseHttp.send ()If Http.readystateExit SubEnd IfValue_=bytestobstr (Http.responsebody, "GB2312")isget_= TrueSet http=nothingIf Err.numberElseResponse. Write (")End IfEnd Sub
' Delete the inside of the stolen content of the line, carriag
ASP SQL Super Anti-injection code
Dim s_badstr, N, IS_badstr = "' n = Len (S_BADSTR)Safe = TrueFor i = 1 to nIf Instr (str, Mid (S_BADSTR, I, 1)) > 0 ThenSafe = FalseExit FunctionEnd IfNextEnd Function' The following code directly determines whether the URL in which the request occurred contains illegal charactersOn Error Resume NextDim strtemp
If LCase (Request.ServerVariables ("HTTPS") = "Off" Thenstrtemp = "http://"Elsestrtemp = "https://"End Ifs
Label:1. Building a basic environment Inserting test data Insert into JGDM (JGDM,JGMC) VALUES (' 12300000000 ', ' Henan province ');Insert into JGDM (JGDM,JGMC) VALUES (' 12300000005 ', ' Henan province Zhengzhou ');CommitInsert into JGDM (JGDM,JGMC) VALUES (00300000000, ' Chongqing ');Insert into JGDM (JGDM,JGMC) VALUES (00300000001, ' Zhongqing Shizhu ');Insert into JGDM (JGDM,JGMC) VALUES (00300000004, ' Chongqing Qijiang District ');Commit 2. Sub-Situation Update form DeclareBeginFor V_JGMC
Function
' Test file
Sub Scanfile (FilePath, InFile)
If InFile Infiles = "End If
temp = FilePath
On Error Resume Next
Set Tstream = WScript.CreateObject ("ADODB. Stream ")
Tstream.type = 1
Tstream.mode = 3
Tstream.open
Tstream.position=0
Tstream.loadfromfile FilePath
If Err Then Exit Sub End If
Tstream.type = 2
Tstream.charset = "GB2312"
Do Until Tstream.eos
Filetxt = filetxt amp; LCase (replace (Tstream.readtext (102400), Chr (0), ""))
Loop
Tstream.close ()
Set Tstream = N
Label:Fuzzy queries are frequently used in database queries, and are commonly used in the following formats: (1) field like '% keyword% ' field contains ' keyword ' records even if the target field is indexed and not indexed, the slowest (2) field like ' Keyword% ' field records starting with "keyword" can be used in ascending index established in target Field (3) The record of the field like '% keyword ' field ending with ' keyword ' can use descending index established to target Field For the
Interface Display:Encryption:Decrypt:Code implementation:public string encryptstring (String str){#regionEncryption Programchar[] Base64code = new char[] {' A ', ' B ', ' C ', ' d ', ' e ', ' f ', ' g ', ' h ', ' I ', ' j ', ' K ', ' l ', ' m ', ' n ', ' o ', ' P ', ' Q ', ' R ', ' s ', ' t ', ' u ', ' V ', ' w ', ' x ', ' y ', ' z ', ' A ', ' B ', ' C ', ' D ', ' E ', ' F ', ' G ', ' H ', ' I ', ' J ', ' K ', ' L ', ' M ', ' N ', ' O ', ' P ', ' Q ', ' R ', ' S ', ' T ', ' U ', ' V ', ' W ', '
in one group.
// The method is to convert the data into ASCII codes, arrange the 24-bit data in order, and then divide the 24-bit data into 4 groups, that is, 6-bit data in each group. Add two zeros before the highest bits in each group to make up one byte.
outmessage=newSystem.Text.StringBuilder(page*4);
for
(inti=0;i
{
// Obtains a group of three bytes.
byte
[]instr=newbyte[3];
instr[0]=(
byte
)byteMessa
'******************************
' Function Checkip (CINPUT_IP,CBOUND_IP)
' Created by Qqdao, Qqdao@263.net 2001/11/28
' Description: First you need to be based on the number loop, and then determine if there is a "-", if there is a split processing, and finally determine whether in the scope
' Parameters: Cinput_ip, Ip on behalf of check
' Cbound_ip, given a range of formats, a single IP, and range IP, the range IP last used "-" split, if it is "*" must be put to the last
' After each range add
Data | Database ' Call method is:function Safe (str) ' It is used to determine whether a variable passed over contains special characters and does not return true
Dim s_badstr, N, I
S_badstr = "' n = Len (S_BADSTR)
Safe = True
For i = 1 to n
If Instr (str, Mid (S_BADSTR, I, 1)) > 0 Then
Safe = False
Exit Function
End If
Next
End Function
' The following code directly determines whether the URL in which the request occurred contains illegal characters
Instr (Csingle_ip (i), "refuse") Ctemp_ip = Left (Csingle_ip (i), InStr (Csingle_ip (i), ":")-1)
If Instr (ctemp_ip, "*") Cstart_ip = Left (Ctemp_ip,instr (CTEMP_IP, "*")-1)
If left (Cinput_ip,len (CSTART_IP)) =cstart_ip Then
Checkip = False
Exit function
End If
End If
If Instr
Core code:
Copy Code code as follows:
/**
* Jscript.string Package
* This package contains utility functions for working with strings.
*/
if (typeof JScript = = ' undefined ') {
JScript = function () {}
}
jscript.string = function () {}
/**
* This function searches a string for another string and returns a count
* How-many times the second string appears in the
* (returns the number of occurrences of a substring in a string)
* @param
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.