I don't know the answer but:<div><br></div><div>It's possible that UCCX does not support variables inside of sql functions such as this. One way to test that is to remove $sCCNumber, and replace it with a String literal such as "00000000000000" and see if that works. If it does, then it's a problem with using variables inside of functions. You did say you can insert $sCCNumber if you don't use the function correct?</div>
<div><br></div><div>It's also possible that UCCX expects a document when using this sql function. So create a new Document variable and cast your sCCNumber like this as a test:</div><div><br></div><div>Set myDocumentVariable = (Document) sCCNumber</div>
<div><br></div><div>Anthony<br><br><div class="gmail_quote">On Wed, Aug 4, 2010 at 4:22 PM, Teixeira, Mike <span dir="ltr"><<a href="mailto:mwteixeira@bendbroadband.net">mwteixeira@bendbroadband.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">Hello,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I am trying to use encryptbypassphrase an SQL 2005 SQL
encryptiong with our UCCX 7.0 installation. The DB-Write is throwing an ArrayindexOutOfBounds
Exception. I used to use a bitwise operation to store the data but this seems so
much cleaner and secure. </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">When I view the db-fields using the DB-Write method the column
in question(CCNumber) is showing up as a com.cisco.doc.Document. While the
column is actually a varbinary(50). If I remove the encryptbypassphrase line
from the SQL statement the data inserts without error. The variable that I am
passing the encryptbypassphrase statement, is a string. I have tried a string, and
a bigint. Do I need to create a document object variable for this to work? If
so, how do I cast a string to the document variable? Can I even cast a string
to a document variable?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Mike</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Here is the SQL Statement.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:blue">INSERT</span><span style="font-size:10.0pt;font-family:"Courier New""> <span style="color:blue">INTO</span> PayByPhone </span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:gray">(</span><span style="font-size:10.0pt;font-family:"Courier New"">house<span style="color:gray">,</span> cust<span style="color:gray">,</span> CCNumber<span style="color:gray">,</span>
CCExpMonth<span style="color:gray">,</span> CCExpYear<span style="color:gray">,</span>
PaymentAmount<span style="color:gray">,</span> Processed<span style="color:gray">,</span> SubmittedOn<span style="color:gray">)</span></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:blue">VALUES</span><span style="font-size:10.0pt;font-family:"Courier New""> <span style="color:gray">(</span>$LHouse<span style="color:gray">,</span> $iCust<span style="color:gray">,</span> </span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:"Courier New";color:fuchsia">ENCRYPTBYPASSPHRASE</span><span style="font-size:10.0pt;font-family:"Courier New";color:gray">(</span><span style="font-size:10.0pt;font-family:"Courier New";color:red">'thisismypassphraseNotreallyIchangedit'</span><span style="font-size:10.0pt;font-family:"Courier New";color:gray">,</span><span style="font-size:10.0pt;font-family:"Courier New"">$sCCnumber<span style="color:gray">),</span> </span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">$LCCExpMonth<span style="color:gray">,</span> $LCCExpYear<span style="color:gray">,</span>
$dblPaymentAmount<span style="color:gray">,</span> <span style="color:red">'0'</span><span style="color:gray">,</span> <span style="color:fuchsia">GETDATE</span><span style="color:gray">());</span></span></p>
</div>
</div>
<br>_______________________________________________<br>
cisco-voip mailing list<br>
<a href="mailto:cisco-voip@puck.nether.net">cisco-voip@puck.nether.net</a><br>
<a href="https://puck.nether.net/mailman/listinfo/cisco-voip" target="_blank">https://puck.nether.net/mailman/listinfo/cisco-voip</a><br>
<br></blockquote></div><br></div>