Professional Web Applications Themes

decrypt in a query not working? - Coldfusion - Advanced Techniques

i have to decrypt a value from a table on the fly, and cannot do it afterwards, since the result is going directly to an xml-output script. Why cant i put the decrypt function in a query? code: SELECT S_LAST_NAME, #decrypt(S_SSN,"someval")#, SOMETHING, etc. I keep getting S_SSN is not defined. it is defined. the query runs fine without the decrypt. How do I get a value to a function that does not think it is there?...

  1. #1

    Default decrypt in a query not working?

    i have to decrypt a value from a table on the fly, and cannot do it afterwards,
    since the result is going directly to an xml-output script. Why cant i put the
    decrypt function in a query?

    code:
    SELECT
    S_LAST_NAME,
    #decrypt(S_SSN,"someval")#,
    SOMETHING,
    etc.

    I keep getting S_SSN is not defined. it is defined. the query runs fine
    without the decrypt. How do I get a value to a function that does not think it
    is there?


    hudson Guest

  2. #2

    Default Re: decrypt in a query not working?

    This is a guess. You might think s_ssn is defined, but it isn't.
    <cfdump var="#s_ssn#"> right before your query tag will reveal all.


    Originally posted by: hudson
    i have to decrypt a value from a table on the fly, and cannot do it
    afterwards, since the result is going directly to an xml-output script. Why
    cant i put the decrypt function in a query?

    code:
    SELECT
    S_LAST_NAME,
    #decrypt(S_SSN,"someval")#,
    SOMETHING,
    etc.

    I keep getting S_SSN is not defined. it is defined. the query runs fine
    without the decrypt. How do I get a value to a function that does not think it
    is there?




    Dan Guest

  3. #3

    Default Re: decrypt in a query not working?

    that is not a lot of help.
    hudson Guest

  4. #4

    Default Re: decrypt in a query not working?

    Does that mean the cfdump was successful?

    Originally posted by: hudson
    that is not a lot of help.


    Dan Guest

  5. #5

    Default Re: decrypt in a query not working?

    Decrypt is a CFM function not a SQL function. S_SSN is not defined for CF
    until after the query successfully runs.
    And CF has no way of running a function while a SQL command is operating
    (except for some limited Query of query stuff).

    I was trying to think of a good ogy but have to get back to my paying
    job...

    Bottom line is you need to decrypt this using your database's encryption
    functions (if any).

    Or, failing that, you will have to loop through the encrypted query results
    and decode the values one row at a time.



    MikerRoo Guest

  6. #6

    Default Re: decrypt in a query not working?

    Thank you for that response. I am aware that the data was not there, but was
    curious as to whether a function would work directly. I was hoping that CF
    ps the query first. I see now that it does not. cfdump does work. Thanks.

    hudson Guest

Similar Threads

  1. PHP Update query not working
    By sharky92663 in forum Dreamweaver AppDev
    Replies: 1
    Last Post: May 6th, 02:06 AM
  2. Query not working
    By dkemens in forum Macromedia ColdFusion
    Replies: 28
    Last Post: April 15th, 06:13 PM
  3. sum in query not working. Help please.....
    By Joe Science in forum Macromedia ColdFusion
    Replies: 1
    Last Post: April 14th, 05:53 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139