Email Clob values using zip.

I have table cms_reports. Tbl srtucture group id number data type file is clob datatype
group_id File (clob) Filename(varchar2)
1 clobdata(1) file1
1 clobdata(2) file2
1 clobdata(3) file3
1 clobdata(4) file4
2 clobdata(5) file5
2 clobdata(6) file6
I have to write a procedure that takes group id as IN parameter
if I pass 1 as group id to the procedure, proc can zip file1,file2,file3 and file4, then send an email.
file1 should hold clobdata(1)
file2 should hold clobdata(2)
file3 should hold clobdata(3)
file4 should hold clobdata(4)
is it possible or any suggestions?

Anton,
I think , I will convert all the clobs to blobs, then I will use your package to zip multiple blobs to one zip file.
I am using this below code to convet the clob to blob and then pass it to your package code. am I doing right thing?
CREATE OR REPLACE FUNCTION f_clob_to_blob(p_clob IN CLOB) RETURN BLOB IS
v_blob BLOB;
v_offset NUMBER DEFAULT 1;
v_amount NUMBER DEFAULT 4096;
v_offsetwrite NUMBER DEFAULT 1;
v_amountwrite NUMBER;
v_buffer VARCHAR2(4096 CHAR);
BEGIN
dbms_lob.createtemporary(v_blob, TRUE);
Begin
LOOP
dbms_lob.READ(p_clob, v_amount, v_offset, v_buffer);
v_amountwrite := utl_raw.length(utl_raw.cast_to_raw(v_buffer));
dbms_lob.WRITE(v_blob, v_amountwrite, v_offsetwrite, utl_raw.cast_to_raw(v_buffer));
v_offsetwrite := v_offsetwrite + v_amountwrite;
v_offset := v_offset + v_amount;
v_amount := 4096;
END LOOP;
EXCEPTION
WHEN no_data_found THEN
NULL;
End;
RETURN v_blob;
END f_clob_to_blob;
/

