how can i add a document in database by perl

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • diner
    New Member
    • Mar 2013
    • 1

    how can i add a document in database by perl

    sir,
    i have made a database by some field.but i want to add next field in database using perl,how can i do it?which will help to add next line to database.plz help me.
    giving my database script here:
    Code:
    <DOC 00001> <TITLE> Neural Networks:a comprehensive
    foundation </TITLE> <AUTHOR> haykin,simon </AUTHOR> <CALL 
    NUMBER> 006.32 </CALL NUMBER> <SUBJECT> </SUBJECT> 
    <EDITION> 2nd edition </EDITION> <ISBN> </ISBN> 
    <PUBLISHER> pearson education </PUBLISHER> <PRICE> 450 TK 
    </PRICE> <LIBRARY CODE> </LIBRARY CODE> </DOC><DOC
    i want to add 00002 no doc by perl.how can i???
    Last edited by acoder; Mar 9 '13, 10:46 PM. Reason: Added [code] tags
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Have you done a thorough search through the database modules on CPAN? There are a lot on there and you might find one that you can define your format if its general enough.

    Comment

    • Oralloy
      Recognized Expert Contributor
      • Jun 2010
      • 988

      #3
      diner,

      I assume you have created a table, in which you have a VARCHAR, or other long field, in which you need to place the entire XML document.

      First off, build the XML document in a string variable.

      Then, using the DBI module, prepare an INSERT statement with a placeholder for the document you want to save.

      Finally, execute the statement, using the string as the parameter to fill the placeholder.

      Good Luck!
      Oralloy

      Comment

      Working...