Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2013

    Unanswered: Newbie Needs some help!

    I have a table that has multiple columns, but what I'm trying to do is stumping me.

    In the ATTRIBUTES column, I need the following entry: (just as it is, quotes and all)

    <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE properties SYSTEM ""><properties><entry key="BUYCREDIT">0.8</entry><entry key="BUYCASH">0.15</entry></properties>

    I need it to generate with a trigger based on two other columns in the table. The 0.8 is in the column "credittradevalue" while the 0.15 is in the column called "cashtradevalue"

    I would appreciate any help with this!!

  2. #2
    Join Date
    Sep 2009
    San Sebastian, Spain
    Firstly, I am not sure why you would need this generated and stored in the database. Surely your application should be doing this dynamically using the credittradevalue and cashtradevalue fields.

    If you really do need to store this in the database then have a look at the CONCAT function:

    SELECT CONCAT('<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE properties SYSTEM ""><properties><entry key="BUYCREDIT">', credittradevalue, '</entry><entry key="BUYCASH">', cashtradevalue, '</entry></properties>')
    FROM yourtable;
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    Follow me on Twitter

  3. #3
    Join Date
    Jan 2013
    You're probably right, but we don't have the knowledge/skills to make the changes to the application, so we are going to forge ahead blindly with the "hit it in the head with a hammer until we make it do what we want it to" method.

Posting Permissions

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