Similar Messages

  • Exception while updating a clob value using dbms_lob.fragment_insert

    Hi,
    Here is the query
    procedure tempProc(str3 in varchar2) is
    QI CLOB;
    -- LOB(QI) STORE AS securefile ;
    v_cursor refcursor;
    str varchar2(50);
    i number default '30';
    begin
    open v_cursor for select b.OCEAN_RATE_XML.getClobVal() from TNMAB_OCEAN_RATE_XML B
    WHERE (XMLCast(XMLQuery('declare default element namespace "http://com.oocl.schema.tnm.agreementbuilder"; (: :) /OceanOfferRate/ObjectID'
    PASSING B.OCEAN_RATE_XML RETURNING CONTENT) AS NUMBER(20))) = 200000000000050;
    fetch v_cursor into QI;
    close v_cursor;
    dbms_output.put_line('abcds'||DBMS_LOB.getlength(QI));
    dbms_lob.fragment_insert(QI,3,DBMS_LOB.getlength(QI)-17,'<abc/>');
    dbms_output.put_line('Done insert');
    DBMS_LOB.READ (QI, i, DBMS_LOB.getlength(QI)-i, str);
    --DBMS_LOB.READ(QI,20,DBMS_LOB.getlength(QI)-20,str);
    dbms_output.put_line('Doem read');
    dbms_output.put_line(str);
    end tempProc;
    I am getting the below exceptionError report:
    ORA-43856: Unsupported LOB type for SECUREFILE LOB operation
    ORA-06512: at "SYS.DBMS_LOB", line 1076
    ORA-06512: at "TNM_PLSQL.TNM_AB_QI_UPDT_PKG", line 377
    ORA-06512: at line 5
    ORA-06512: at line 9
    <OceanOfferRate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://com.oocl.schema.tnm.agreementbuilder">
    <ObjectID>200000000000050</ObjectID>
    <RateID>2</RateID>
    <AgreementID>00000002</AgreementID>
    <StartingVersion>0</StartingVersion>
    <EndingVersion>0</EndingVersion>
    <EffectiveFrom>2010-05-16T00:00:00.000000</EffectiveFrom>
    <EffectiveTo>2010-06-30T00:00:00.000000</EffectiveTo>
    <RateStatus>QuoteExpired</RateStatus>
    <ApprovalStatus>Approved</ApprovalStatus>
    <Flags>3</Flags>
    <Tariffs>015</Tariffs>
    <BaseRates>
    <SizeType>20GP</SizeType>
    <Amount>65</Amount>
    <Currency>USD</Currency>
    <EffectiveFrom>2010-05-16T00:00:00.000000</EffectiveFrom>
    <EffectiveTo>2010-06-30T00:00:00.000000</EffectiveTo>
    <Flags>0</Flags>
    </BaseRates>
    <BaseRates>
    <SizeType>40GP</SizeType>
    <Amount>100</Amount>
    <Currency>USD</Currency>
    <EffectiveFrom>2010-05-16T00:00:00.000000</EffectiveFrom>
    <EffectiveTo>2010-06-30T00:00:00.000000</EffectiveTo>
    <Flags>0</Flags>
    </BaseRates>
    <BaseRates>
    <SizeType>40HQ</SizeType>
    <Amount>100</Amount>
    <Currency>USD</Currency>
    <EffectiveFrom>2010-05-16T00:00:00.000000</EffectiveFrom>
    <EffectiveTo>2010-06-30T00:00:00.000000</EffectiveTo>
    <Flags>0</Flags>
    </BaseRates>
    <ShippingPartyGroupName>Default</ShippingPartyGroupName>
    <CustomerContactGroupName>Default</CustomerContactGroupName>
    <NamedCustomerGroupName>Default</NamedCustomerGroupName>
    <LastSentDate>2010-06-14T22:42:48.536000</LastSentDate>
    <ValidityDays>30</ValidityDays>
    <ValidityExpirationDate>2010-06-30T00:00:00.000000</ValidityExpirationDate>
    <GuidelineRateReference>
    <Trunk>
    <RateID>100001510668470</RateID>
    <SurchargeIDs>684172719752758</SurchargeIDs>
    <SurchargeIDs>626856918161564</SurchargeIDs>
    <SurchargeIDs>680028613161439</SurchargeIDs>
    <SurchargeIDs>679555629913553</SurchargeIDs>
    <SurchargeIDs>673382151283681</SurchargeIDs>
    <SurchargeIDs>679789705628181</SurchargeIDs>
    <SurchargeIDs>653835218283772</SurchargeIDs>
    <SurchargeIDs>653955477367768</SurchargeIDs>
    <SurchargeIDs>653955477367759</SurchargeIDs>
    </Trunk>
    </GuidelineRateReference>
    <CreatedOn>2010-05-16T13:40:29.201344</CreatedOn>
    <CreatedBy>KRISHSA</CreatedBy>
    <SalesPerson>COOKBR</SalesPerson>
    <SalesOffice>PHE</SalesOffice>
    <LastUpdated>2010-06-30T00:13:06.000000</LastUpdated>
    <LastUpdatedBy>TNM_APPLN</LastUpdatedBy>
    <Origins>
    <ID_Wrappers>
    <Value>100000000026067</Value>
    </ID_Wrappers>
    <ID_Wrappers>
    <Value>100000000008923</Value>
    </ID_Wrappers>
    <ID_Wrappers>
    <Value>100000000024173</Value>
    </ID_Wrappers>
    </Origins>
    <Destinations>
    <ID_Wrappers>
    <Value>100000000008923</Value>
    </ID_Wrappers>
    <ID_Wrappers>
    <Value>100000000024173</Value>
    </ID_Wrappers>
    <ID_Wrappers>
    <Value>100000000013006</Value>
    </ID_Wrappers>
    <ID_Wrappers>
    <Value>100000000046704</Value>
    </ID_Wrappers>
    </Destinations>
    <DeliveryMode>YY</DeliveryMode>
    <TradeLane>IAT</TradeLane>
    <Commodity>
    <Description>Cotton for test</Description>
    <CargoNatureGroup>32</CargoNatureGroup>
    </Commodity>
    <RateLevel>1</RateLevel>
    </OceanOfferRate>
    Any advise if there is any other ways to update the clob with additional information at the end of the XML before </OceanOfferRate> ?

    A quick example illustrating what I mean :
    Settings
    SQL> create table department_xml (
      2    xmldoc xmltype
      3  , depid  number(4) as
      4    (
      5      xmlcast(
      6        xmlquery('declare default element namespace "http://some.namespace.org"; (: :)
      7                  /Department/@ID' passing xmldoc returning content)
      8        as number(4)
      9      )
    10    ) virtual
    11  )
    12  xmltype xmldoc store as binary xml
    13  ;
    Table created.
    SQL> create unique index department_xml_depid_uix on department_xml (depid);
    Index created.
    SQL> insert into department_xml (xmldoc)
      2  select xmlelement("Department",
      3           xmlattributes('http://some.namespace.org' as "xmlns"
      4                        , department_id as "ID")
      5         , xmlforest(
      6             d.department_name as "departmentName"
      7           , d.manager_id as "managerID"
      8           , xmlforest(
      9               l.street_address as "street"
    10             , l.postal_code as "zipcode"
    11             , l.city as "city"
    12             , l.state_province as "state"
    13             , c.country_name as "country"
    14             ) as "address"
    15           )
    16         )
    17  from hr.departments d
    18       join hr.locations l on l.location_id = d.location_id
    19       join hr.countries c on c.country_id = l.country_id
    20  ;
    27 rows created.
    SQL> commit;
    Commit complete.
    Sample document
    SQL> select xmlserialize(document xmldoc as clob indent) from department_xml where depid = 50;
    XMLSERIALIZE(DOCUMENTXMLDOCASCLOBINDENT)
    <Department xmlns="http://some.namespace.org" ID="50">
      <departmentName>Shipping</departmentName>
      <managerID>121</managerID>
      <address>
        <street>2011 Interiors Blvd</street>
        <zipcode>99236</zipcode>
        <city>South San Francisco</city>
        <state>California</state>
        <country>United States of America</country>
      </address>
    </Department>
    Updating each doc with the list of employees from the corresponding department
    SQL> UPDATE department_xml d
      2  SET d.xmldoc =
      3      insertChildXMLBefore(
      4        d.xmldoc
      5      , '/Department'
      6      , 'address'
      7      , (
      8          select xmlelement("employees",
      9                   xmlagg(
    10                     xmlelement("employee",
    11                       xmlattributes(e.employee_id as "ID")
    12                     , xmlforest( e.first_name || ' ' || e.last_name as "employeeName"
    13                                , e.hire_date as "hireDate"
    14                                , e.salary as "salary" )
    15                     )
    16                     order by e.employee_id
    17                   )
    18                 )
    19          from hr.employees e
    20          where e.department_id = d.depid
    21        )
    22      , 'xmlns="http://some.namespace.org"'
    23      )
    24  ;
    27 rows updated.
    Checking...
    SQL> select xmlserialize(document xmldoc as clob indent) from department_xml where depid = 50;
    XMLSERIALIZE(DOCUMENTXMLDOCASCLOBINDENT)
    <Department xmlns="http://some.namespace.org" ID="50">
      <departmentName>Shipping</departmentName>
      <managerID>121</managerID>
      <employees>
        <employee ID="120">
          <employeeName>Matthew Weiss</employeeName>
          <hireDate>2004-07-18</hireDate>
          <salary>8000</salary>
        </employee>
        <employee ID="121">
          <employeeName>Adam Fripp</employeeName>
          <hireDate>2005-04-10</hireDate>
          <salary>8200</salary>
        </employee>
        <employee ID="122">
          <employeeName>Payam Kaufling</employeeName>
          <hireDate>2003-05-01</hireDate>
          <salary>7900</salary>
        </employee>
        <employee ID="123">
          <employeeName>Shanta Vollman</employeeName>
          <hireDate>2005-10-10</hireDate>
          <salary>6500</salary>
        </employee>
        <employee ID="124">
          <employeeName>Kevin Mourgos</employeeName>
          <hireDate>2007-11-16</hireDate>
          <salary>5800</salary>
        </employee>
        <employee ID="125">
          <employeeName>Julia Nayer</employeeName>
          <hireDate>2005-07-16</hireDate>
          <salary>3200</salary>
        </employee>
        <employee ID="126">
          <employeeName>Irene Mikkilineni</employeeName>
          <hireDate>2006-09-28</hireDate>
          <salary>2700</salary>
        </employee>
        <employee ID="127">
          <employeeName>James Landry</employeeName>
          <hireDate>2007-01-14</hireDate>
          <salary>2400</salary>
        </employee>
        <employee ID="128">
          <employeeName>Steven Markle</employeeName>
          <hireDate>2008-03-08</hireDate>
          <salary>2200</salary>
        </employee>
        <employee ID="129">
          <employeeName>Laura Bissot</employeeName>
          <hireDate>2005-08-20</hireDate>
          <salary>3300</salary>
        </employee>
        <employee ID="130">
          <employeeName>Mozhe Atkinson</employeeName>
          <hireDate>2005-10-30</hireDate>
          <salary>2800</salary>
        </employee>
        <employee ID="131">
          <employeeName>James Marlow</employeeName>
          <hireDate>2005-02-16</hireDate>
          <salary>2500</salary>
        </employee>
        <employee ID="132">
          <employeeName>TJ Olson</employeeName>
          <hireDate>2007-04-10</hireDate>
          <salary>2100</salary>
        </employee>
        <employee ID="133">
          <employeeName>Jason Mallin</employeeName>
          <hireDate>2004-06-14</hireDate>
          <salary>3300</salary>
        </employee>
        <employee ID="134">
          <employeeName>Michael Rogers</employeeName>
          <hireDate>2006-08-26</hireDate>
          <salary>2900</salary>
        </employee>
        <employee ID="135">
          <employeeName>Ki Gee</employeeName>
          <hireDate>2007-12-12</hireDate>
          <salary>2400</salary>
        </employee>
        <employee ID="136">
          <employeeName>Hazel Philtanker</employeeName>
          <hireDate>2008-02-06</hireDate>
          <salary>2200</salary>
        </employee>
        <employee ID="137">
          <employeeName>Renske Ladwig</employeeName>
          <hireDate>2003-07-14</hireDate>
          <salary>3600</salary>
        </employee>
        <employee ID="138">
          <employeeName>Stephen Stiles</employeeName>
          <hireDate>2005-10-26</hireDate>
          <salary>3200</salary>
        </employee>
        <employee ID="139">
          <employeeName>John Seo</employeeName>
          <hireDate>2006-02-12</hireDate>
          <salary>2700</salary>
        </employee>
        <employee ID="140">
          <employeeName>Joshua Patel</employeeName>
          <hireDate>2006-04-06</hireDate>
          <salary>2500</salary>
        </employee>
        <employee ID="141">
          <employeeName>Trenna Rajs</employeeName>
          <hireDate>2003-10-17</hireDate>
          <salary>3500</salary>
        </employee>
        <employee ID="142">
          <employeeName>Curtis Davies</employeeName>
          <hireDate>2005-01-29</hireDate>
          <salary>3100</salary>
        </employee>
        <employee ID="143">
          <employeeName>Randall Matos</employeeName>
          <hireDate>2006-03-15</hireDate>
          <salary>2600</salary>
        </employee>
        <employee ID="144">
          <employeeName>Peter Vargas</employeeName>
          <hireDate>2006-07-09</hireDate>
          <salary>2500</salary>
        </employee>
        <employee ID="180">
          <employeeName>Winston Taylor</employeeName>
          <hireDate>2006-01-24</hireDate>
          <salary>3200</salary>
        </employee>
        <employee ID="181">
          <employeeName>Jean Fleaur</employeeName>
          <hireDate>2006-02-23</hireDate>
          <salary>3100</salary>
        </employee>
        <employee ID="182">
          <employeeName>Martha Sullivan</employeeName>
          <hireDate>2007-06-21</hireDate>
          <salary>2500</salary>
        </employee>
        <employee ID="183">
          <employeeName>Girard Geoni</employeeName>
          <hireDate>2008-02-03</hireDate>
          <salary>2800</salary>
        </employee>
        <employee ID="184">
          <employeeName>Nandita Sarchand</employeeName>
          <hireDate>2004-01-27</hireDate>
          <salary>4200</salary>
        </employee>
        <employee ID="185">
          <employeeName>Alexis Bull</employeeName>
          <hireDate>2005-02-20</hireDate>
          <salary>4100</salary>
        </employee>
        <employee ID="186">
          <employeeName>Julia Dellinger</employeeName>
          <hireDate>2006-06-24</hireDate>
          <salary>3400</salary>
        </employee>
        <employee ID="187">
          <employeeName>Anthony Cabrio</employeeName>
          <hireDate>2007-02-07</hireDate>
          <salary>3000</salary>
        </employee>
        <employee ID="188">
          <employeeName>Kelly Chung</employeeName>
          <hireDate>2005-06-14</hireDate>
          <salary>3800</salary>
        </employee>
        <employee ID="189">
          <employeeName>Jennifer Dilly</employeeName>
          <hireDate>2005-08-13</hireDate>
          <salary>3600</salary>
        </employee>
        <employee ID="190">
          <employeeName>Timothy Gates</employeeName>
          <hireDate>2006-07-11</hireDate>
          <salary>2900</salary>
        </employee>
        <employee ID="191">
          <employeeName>Randall Perkins</employeeName>
          <hireDate>2007-12-19</hireDate>
          <salary>2500</salary>
        </employee>
        <employee ID="192">
          <employeeName>Sarah Bell</employeeName>
          <hireDate>2004-02-04</hireDate>
          <salary>4000</salary>
        </employee>
        <employee ID="193">
          <employeeName>Britney Everett</employeeName>
          <hireDate>2005-03-03</hireDate>
          <salary>3900</salary>
        </employee>
        <employee ID="194">
          <employeeName>Samuel McCain</employeeName>
          <hireDate>2006-07-01</hireDate>
          <salary>3200</salary>
        </employee>
        <employee ID="195">
          <employeeName>Vance Jones</employeeName>
          <hireDate>2007-03-17</hireDate>
          <salary>2800</salary>
        </employee>
        <employee ID="196">
          <employeeName>Alana Walsh</employeeName>
          <hireDate>2006-04-24</hireDate>
          <salary>3100</salary>
        </employee>
        <employee ID="197">
          <employeeName>Kevin Feeney</employeeName>
          <hireDate>2006-05-23</hireDate>
          <salary>3000</salary>
        </employee>
        <employee ID="198">
          <employeeName>Donald OConnell</employeeName>
          <hireDate>2007-06-21</hireDate>
          <salary>2600</salary>
        </employee>
        <employee ID="199">
          <employeeName>Douglas Grant</employeeName>
          <hireDate>2008-01-13</hireDate>
          <salary>2600</salary>
        </employee>
      </employees>
      <address>
        <street>2011 Interiors Blvd</street>
        <zipcode>99236</zipcode>
        <city>South San Francisco</city>
        <state>California</state>
        <country>United States of America</country>
      </address>
    </Department>

  • Unable to write CLOB value larger then approx. 97KB

    Hello,
    I am writing the CLOB value using the java JDBC bridge (9.0.1) to the DB (8.1.6). I managed to write CLOB values ok, but when I try to write text larger then 97KB it throws the following error:
    java.io.IOException: ORA-00600: kód vnitønà chyby (internal error code in english), argumenty: [kdlseek-kgbtnscb], [], [], [], [], [], [], []
    ORA-06512: na "SYS.DBMS_LOB", line 708
    ORA-06512: na line 1
    at oracle.jdbc.dbaccess.DBError.SQLToIOException(DBError.java:618)
    at oracle.jdbc.driver.OracleClobWriter.flushBuffer(OracleClobWriter.java:201)
    at oracle.jdbc.driver.OracleClobWriter.flush(OracleClobWriter.java:161)
    at com.trask.edoceo.sql.OracleConnection$OraclePreparedStatement.getCLOB(OracleConnection.java:103)
    at com.trask.edoceo.sql.OracleConnection$OraclePreparedStatement.setCharacterStream(OracleConnection.java:85)
    at ...
    I use the Prepared statement function setClob and for writing I create the CLOB object using the following method:
    private CLOB getCLOB(String text, Connection conn) throws SQLException {
    CLOB tempClob = null;
    try {
    // If the temporary CLOB has not yet been created, create new
    tempClob = CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION);
    // Open the temporary CLOB in readwrite mode to enable writing
    tempClob.open(CLOB.MODE_READWRITE);
                        // Get the output stream to write
    Writer tempClobWriter = tempClob.getCharacterOutputStream();
    // Write the data into the temporary CLOB
    tempClobWriter.write(text);
    // Flush and close the stream
    tempClobWriter.flush();
    tempClobWriter.close();
    // Close the temporary CLOB
    tempClob.close();
    } catch (SQLException sqlexp) {
    tempClob.freeTemporary();
    sqlexp.printStackTrace();
    } catch (Exception exp) {
    tempClob.freeTemporary();
    exp.printStackTrace();
    return tempClob;
    Under the 97KB boundary everything works fine. Is the limit hidden in the JDBC drivers (I tried the newer drivers, but they throw the END OF TNS DATA CHANNEL error) or somewhere in the oracle DB settings?
    I am using JDK 1.3.1 Win2000 and the oracle DB resides on another machine then the application.
    I tried to append the error dump from the DB, but it has 1.5MB of text :-(
    Thanks for your help.
    Jan Antos.
    [email protected]

    This forum is meant for discussions about OTN content/site and services.
    Questions about Oracle products and technologies will NOT be answered in this forum. Please post your product or technology related questions in the appropriate product or technology forums, which are monitored by Oracle product managers.
    Product forums:
    http://forums.oracle.com/forums/index.jsp?cat=9
    Technology forums:
    http://forums.oracle.com/forums/index.jsp?cat=10
    As a general guideline, please first search the forum to see if your question is already answered. You will find answers for the most frequently asked questions by simply searching the forum. This will help you to find the answer right away and will save time for all of us.

  • Zip 7 says there is no default email program. How do I make gmail my default email program so i can zip and mail files using zip 7.

    Can't use zip 7 to zip and send files. Keep getting error message
    There is no email program associated to perform the requested action. Please install a program or if one is already installed, create an association in the Default Programs control panel. There is no mail program in the default programs control panel. There's no file to associate with it.
    I'm getting very frustrated. I have school files that need to be emailed and I can't figure this zip7 out
    Any help would be appreciated.

    Hi CB01,
    Thank you for your question. I understand that you need to set up a default mail program to mail zip 7 files.
    In the Control Panel of your operating system there are file extensions that you can set a default program to use for mailing.
    *[http://windows.microsoft.com/en-us/windows/change-default-programs#1TC=windows-7]
    In order to add a mailto option in Firefox[[Set how Firefox handles different types of files]]

  • How can I attach an image without the image is in the email body? (using the new mail the Lion)

    How can I attach an image without the image is in the email body? (using the new mail the Lion)
    I want in attachment, not in the body mail.

    I think your only solution is to zip the image files first and then attach them.
    Read this from a site I found:
    Sending Graphical Attachments -- When you attach a graphical image to your message, the recipient of your message sees the image inline (that is, in the body of the message) if her email client supports inline display. ("Take Control of Email with Apple Mail" contains a table listing the capabilities of popular Mac and PC email clients.) If a client does not support inline display (or the recipient has turned off the inline display option), the file appears as an attachment that must be opened in a separate program.
    On the one hand, an inline image is easier for the recipient to see - all she has to do is look at it. On the other hand, inline images can be frustrating to scroll through. If you do not wish to send a graphical image inline, you must compress the file before attaching it - Mail, sadly, lacks a built-in compression option, though fortunately for Panther users, the Finder offers Zip compression without requiring a separate application.
    Note that when you compose a new message, Mail always shows attachments in the body of your message. You can manually drag them somewhere else, but many email clients display all attachments in a separate list, regardless of where you place them in the message body.
    If you paste an image into a message or drag & drop an image from another window (say, a Web browser), Mail converts the raw image data to an attachment in TIFF format. On the other hand, if you drag & drop the icon of an image file (or use the Attach button to locate the file using the file browser), Mail leaves the attached image in its original format. This difference is significant, because although most email clients can display JPEG images just fine, support for TIFF - especially in non-Mac email clients - is less common. If possible, I suggest attaching image files as opposed to pasting or dragging in raw image data.

  • Email a form using PHP works intermittently

    Hello all,
    I'm using DW CS6/ Win 7. I have created a simple subscription form where the user enters their email and the form is emailed to an administrator. Sometimes it works and sometimes it doesn't and I have no idea why. Occasionally I  receive the email after a delay of several minutes and sometimes it never arrives. The webpage is here www.sanbenitoolivefestival.com/contactus2.php , below is the script , I've tried in IE and FF, same intermittent results. I'm new to FF/ Firebug but it didn't report any errors that I could see
    <div class="subscribe">
        <div class="spacer"></div>
    <?php
    if ((isset($_REQUEST['email'])) && ($_REQUEST['email'] != " Enter Email Address"))
    //if "email" is filled out, send email
        echo "sending mail";
        //send email
       $email = $_REQUEST["email"] ;
       $subject = "SBOF EMAIL SUBSCRIPTION REQUEST" ;
       $message = "Please add my email address to the SBOF email subscription list" ;
       mail("[email address removed by moderator]", $subject,
       $message, "From:" . $email);
       echo "Thank you, we have sent your subscription request";
    else
    //if "email" is not filled out, display the form
       echo '<form action="contactus2.php" method="post" >
         <em>Stay in touch by joining our email list.                  
          <input name="email" type="text" value=" Enter Email Address" size="42"  class="input" />         
         <input name="submit" type="submit" value="   SUBSCRIBE  " class="button"/>
          </em>
        </form>';
    ?>
    </div>

    You are using an extremely insecure technique that lays your form wide open to a malicious attack known as email header injection, which can turn your form into a spam relay.
    You should NEVER use unfiltered form input in the email headers. The From header is intended to indicate who sent the email. In this case, it's your website, not the person who fills out the form. If you want the convenience of hitting the reply button in your email program to use the sender's email address, you should use the Reply-to header instead of From.
    Misusing the From header like this is one possible cause of your emails not getting through. You should also check with your hosting company to see if they require the fifth argument to mail() to be set. This is normally a string that begins with -f followed immediately by a known email address on the same domain as the server, for example '[email protected]'.
    Also, using $_REQUEST is insecure.
    Change your code like this:
    <?php
    if ((isset($_POST['email'])) && ($_POST['email'] != " Enter Email Address"))
    //if "email" is filled out, send email
        // make sure the email is OK
        $email = filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL);
        // send the message only if the email address is valid
        if ($email) {
            echo "sending mail";
            //send email
            $from = '[email protected]';  // this should be your own email address
            $subject = "SBOF EMAIL SUBSCRIPTION REQUEST" ;
            $message = "Please add my email address to the SBOF email subscription list" ;
            $headers = "From: $from\r\nReply-to: $email";
            $sent = mail("[email address removed by moderator]", $subject,
                $message, $headers);
            if ($sent) {
                echo "Thank you, we have sent your subscription request";
           } else {
                echo 'Sorry, there was a problem sending your request';
    else
    //if "email" is not filled out, display the form
       echo '<form action="contactus2.php" method="post" >
         <em>Stay in touch by joining our email list.                 
          <input name="email" type="text" value=" Enter Email Address" size="42"  class="input" />        
         <input name="submit" type="submit" value="   SUBSCRIBE  " class="button"/>
          </em>
        </form>';
    ?>

  • How to concatinate two clob objects using JDBC...good brain excercise!!!

    Hi,
    I am using MYSQL server ver. 4.0 and J/Connector version 3.0.6
    I have two columns of LONGTEXT type and i have to concatenate them and store it in a third column.I have thought of the following strategy:
    1. Retrieve the columns as CLOB using getClob()
    2.Concatinate the CLOB values and then insert it in the corr. database column.
    My problem is this that i don't know what strategy should i use to concatenate the two values in the clob objects without bringing the whole clob values in the memeory.If i use this strategy..it gives me outofmemory error.
    My Clob columns may go upto 10MB in size.
    Pl. help.....Any suggestions from the whizkids out there will be extremely appreciated!!!
    Thanks....

    sorry for replying so late...but neway....
    Ok...i will paste a snapshot of my code here....May be that will clarify a few things....
    I am opening this in the main function body....To get the first column cell value....
    /////////////////Reading the Clob value of the main outer row which will be copmpared with the other rows under it//
    BufferedInputStream anInputStream = new BufferedInputStream( rs.getAsciiStream("row_interaction")); //row_intrctn
    int aByte = anInputStream.read();
    File aFile = File.createTempFile( "tempfile", "txt");
    FileOutputStream anOutput = new FileOutputStream(aFile);
    while (aByte != -1)
    anOutput.flush();
              anOutput.write(aByte);
    aByte = anInputStream.read();
    Then I depending on some condition i concatenate it with some other cell value from the database ...here i am just concatenating it with another rows column cell clob value..shown below as:
    if(loop==0)
    String col_string= null;
    col_string= convert_bitset_string(temp_b);
    //////Getting the other string value///////////////////////////////////////
    anInputStream = new BufferedInputStream( rs.getAsciiStream("row_interaction"));
    aByte = anInputStream.read();
    while (aByte != -1)
    anOutput.write(aByte);
    aByte = anInputStream.read();
    anOutput.flush();
    System.out.println("Loop0,2:The "+row_index+"st row being inserted");
    ////////////////////////Inserting through the prepared statement////////////
    String insertion= "Insert into bv"+next_tbl_nm_cntr+" Values(?,?,"+col_string+")";
    PreparedStatement pstmt= con.prepareStatement(insertion);
    pstmt.setInt(1,row_index);
    try{
    FileInputStream fis = new FileInputStream(aFile);
    pstmt.setAsciiStream(2,fis,(int)aFile.length());
    pstmt.execute();
    fis.close();
    }catch(IOException e)
    System.out.println("Error in setting the stream"+e);
    System.out.println("Loop0,2:Row inserted");
    row_index++;
    loop++;
    }     //End if: loop=0 i.e the row being inserted is the first row
                                  //in the store bitset
    Tell me if there is any error because when it concatenates i get some unwanted values too..which i took before in the iteration.....
    Any help will be greatly appreciated

  • Sending and receiving values using web services vi

    hi trying to receive values  values using the webservices vi 's, but im facing same conversion errors. im sending my project and an image of the problem can anyone help me on this?
    Attachments:
    TZID.zip ‏21 KB
    labviewscrn.JPG ‏126 KB

    Hi,
    Here is a global tutorial about Web Services :
    http://zone.ni.com/devzone/cda/tut/p/id/7350
    There are exemples at the end of the document : webservicesdemo.zip
    Please check the instruction for using web services given in the Readme.doc, it could be the source of your problem.
    Also, mind that you need the same language for you labVIEW version than the one used to create the Web service VIs.
    Regards,
    Rémi M.
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    >> Les présentations NIDays 2010 déjà disponibles au téléchargement !

  • Problem inserting clob value into xmltype column

    Hi all,
    I have created a table in XML DB using as:
    CREATE TABLE TransDetailstblCLOB ( id number, data_xml XMLType) XmlType data_xml STORE AS CLOB;
    I am trying to insert large xml data into the data_xml column which is of type XMLTYPE.
    I followed this link (http://www.oracle.com/technology/sample_code/tech/java/codesnippet/xmldb/HowToLoadLargeXML.html) to create a clob object and insert into xml.
    I am getting the following error:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00229: input source is empty
    Error at line 0
    ORA-06512: at "SYS.XMLTYPE", line 254
    ORA-06512: at line 1
    My code snippet:
    private static CLOB getCLOB(String xmlData, Connection conn) throws SQLException{
         CLOB tempClob = null;
         if(conn==null){
              log.debug("Connection object is null");
              throw new SQLException("Connection object is null");
         try{
         // If the temporary CLOB has not yet been created, create new
         tempClob = CLOB.createTemporary(conn, true, CLOB.MODE_READWRITE);
         // Open the temporary CLOB in readwrite mode to enable writing
         tempClob.open(CLOB.MODE_READWRITE);
         // Get the output stream to write
         writer = tempClob.getCharacterOutputStream();
         writer.write(xmlData);
         } catch(SQLException sqlexp){
              tempClob.freeTemporary();
         sqlexp.printStackTrace();
         } catch(Exception exp){
         tempClob.freeTemporary();
         exp.printStackTrace();
         return tempClob;      
    public static void insertXML(String xmlData, Connection conn){
         CLOB clob = null;
         String query;
         log.debug("Inside insertXML" +xmlData);
         try{
         query = "INSERT INTO TransDetailstbl1(data) VALUES (XMLType(?)) ";// Changed prev TransDetailstbl
         // Get the statement Object
         pstmt = conn.prepareStatement(query);
         //      xmlData is the string that contains the XML Data.
         // Get the CLOB object using the getCLOB method.
         clob = getCLOB(xmlData, conn);
         // Bind this CLOB with the prepared Statement
         pstmt.setObject(1, clob);
         int i =pstmt.executeUpdate();
         log.debug("pstmt.executeUpdate () status ::: "+i);
         // Execute the Prepared Statement
         if (i == 1) {
         log.debug("Record Successfully inserted!");
         } catch(SQLException sqlexp){
         sqlexp.printStackTrace();
         } catch(Exception exp){
         exp.printStackTrace();
         finally{
              try{
                   pstmt.close();
    //           Flush and close the stream
                   writer.flush();
                   writer.close();
              // Close the temporary CLOB
              tempClob.close();
              catch(Exception e)
                   log.debug("Cant close prepared statement.");
                   e.printStackTrace();
    Can anyone help me out?
    Please let me know if any other info is required.
    Regards,
    Robina

    Hi all,
    I now modified the code to write the data using Stream.
    I am getting this error message: SQLException while updateORA-24813: cannot send or receive an unsupported LOB
    On googling it seems the its usually caused when I am using the different versions of oracle on
    server and client.
    My oracle details:
    Database product version : Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
    With the Partitioning, OLAP and Data Mining options
    JDBC driver name : Oracle JDBC driver
    JDBC driver version : 9.2.0.1.0
    DataStoreHelper name is: com.ibm.websphere.rsadapter.OracleDataStoreHelper@22542254.
    JDBC driver type : thin
    Can anyone tell me how to proceed?
    Thanks

  • How to create and send clob value to SP?

    Hi,
    Does any one of an example of how to create and send
    a clob value(as a IN parameter to storedprocedure) from JAVA to
    the StoredProcedure. I need the JAVA code.
    null

    Hi 
    Following is sample code you can use.
    DECLARE @testID Int
    DECLARE @year int 
    DECLARE @testtype datatype
    SELECT @testtype=testtype from yourTable Where Your condition
    SELECT  @year= year from yourTable Where your conditon (you need to make sure you assign or get @year variable )
    SELECT @testid=id from test where  year=@year and testtype=@testtype)
    Hope this helps
    Regards

  • Displaying a CLOB value on a report page in an application from a DB-link

    Hello, i am having trouble displaying a CLOB value from a DB-Link, i have tried using temporary local tables, but they didnt work.
    I am now trying to use a collection (page process) to display the CLOB column's data from the link but to no avail :(
    This is my collection source:
    declare
      col1   number;
      col2   date;
      col3   clob;
    begin
      apex_collection.create_or_truncate_collection('LOBCOLLECTIONPLAN');
      for r in ( select * from TABLENAME@DB-Link ) loop
        APEX_COLLECTION.ADD_MEMBER('LOBCOLLECTIONPLAN',
        p_c001          => r.col1,
        p_c002          => r.col2,
        p_clob001       => r.col3);
    end loop;
    end;when i run the page it displays 'no data found', yet there is data in the linked DB table.
    Is there anything i am doing wrong?
    Or is there another way around this?
    Thanks in advance

    There used to be a problem with pulling CLOB's through dblinks. I don't know if that is still an issue, but I think it probably is, as that is a 'problem' with the database itself.
    If you run the same SQL query on your local database, getting the CLOB's from a remote database, do you get any errors or do you get all of the data?
    No idea if I'm right or not, but it's something you should be able to test fairly easily.
    Bill Ferguson

  • Reading CLOB data using jdbc thin driver

    Hi,
    When I try reading data for a CLOB column using thin jdbc driver, I get the following error message
    "Exception: ORA-06550: line 1, column 22:
    PLS-00302: component 'GETCHUNKSIZE' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored".
    This error message is displayed when the call is made to get the character stream from the Clob object.
    Do I need to any server side setup before I can access CLOB data from the database?
    thanks.
    Puru Balakrishnan

    I updated to the latest jdbc drivers, 816classes12b.zip, and the problem went away.
    null

  • Getting a Clob Value from an OUT Parameter

    I am having trouble fetching the CLOB Value(an XML Document) from an Out parameter. I have been
    trying to fetch the value into a String, an OracleClob, etc.. no luck still get either an invalid
    cast or a DBNULL value. Is there an example out there for returning and manipulating CLOBS in either VB.NET or in C#.
    Thanks,
    Scott E. Hunley

    Scott,
    Hopefully, this will help:
    ========================== C# code begin ===========================
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    using Oracle.DataAccess.Types;
    namespace Test
    class OutClob
    static OracleCommand cmd;
    static void Execute(string sql)
    try
    cmd.CommandText = sql;
    cmd.ExecuteNonQuery();
    catch (Exception e)
    Console.WriteLine(e.Message);
    static void Main(string[] args)
    // connect
    OracleConnection con = new OracleConnection();
    con.ConnectionString = "user id=scott;password=tiger;data source=ora92;";
    con.Open();
    // instantiate the command object
    cmd = new OracleCommand();
    cmd.Connection = con;
    // drop table
    Execute("drop table foo");
    // create table
    Execute("create table foo (num number, xml clob)");
    // insert a row with xml data in a CLOB column
    Execute("insert into foo values (1, '<foo>bar</foo>')");
    // bind and output parameter for an anonymous PL/SQL block
    OracleParameter p1 = cmd.Parameters.Add("p1", OracleDbType.Clob);
    p1.Direction = ParameterDirection.Output;
    // execute the anonymous PL/SQL block which returns a CLOB as an
    // output parameter of type OracleClob
    Execute("begin select xml into :1 from foo where num = 1; end;");
    // Obtain the clob with the proper cast
    OracleClob clob = (OracleClob)p1.Value;
    // print out the XML document
    Console.WriteLine(clob.Value);
    ========================== C# code end ===========================
    Output:
    <foo>bar</foo>

  • How can i measure SNR(S/N)value using FSP Spectrum analyser

    hi ,
     I want to measure S/N value using spectrum analyser.i already installed rsspecan instrument driver.I also configured span,center frequency ,RBW,VBW etc but i am not able to get measured S/N value.I have attached my vi here with.how could i measure SNR Ratio??can you please help me!
    thanks.
    Tadhika
    Attachments:
    Unbenannt 1.vi ‏77 KB

    Hi, first of all I'd recommend to contact the R&S customer support center to be shure the measure the correct value. Did you really measure the actual noise, or do you measure the noise which is "only" displayed?
    But anyway, did you have had a look at this example: http://www2.rohde-schwarz.com/file/rsspecan_lv8_noise_marker_example.zip
    There is the setup of one noise marker shown. With your already existing marker value this should do the trick, also in case of two noise markers; just use the rsspecan Configure Marker Noise Measurement.vi again with input parameter <YourMarker+1> of the "Marker" input of the VI.
    Hope that helps?
    juergen

  • BLOB / CLOB operations using JDBC connections taken from WebLogic 6.0 connectrion pool

    Hi..
    I need to do some CLOB operations using JDBC connection taken
    from WebLogic 6.0 connection pool. Will weblogic 6.0 supports it.?
    I am getting errors when trying to do it in normal way .
    It seems like ResultSet.getClob() returns an RMI (kind of ) object
    instead of the Clob object.
    If you have any idea . Pls respond to [email protected]
    Nazilin

    Hi..
    I need to do some CLOB operations using JDBC connection taken
    from WebLogic 6.0 connection pool. Will weblogic 6.0 supports it.?
    I am getting errors when trying to do it in normal way .
    It seems like ResultSet.getClob() returns an RMI (kind of ) object
    instead of the Clob object.
    If you have any idea . Pls respond to [email protected]
    Nazilin

Maybe you are looking for

  • Server 2008 R2 NIC not holding Static IP

    Hello I have a Dell 2950, Server 2008 R2 SP-1, it is a DC, DHCP, DNS, WINS, Etc Local Area Connection 1 is the only active NIC with: IP 10.10.1.50 SM 255.255.255.0 PDNS 10.10.1.50 IPV6 Disabled Local Area Connection 2 is disabled I had DHCP, DNS, Etc

  • Security guidelines for SBO

    Hi Forum I'm struggling with a task where I have to evaluate if our SBO installation is set up according to best practice and with the proper security settings, but I can't find any guidelines, in the SBO documentation. I'm seaching for, some kind of

  • ORA-03297: file contains used data beyond requested RESIZE value

    DB 10.2.0.4 AIX 5.2 PROD I have dropped many big tables after moving on another database, what i thought it will free the space of the disk because right now there is no provision to extend the disk size and disk size have already occupied 90%. I dro

  • Automatic move stock of MMBE into delivery qty of VA01 after dbl clk

    Hallo vinod, As per your last answer i.e. called T-Code MMBE its working fine. now in that my requirement is - when i got screen of MMBE  i will click on stock and that shloud be automatically pick up into delivery qty of VA01 . BAdI definition used

  • Generic roles in sap

    Hi All, I am nery new to sap. I need what are the generic roles and their description in sap like admin, user etc. Apart from admin,user any other generic roles are avilable or not.I need complete information. Can you help for this one. Regards, jhan