Skip to main content
March 16, 2016
Question

How to load JSON file or CSV file into oracle database using ColdFusion ? Please tell me ASAP

Hi ColdFusion Team,

How to load JSON file or CSV file into oracle database using ColdFusion ? Please tell me ASAP

Thanks in Advance

    Ce sujet a été fermé aux réponses.

    1 commentaire

    WolfShade
    Legend
    March 16, 2016

    That depends.  You can very easily insert the JSON or CSV data as a string into a varchar or text datatype on the database, no problem.

    However, if you need the JSON or CSV to be in an array (like a query object) so that it can be inserted into the database, then how the data was "flattened" would matter.

    I avoid CSV, if at all possible.  Never liked it.

    However, if you are using CF to create the JSON (or if you manually piece it together in JavaScript and it follows the CF format), then you should be able to use DeserializeJSON() to put it back into a query object and append the data into a database relatively easily.

    HTH,

    ^_^

    PS:  I just noticed that you addressed your post to "ColdFusion Team".  Just to make sure, the people at Adobe don't officially monitor these forums - these forums are primarily a user-to-user interaction.  Although sometimes Adobe staff do check in here to see what's going on.

    March 16, 2016

    Hi WolfShade,

    *Could you please send me the total script code to load data from json/csv

    file to oracle database using cold fusion scripts*

    *Hope you do well reply me please ASAP *

    Thanks in advanceOn Wednesday, March 16, 2016, WolfShade <

    March 17, 2016

    There are online resources that can point you in the right direction.  If you take a query object, and use SerializeJSON() on it, be sure to use the argument that allows CF to automatically convert it back to a query object, then CFDUMP the result, you can see the format that CF uses (which is different from JavaScript JSON format), and can build your JSON from scratch based upon that format.  I've done it.. it's a little extra coding, but worth the effort, IMHO.

    HTH,

    ^_^


    Hi WolfShade,

    Can you provide the sample code or related links it I'll very helpful to me

    Thanks in advance