0

It is possible to create User Defined Functions in MySQL just as we do in excel, if Yes How to do the same.

Also, If above is possible then how do i correlate (have same usage) the MySql Function with my existing excel function pasted below:

Public Function HexToText(Text As Range) As String
Dim i As Integer
Dim DummyStr As String
For i = 1 To Len(Text) Step 2
If Val("&H" & (Mid(Text, i, 2))) > 31 Then DummyStr = DummyStr & 
Chr(Val("&H" & (Mid(Text, i, 2))))
DoEvents
Next i
HexToText = DummyStr
End Function

Please note that my Hex Data also contains Null (00) probable causing error while using Unhex

One example Values in Hex Column:

596f757220496e7465726e6574206163636f756e7420776974682044484c2042524f414442414e44204e4554205b505d204c494d4954454420686176696e6720757365726e616d652020414a57414454524156454c2077696c6c20657870697265206f6e20323031362d31302d30332032303a30303a313620506c656173652

Error Result Achieved via above UnHex command :

��W"��FW&�WB66�V�Bv�F�D��%$�D$�B�UB��ĔԕDTB�f��rW6W&��R�tEE$dT�v���W��&R��#b��2#��b�V6R

Actual Result should have been something like:

Your Internet account with DHL BROADBAND NET [P] LIMITED having username AJWDTRAVEL will expire on 2016-10-03 20:00:16

Cœur
  • 37,241
  • 25
  • 195
  • 267
vinay agarwal
  • 53
  • 1
  • 2
  • 8

0 Answers0