Esteemed Elders,

I am using the DBI module to connect to an Oracle database and insert text. Of course the text has characters that would cause SQL*PLUS to puke, particularly the ampersand and quotes. To get around this I have to set the escape character to a certain symbol and then escape all SQL special characters that appear in the text. My question is, are there any methods/attributes available in the DBI module to set SQL*PLUS features for each connection?

Having asked that, let me say this... from the 'Programming the Perl BDI' book, I get the sense that there isnt a way to do this. It says the DBI has no concept of a "current session", so I guess that means you cannot set environment variables to last the duration of a session. I also read that statement handles are insulated from each other even if they share the same parent database handle, that suggests that the set SQL*PLUS features would not last across statement handles.

Anyway, I was hoping someone out there had encoutered this issue before and had some thoughts about it.


In reply to Can SQL*PLUS features be set via the DBI module ? by brahma

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.