#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2014
    Posts
    11
    Rep Power
    0

    Encrypt SQL column using Stored Procedure


    Having trouble passing variables from <cfstoredproc>

    The stored procedures work in SQL, just encrypting and decrypting a column of text. And I can retrieve the data in cold fusion calling the stored procedure to decrypt the text. But when I try to write data I keep getting an error telling me I need to use convert, the <cfprocparam> type is cf_sql_varchar, but the data type in the table is varbinary. Don't know why I need to convert since I thought that's what the encryption is doing, plus I don't need to use convert in SQL when I run an insert query. Searching the internet hasn't really given me what I need, I know it's just something simple I'm missing, hope someone here might have some experience with this and can point me in the right direction.

    I've only been working with Cold Fusion for a little while so please don't assume I know what I'm doing.

    Thanks
  2. #2
  3. No Profile Picture
    Moderator

    Join Date
    Jun 2002
    Location
    Raleigh, NC
    Posts
    5,307
    Rep Power
    971
    Well first, does just changing the type to "CF_SQL_VARBINARY" work?

    If not, I assume the reason it works calling the stored proc directly in SQL is some sort of implicit conversion. In the stored procedure code itself, is the type for that parameter set to "varchar"? Or is it set to "varbinary"? I'm fairly sure the JDBC binding is based on the types declared for the stored proc's parameters.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2014
    Posts
    11
    Rep Power
    0
    Thanks Kiteless, I figured it out. I had some <cfquery> code on the action form that was causing the issue. Missed getting rid of that code when I added the <cfstoredproc> code, so I'm good for now.

    Working on my first CF app at work to store local admin and service account passwords so I'm sure there will be more posts to come.

    Mahalo

IMN logo majestic logo threadwatch logo seochat tools logo