Reading content to insert into a database for file content searches

I have a new challenge that has been brought to me.
There is and existing application that has files being inserted into the database and the customer is having great difficulty in being able to have a search capability against those files. I was thinking that I could do a secondary lookup before the file is actually uploaded and there would be use of the cffile to read the file then insert that data from the read and insert that data into a column of that database the equiled that record. The most important part of this is that the file's content is read from cffile and inserted into a column that actually get's that data into the RBDMS system that will allow for a full text search that would point to that system.
Any other ideas of how to insert document content into a data record other than using the cffile tag would be most appreciated.
Thanks in advance.
Gene

Most, if not all, database management systems have their own features to read text data from files.  You may prefer that functionality over piping the data through ColdFusion and the database drivers.
<cffile...> can "read" .doc and .pdf file as in it can read the file from the file system as the binary data they are, but that does not extract the text from the content.  You can do some stuff with CFML to read the text in a pdf file with the <cfpdf...> and related tags and functions.  I'm not aware of similar CFML features that work with doc files, but I know of Java tools that do such as POI.  These are usually fairly straight forward to tap into with ColdFusion.

Similar Messages

  • How to execute a Java method when row inserted into a database table?

    I have the need to fire off a java method when a row is inserted into a database table. I am unfortunately working with MySQL which just recently supported triggers but these new triggers can not execute a Java application on any event.
    What I am looking for is an event driven approach such that when a row is inserted into a specific table I can fire off a java method (sitting in a tomcat container) that will take the contents and send it to a web service.
    It has been mentioned that JMS may have the ability to poll and monitor a database table. Just wondering if anyone could point me in the right direction.
    thanks
    JavaTek

    A service handler might be the right way to run some code at the end of a service call (another way would be to make use of filters).
    First, make sure your static table is merged with ServiceHandlers.
    Secondary, change your custom method name into one that is not already in the service definition of COLLECTION_COPY_LOT (preferably a unique method name like collectionCopyLotLastAction that describes its purpose) and remove the following line from your code:
    m_service.doCodeEx("",this);Now create a service definition for COLLECTION_COPY_LOT in your custom component based on the original COLLECTION_COPY_LOT (copy paste from the original service definition) and add you own method collectionCopyLotLastAction as the last step in the service. Play with the load order to make sure CS is using your service definition of COLLECTION_COPY_LOT instead of the original.
    regards,
    Fabian

  • Get the data  from excel and insert into the database

    I want to read the data from excel file, get the data from excel and insert into the database.

    You can use the Apache POI HSSF API to read data from Excel files and you can use the Sun JDBC API to insert data in database.
    This has nothing to do with JSP/JSTL.

  • Insert into SQL database

    Hi,
    I am using xMII v 11.5..I need to insert into SQL database.
    In BLS
    Step 1:I am using an SQL Query1 it fetches data
    Step 2:  I am using 4 calculation Action block to calculate the values
    Step 3: I am inserting the Calculated values using an SQL Query2
    In the links when i evaluate its showing the value but when i check in the SQL Database it has inserted zeros...
    I found that the first Query is not returning anything if i have set the Date condition in where clause...
    Regards
    Sweety
    Edited by: sweety_VA on Apr 25, 2011 7:32 AM

    Hi Sweety,
    Can you provide some more information? 
    The script for each of your queries.  (looking especially at how you are using single quotes around the Param properties for different data types)
    Are you using an Command SQL Query for the insert?
    Why are you using the Calculation action block instead of using the Expression Editor for the calculation?
    Regards,
    Mike

  • Error when inserting into dynamically created filename-file

    Howry
    Am am receiving the following error when i am trying to insert into a file that have a dynamic filename (through declared variable, as date etc.).
    I presume it is trying to look for the target file with the same name as the dynamic value passed through by the variable, but cannot find it- can anyone tell me how i can rather create the file as appose to insert into an already created file..?
    Your help in this regard is much appreciated.
    Here is the error:
    ODI-1217: Session SAPO_hlr_suburbs (1577001) fails with return code 7000.
    ODI-1226: Step 6_Ins_final fails after 1 attempt(s).
    ODI-1240: Flow 6_Ins_final fails while performing a Integration operation. This flow loads target table #l_date.unl.
    ODI-1228: Task 6_Ins_final (Integration) fails on the target FILE connection SAPO_HLR_SUBURBS.
    Caused By: java.sql.SQLException: File C:\Files\Gero work\ODI In Files\SAPO_HLR_SUBURBS/2012-01-24 12:06:13.463.unl was not found
         at com.sunopsis.jdbc.driver.file.FileConnection.prepareForWriting(FileConnection.java:339)
         at com.sunopsis.jdbc.driver.file.impl.commands.CommandInsert.execute(CommandInsert.java:50)
         at com.sunopsis.jdbc.driver.file.CommandExecutor.executeCommand(CommandExecutor.java:33)
         at com.sunopsis.jdbc.driver.file.FilePreparedStatement.executeUpdate(FilePreparedStatement.java:138)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java:665)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeUpdate(SnpSessTaskSql.java:3218)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java:1785)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java:2805)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java:68)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2515)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:534)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:449)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1954)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:322)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:224)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:246)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:237)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:794)
         at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:114)
         at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
         at java.lang.Thread.run(Thread.java:619)

    What operating system are you using?
    The name of your file has the time within it , you cant have a filename with ':' in it on Windows.
    Try using ALPHANUMERIC datatype for the variable and pull the current datetime as a char with something like :
    select to_char( sysdate ,'YYYY-MM_DD HHMISS') from dual

  • Hi, extract data from xml file and insert into another exiting xml file

    i am searching code to extract data from xml file and insert into another exiting xml file by a java program. I understood it is easy to extract data from a xml file, and how ever without creating another xml file. We want to insert the extracted data into another exiting xml file. Suggestions?
    1st xml file which has two lines(text1.xml)
    <?xml version="1.0" encoding="iso-8859-1"?>
    <xs:PrintDataRequest xmlns:xs="http://com.unisys.com/Anid"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://com.unisys.com/Anid file:ANIDWS.xsd">
    <xs:Person>
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://com.unisys.com/Anid file:ANIDWS.xsd">
    These two lines has to be inserted in the existing another xml(text 2.xml) file(at line 3 and 4)
    Regards,
    bubbly

    Jadz_Core wrote:
    RandomAccessFile? If you know where you want to insert it.Are you sure about this? If using this, the receiving file would have to have bytes inserted that exactly match the number of bytes replaced. I'm thinking that you'll likely have to stream through the second XML with a SAX parser and copy information (or insert new information) as you stream with an XML writer of some sort.

  • Extract data from xml file and insert into another exiting xml fil

    hello,
    i am searching extract data from xml file and insert into another exiting xml file by a java program. I understood it is easy to extract data from a xml file, and how ever without creating another xml file. We want to insert the extracted data into another exiting xml file. Suggestions?
    Regards,
    Zhuozhi

    If the files are small, you can load the target file in a DOM document, insert the data from the source file and persist the DOM.
    If the files are large, you probably want to use a StAX or SAX.

  • Blogs for File content conversion in File Adapter

    hi all,
    Can some one give me the links for File Content Conversion for File to File Scenario. please.
    Thanks in advance.

    Hi
    For Sender
    /people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
    /people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter
    /people/sap.user72/blog/2005/01/06/how-to-process-csv-data-with-xi-file-adapter
    /people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file
    SAP Help for sender
    http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm
    For Receiver:
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion
    SAP Help for receiver
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm

  • NULL values are inserted into interface table for read only columns

    Hi, I developed a custom Integrator where some of the columns has to be displayed as read only in the layout. I am using SQL content to populate the data. When I upload the data NULL values are inserted into table interface? Is there any work around for this?
    Thanks
    Edited by: user593879 on Jan 12, 2010 7:21 PM

    Doesn't WebADI drive you insane at times?
    I must say, when it's all working it looks great and it is very user friendly (end-user that is, NOT for developers!) but before you get to that stage… please please Oracle invest some time making Web ADI a bit more logical an coherent, get the obvious bugs out, please let us not have to update BNE tables anymore to get things done.
    Anyway, I sorted this one out by setting the Width to zero (0) in the Layout. HTH.

  • Any way to insert into a database clob other than streaming chars ?

    I have a jsp with a textarea object which I am inserting into an Oracle clob.
    I am using the thin driver.
    I have a problem in that if it is quite large (say over 2K) it falls over with "connection reset by peer" I think this may be because you aren't supposed to use this method with the thin driver, but I don't want to use OCI.
    So is there any other way to insert my text into the database without having to explicitly select the row first for update as this is essentially a new insert so doing it like this I would have to first of all insert the other columns then reselect the row for update of the clob.
    Thanks.

    Most, if not all, database management systems have their own features to read text data from files.  You may prefer that functionality over piping the data through ColdFusion and the database drivers.
    <cffile...> can "read" .doc and .pdf file as in it can read the file from the file system as the binary data they are, but that does not extract the text from the content.  You can do some stuff with CFML to read the text in a pdf file with the <cfpdf...> and related tags and functions.  I'm not aware of similar CFML features that work with doc files, but I know of Java tools that do such as POI.  These are usually fairly straight forward to tap into with ColdFusion.

  • Using a variable to insert into a URL for redirecting clients

    I got a good one, can anyone help on this?
    Using RoboHelp Version 8.02.208.
    My company uses MicroStrategy to deploy several web-based data analysis products.
    Each of these data products (there are 5) are deployed on different servers.
    I have set up a single source WebHelp project and use build tags for product specific help output.
    (I also have to modify the Start Page, TOC and Default Topic settings prior to generating each product help)
    Everything on this works fine and is not a problem.
    We have just implemented an Excel add-in for one of the products.
    That add-in uses a locally installed CHM file for its help.
    In order to provide customized help that can be updated without forcing the clients to reinstall the CHM help file locally, the source for the CHM file has one dummy topic. In that topic, I have used HTML code to redirect the client to the WebHelp for the product and have integrated the Excel add-in help to that product’s customized help. The result is that the CHM file is opened locally in the HTML help viewer. Inside the HTML help viewer window, I open the WebHelp.
    The redirect HARD CODES the URL with the product specific server name and Start Page help topic.
    That works fine and is not a problem for ONE PRODUCT.
    We are in the process of adding this Excel add-in to other products.
    Now here is where I cannot get this to work with my implementation.
    The URL for each product is different and to make matters worse, the Start Page is different for each product as well.
    So, I am working on options for implementation of multiple products and here is my question:
    (1)    The following is an example of the redirect in the single topic of the CHM file:
    <meta http-equiv="refresh" content="0;URL=https://server.com/ProductName/WebHelp/StartPage.htm#mergedProjects/ExcelPlugIn/ Overview.htm" />
    (2)    The red portion of the URL above will need to be modified to support each individual product with a custom server, product name and start page HTM file name.
    Is there a way to:
    (1)    Add a variable in this HTML code
    (2)    Once the product is identified, update the variable with the product specific URL content
    (3)    Integrate the variable into the target URL of the HTML code that does the redirect
    I think this is either not possible or more work than needed. My other option is to provide standalone Excel add-in help on a server and just have the Excel plug-in go to that (right now it is integrated into the product specific help and the client has access to the plug-in help AND the application help all at the same place).
    Thanks to all in advance for any help/suggestions.
    Michael F Weart
    [email protected]

    Thanks for the feedback - here is more informtion on the challenges of this implementation:
    I can only distribute one CHM file to cover all 5 web-based products that can be accessed through the Excel plug-in.
    Regardless of which of our 5 products is used to install the plug-in on the client's local hard drive, the same installer is used.
    That one CHM file is installed locally on the client's hard drive.
    (The out of the box CHM file for the plug-in only has general plug-in help content the locl install causes problems for updating the content).
    We needed to be able to easily update the help without inconveniencing the clients.
    So, I am not creating 5 different CHM files for each installer, since there is only one installer regardless of how many of the 5 products they have.
    The plug-in has a server setting and web service setting for each product and the client must choose which they are accessing when they fire up the plug-in.
    They may be accessing the plug-in for any of our 5 web-based products they have subscriptions for.
    Which means, the one CHM file must be able to:
    (1) determine the product they are accessing
    (2) direct to one of the 5 servers with the online help.
    Each of the 5 online helps are deployed on separate servers with different URL links (and the helps have all different URL links as well).
    These online webhelp outputs have some identical content but also some customized content for the specific product they are actually accessing.
    My original approach was pretty much the same as William's above. Have a variable in the CHM help, determine the server they are accessing from the plug-in and insert the customized portion of the URL to access the appropriate webhelp.
    Keep the ideas/suggestions coming.
    I also have a development person looking into how to update a variable on the CHM side to populate the URL.
    Michael F Weart
    [email protected]

  • Insert into Oracle Database using C#

    Hi Everyone,
    I am trying to take data from text box and list box and then insert them to Oracle database:
    Text box data:
    Oracle = EMPLOYEE_NAME
    C# = tbEmployeeName
    List box data:
    Oracle = EMPLOYEE_GENDER
    C# = lbEmployeeGender
    Here is my code in C#, can you guys help me with insert statement:
    string oradb = "Data Source= oraDB;User Id=sm;Password=mypassword;";
    OracleConnection conn = new OracleConnection(oradb);
    conn.Open();
    OracleCommand cmd = new OracleCommand();
    cmd.Connection = conn;
    cmd.CommandText = "Insert into USER.EMPLOYEE VALUES (tbEmployeeName.Text, lbEmployeeGender.Text)";
    int rowsUpdated = cmd.ExecuteNonQuery();
    if (rowsUpdated == 0)
    MessageBox.Show("Record not inserted");
    else
    MessageBox.Show("Success!");
    conn.Dispose();
    Thanks!

    989630 wrote:
    Hi Everyone,
    I am trying to take data from text box and list box and then insert them to Oracle database:
    Text box data:
    Oracle = EMPLOYEE_NAME
    C# = tbEmployeeName
    List box data:
    Oracle = EMPLOYEE_GENDER
    C# = lbEmployeeGender
    Here is my code in C#, can you guys help me with insert statement:
    string oradb = "Data Source= oraDB;User Id=sm;Password=mypassword;";
    OracleConnection conn = new OracleConnection(oradb);
    conn.Open();
    OracleCommand cmd = new OracleCommand();
    cmd.Connection = conn;
    cmd.CommandText = "Insert into USER.EMPLOYEE VALUES (tbEmployeeName.Text, lbEmployeeGender.Text)";
    int rowsUpdated = cmd.ExecuteNonQuery();
    if (rowsUpdated == 0)
    MessageBox.Show("Record not inserted");
    else
    MessageBox.Show("Success!");
    conn.Dispose();
    Thanks!Hi,
    You'll want to read up on using parameters (also known as bind variables) - these are critical for scalability in an OLTP-type system and helping guard against SQL Injection attacks. There's many sources out there, but here's a link to the Parameter Binding section in the ODP.NET Developer's Guide which is probably a good thing to become familiar with:
    http://docs.oracle.com/cd/E11882_01/win.112/e23174/featOraCommand.htm#i1007242
    Here's your sample using bind variables:
    string oradb = "Data Source= oraDB;User Id=sm;Password=mypassword;";
    OracleConnection conn = new OracleConnection(oradb);
    conn.Open();
    OracleCommand cmd = new OracleCommand();
    cmd.Connection = conn;
    // Perform insert using parameters (bind variables)
    cmd.CommandText = "Insert into USER.EMPLOYEE VALUES (:1, :2)";
    // Here's one way to use parameters aka bind variables:
    // Create parameters to hold values from front-end
    cmd.Parameters.Add(new OracleParameter("1",
                                           OracleDbType.Varchar2,
                                           tbEmployeeName.Text,
                                           ParameterDirection.Input));
    cmd.Parameters.Add(new OracleParameter("2",
                                           OracleDbType.Varchar2,
                                           lbEmployeeGender.Text,
                                           ParameterDirection.Input));
    int rowsUpdated = cmd.ExecuteNonQuery();
    if (rowsUpdated == 0)
      MessageBox.Show("Record not inserted");
    else
      MessageBox.Show("Success!");
    conn.Dispose();
    // don't forget to perform any clean-up as necessaryNote that I've just typed this into a text editor and not verified, so please excuse any typos you may find.
    Also, I've allowed the default of OracleCommand.BindByName=false as I prefer that, though others certainly prefer setting it to "true". See the docs for what this means if you are not sure.
    Regards,
    Mark

  • Insert into different database - same server

    What do I need to do to insert values into a table in a database on the same server?
    I have databases A and B. I have a procedure in Database B that needs to insert a record into a table in Database A. I tried qualifying:
    Insert into DataBaseA.SchemaA.tableA (fields..) Values (values...); but that didn't work. I saw something on creating a link but I didn't quite understand it and all of the posts I have read haven't really given a clear syntax usage.
    Can anyone help? I also don't know the table to insert into until the procedure is run so I can't create anything "static".
    Thanks,
    Greg

    Hi Greg,
    You have to create a database link. Go through the following link for details:
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/statements_56a.htm#SQLRF01205
    Please let me know if you still have any concern.
    Regards
    Ghulam

  • Insert into various databases

    Yeah ,
    I havent tried this in oracle .I know this is possible in sqlserver how about in Oracle.
    I have two databases like DB1 and Db2 with a table emp .
    now i am connected to Db1 and
    Can i give an insert statement like
    Inset into DB2.SCOTT.EMP (NO,NAME) values (1,'james');
    can i do all the dml operations by logged into Db1 and doing DML operations in DB1.
    will this be possible in oracle.

    yeah
    as per ur link i have been suceesful upto here
    I am stuck here
    SQL> CREATE or REPLACE TRIGGER MoveQuoteOrderHeader
    2 AFTER INSERT ON Quote FOR EACH ROW
    3 begin
    4 INSERT INTO ORDERHEADER@test1
    5 (SourceQuoteId,SourceCustomerName,SourceCustomerId,CreateDate,Status,Source
    Comment)
    6 values
    7 (new.QuoteNumber,new.name,new.AccountId,new.StartDate,new.status,new.commen
    ts);
    8 end;
    9 /
    Warning: Trigger created with compilation errors.
    SQL> sho err;
    Errors for TRIGGER MOVEQUOTEORDERHEADER:
    LINE/COL ERROR
    2/1 PL/SQL: SQL Statement ignored
    5/70 PL/SQL: ORA-00984: column not allowed here
    what may be wrong here the statements are correct .

  • Insert into SQL2008 Database

    Hi there
    I want to be able to check the disk space and if the backups have run sucessfully on mac,
    and be able collect this data and insert into our 2008r2 server on which SQL2008 is running.
    Can you please point me to some script and the best way to do it.
    Kind Regards
    Gorilla Tech

    Many thanks for your help etresoft, can anyone please point me to any Perl scripts links please.

Maybe you are looking for

  • SM59 test GFW_ITS_RFC_DEST fails on application servers

    I can test my IGS connection on SM59 for GFW_ITS_RFC_DEST on the central instance and 1 of my application servers succesfully. But my other 2 applications server failed on the test. What can I check whats the issue and resolved it Regards Naziem Maho

  • Currency Translation Report

    BCS generates the currency translation on periodic basis. Is there any way report can be generated for the backup of the currency translation amount posted to that month. Please share your experience on this..

  • CS4 TreeView assert

    I'm randomly getting the following assert messages when working with TreeViews: "We're adding an item '<node id description>' to the sorted list that already exists. Item will not be added." "Adding a child with too high an index. If you're adding mu

  • An error occurred opening file. Flash can not parse this document".

    I working on a keyframe animation for a client.  It was working until the recent flash player patch. Now the file is corrupt and not working.  I have four back up files on two different hard drives, still no luck.  I can't afford to keep recreating f

  • Does adobe acrobat download to your computer?

    I don't see Acrobat as an application on my IMAC?  am I suppose to? how to access it?