stored procedure

Results 1 to 2 of 2

Thread: stored procedure

  1. #1
    Join Date
    Dec 1969

    Default stored procedure

    Hi everyone i needed Urgent Help . I need to wirte a stored procedures that does the bad word checking and converting. The processing done in the function "ConvertBadWords" needs to be moved to a stored procedure instead to take the load off the asp. <BR>here is the code I need to wirte a stored procedure for <BR><BR>Sub GetBadWordList<BR><BR> set rsBadWords = Server.CreateObject("ADODB.Recordset")<BR> <BR> With rsBadWords<BR> .Source = "SELECT BadWord FROM CTBadWord"<BR> .ActiveConnection = cn<BR> .CursorLocation = adUseClient<BR> .CursorType = adOpenForwardOnly<BR> .LockType = adLockReadOnly<BR> .Open<BR> Set .ActiveConnection = Nothing<BR> End With<BR><BR>End Sub<BR><BR><BR>Function ConvertBadWords(Messg)<BR><BR> Dim BadWord<BR> Dim Asterisks<BR> Dim SearchExpression<BR> Dim BadWordLength<BR> Dim ConvertedMessage<BR> Dim RegX<BR> <BR> set RegX=new regexp<BR> <BR> BadWord=""<BR> Asterisks=""<BR> SearchExpression=""<BR> BadWordLength=0<BR> ConvertBadWords = Messg<BR> <BR> If not rsBadWords.EOF Then<BR> rsBadWords.MoveLast<BR> End If<BR> <BR> While not rsBadwords.BOF<BR> <BR> BadWord=rsBadWords("BadWord")<BR> Asterisks=GetAsterisks(BadWord)<BR> SearchExpression=GetSearchExpression(BadWord)<BR>< BR> with RegX<BR> .Pattern = SearchExpression<BR> .Global = True<BR> .IgnoreCase = True<BR>&#039; If .Test(ConvertBadWords) = True Then &#039;this makes it even slower!<BR> ConvertBadWords = .Replace(ConvertBadWords,Asterisks)<BR>&#039; End If<BR> end with<BR><BR> rsBadWords.MovePrevious <BR> <BR> Wend<BR> <BR> set RegX=nothing<BR><BR>End Function<BR><BR><BR>Function GetAsterisks(BadWord)<BR><BR> Dim i<BR> <BR> i=""<BR> GetAsterisks=""<BR> <BR> For i=1 to len(BadWord)<BR> GetAsterisks = GetAsterisks & "*"<BR> Next<BR><BR>End Function<BR><BR><BR>Function GetSearchExpression(BadWord)<BR><BR> Dim RegX<BR> <BR> set RegX=new regexp<BR> with RegX<BR> .Pattern = "W"<BR> .Global = True<BR> .IgnoreCase = True<BR>&#039; If .Test(BadWord) = True Then &#039;this makes it even slower!<BR> GetSearchExpression = .Replace(BadWord,"W")<BR>&#039; End If<BR> end with<BR> <BR> set RegX=nothing<BR><BR>End Function

  2. #2
    Join Date
    Dec 1969

    Default No regular expressions in SQL

    Best you could do would be textual replacement, and even that is DEAD SLOW. (And do you really want to convert every "Hello" into "[censored]o"???)<BR><BR>If you really want to pursue this, build an ActiveX component and invoke it from ASP.<BR><BR>I presume nobody has bothered to tell you what a waste of time this is?<BR><BR>Any phukkin person who gives a schitz can bypass dammed silly aasss toys like this.<BR><BR>(Sorry, but I wanted to make a couple of simple examples.)<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts