How to get subject correct in this procedure?

create or replace PROCEDURE send_mail (p_sender IN VARCHAR2,
p_recipient IN VARCHAR2,
p_recipient2 IN VARCHAR2,
p_message IN VARCHAR2,
p_subject IN VARCHAR2)
as
l_mailhost VARCHAR2(255) := 'mail.revion.com';
l_mail_conn utl_smtp.connection;
BEGIN<p>
l_mail_conn := utl_smtp.open_connection(l_mailhost, 25);<p>
utl_smtp.helo(l_mail_conn, l_mailhost);<p>
utl_smtp.mail(l_mail_conn, p_sender);<p>
utl_smtp.rcpt(l_mail_conn, p_recipient);<p>
utl_smtp.rcpt(l_mail_conn, p_recipient2);<p>
utl_smtp.open_data(l_mail_conn );<p>
utl_smtp.write_data(l_mail_conn, p_message);<p>
utl_smtp.write_data(l_mail_conn, p_subject);<p>
utl_smtp.close_data(l_mail_conn );<p>
utl_smtp.quit(l_mail_conn);<p>
end;<p>

Hi,
Try:
utl_smtp.write_data(l_mail_conn, 'Subject: ' || p_subject);
Andy

Similar Messages

  • How to use bind variables in this procedure

    Hi Experts,
    How to use bind variables in this procedure for static queries.
    PROCEDURE DELETE_MER_PROC (M_id IN NUMBER)
    IS
    BEGIN
    V_date DATE;
    SELECT PD_DATE INTO v_date FROM PD_MAINTAIN;
        DELETE FROM MER_CLEAR
        WHERE MER_DT < v_date
        AND ID = M_ID;
    COMMIT;
    END;   
    How to use  v_date and m_id as bind variables in this procedure to avoid hard parsing.
    Please help me.
    Thanks.

    976208 wrote:
    How to use  v_date and m_id as bind variables in this procedure to avoid hard parsing.
    You cannot avoid hard parsing - as the 1st time a SQL statement (like the SELECT or DELETE statements in your code) is encountered, it does not reside in the server's Shared Pool, and needs to be added into the pool via a hard parse.
    Bind variables does not prevent hard parsing. Hard parsing happens when the SQL statement (with or without bind variables) is a brand new statement encountered by the server.
    Bind variables enables the same SQL cursor to be reused, by simply changing the bind variable value.
    Not using bind variables means that each SQL statement is unique and not shareable - as the value is hardcoded into the statement and cannot be changed via a bind value. This typically means LOTS of different SQL statements (where the only difference is the changed value in the statement) are created - with each statement being a new statement not seen before in the Shared Pool and needing to be hard parsed.
    One does not design one's code not to be hard parsed. There ALWAYS will be a hard parse in order to get a SQL statement into the Shared Pool. One designs one's code to REUSE cursors in the Shared Pool.

  • The dates my photos were taken are now incorrect.  Any suggestions on how to get the correct dates back?

    The dates my photos were taken are not incorrect.  Any suggestions on how to get the correct dates back?

    Thank you Winston.  This works and I can adjust several photos at the same time.

  • My iphone 5 broke so had to get a sim card and put it in my husbands old iphone 4. i can not figure out how to get my imformation on this his old phone; contacts, apps ect. i have switched my icloud account and apple id on the phone but nothing. HELP!

    My iphone 5 broke so had to get a sim card and put it in my husbands old iphone 4. i can not figure out how to get my imformation on this his old phone; contacts, apps ect. i have switched my icloud account and apple id on the phone but nothing has changed. please HELP!

    You do a restore as new to wipe the iPhone then at the end of restore you will be asked to restore from backup. Choose your iPhone backup.
    Note you cannot restore an IOS newer than the IOS on iPhone, you need to update iPhone first.

  • Anyone know how I get charged a late this month?

    anyone know how I get charged a late this month?

    Creative Cloud chat support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html

  • HT4623 i have iOS 4.2.1 in 3G old one. how to get the applications for this iOS

    i have iOS 4.2.1 in 3G old one. how to get the applications for this iOS

    look at this thread
    https://discussions.apple.com/message/22837309#22837309

  • How to get a resultset from Stored Procedures

    How to efficiently and portably get resultsets from Oracle stored procedures? Oracle does not seem to follow JDBC standards here. A standard way in Oracle is to use a ref cursor and call getObject() on CallableStatement. However, Oracle seems to get all the data in the resultset in getObject(), which is inefficient and leads to large memory usage when the resultset is large.
    Another way in Oracle is to use getCursor() on an OracleCallableStatement, which is efficient but not portable across different application servers. For example, in WebSphere, this OracleCallableStatement is not available if we want WebSphere to manager the datasource.
    Any ideas will be greatly appreciated. Please email to [email protected]

    Oracle JDBC did not support return a result set, if you are using Oracle 9i, you can use pipeline function, then using the TABLE() function the get the row.
    Good Luck.
    Welcome to http://www.anysql.net/en/

  • My ipad is stuck on Account Not Verified .  Can anyone tell me how to get close out of thisMy ipad is stuck on Account Not Verified .  Can anyone tell me how to get close out of this (is there a Ctrl alt delete type of resolution for the ipad)  Thank you.

    My IPad is stuck on Verifying.  I'm on the Settings page and there is a box that says Account not Verified.  At the bottom is something in red asking me if I want Delete Account?  It's been stuck for an hour.  I tried turning my IPad off, but when I go back on and into Settings it's still there.  Does anyone know how to get out of this?  Thank you.

    To do a reboot, press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears.

  • How to get the correct size of the loaded swf file?

    final public class main extends Sprite
      public function main()
       loaderInfo.addEventListener(Event.COMPLETE, _onLoadCompleted);
      private function _onLoadCompleted(event: Event): void
       var tw: int = stage.width;
       var th: int = stage.height;
       var tsw: int = stage.stageWidth;
       var tsh: int = stage.stageHeight;   
    Above is my simple as3 project in flex builder 3.
    My screen resolution is 1920*1080, when debugging, the swf is stretched to the full client area of the IE, but the stage.stageWidth is 500 and the stage.stageHeight is 375, both the stage.widht and stage.height are 0, who can tell me why and how to get the right size of the swf file, named the client area size of the IE in this situation?
    Thanks very much!

    The HTML wrapper might resize the SWF later, so wait a frame and check stageWidth/stageHeight again.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • How to get the correct value from check box

    hi guys,
    here is a program to read data from IKPF.
    with the user tick on the check box, the program will retrive
    corresponding records based on the inventory counted (zstat) status.
    however i don't get the correct output with the following selection.
    Please advise where is going wrong. Thank you.
    IF ph_ncnt = 'X'.
        v_zstat1 = SPACE.
      ENDIF.
      IF ph_pcnt = 'X'.
        v_zstat2 = 'A'.
      ENDIF.
      IF ph_acnt = 'X'.
        v_zstat3 = 'X'.
      ENDIF.
       select awerks bmatnr bcharg aiblnr bzeili agjahr a~gidat
       b~menge into table t_data
       from ikpf as a
       inner join iseg as b
       on aiblnr = biblnr
       and agjahr = bgjahr
       where a~werks in s_werks
         and a~lgort in s_lgort
         and a~gidat in s_gidat
         and a~zldat in s_zldat
         and ( a~zstat = v_zstat3 OR
            a~zstat = v_zstat2 OR
            a~zstat = v_zstat1 )
         and a~gjahr = p_gjahr.

    hi guys,
    i'll use the following to get the desire result. This is a bit "stupid" but at least it gives me the correct result.
      IF ph_ncnt = 'X'.
        v_zstat1 = SPACE.
      ENDIF.
      IF ph_pcnt = 'X'.
        v_zstat2 = 'A'.
      ENDIF.
      IF ph_acnt = 'X'.
        v_zstat3 = 'X'.
      ENDIF.
    IF ph_ncnt = SPACE AND ph_pcnt = SPACE
                         AND ph_acnt = SPACE.
         message I799(SA) with 'Which data to print?'.
         stop.
      ELSEIF ph_ncnt = 'X' AND ph_pcnt = 'X'
                           AND ph_acnt = 'X'.
       select awerks bmatnr bcharg aiblnr bzeili agjahr a~gidat
       bmenge azstat into table t_data
       from ikpf as a
       inner join iseg as b
       on aiblnr = biblnr
       and agjahr = bgjahr
       where a~werks in s_werks
         and a~lgort in s_lgort
         and a~gidat in s_gidat
         and a~zldat in s_zldat
         and a~gjahr = p_gjahr.
      ELSEIF ph_ncnt = 'X' AND ph_pcnt = 'X'.
       select awerks bmatnr bcharg aiblnr bzeili agjahr a~gidat
       bmenge azstat into table t_data
       from ikpf as a
       inner join iseg as b
       on aiblnr = biblnr
       and agjahr = bgjahr
       where a~werks in s_werks
         and a~lgort in s_lgort
         and a~gidat in s_gidat
         and a~zldat in s_zldat
         and ( a~zstat = v_zstat1 OR
            a~zstat = v_zstat2 )
         and a~gjahr = p_gjahr.
      ELSEIF ph_ncnt = 'X' AND ph_acnt = 'X'.
      select awerks bmatnr bcharg aiblnr bzeili agjahr a~gidat
       bmenge azstat into table t_data
       from ikpf as a
       inner join iseg as b
       on aiblnr = biblnr
       and agjahr = bgjahr
       where a~werks in s_werks
         and a~lgort in s_lgort
         and a~gidat in s_gidat
         and a~zldat in s_zldat
         and ( a~zstat = v_zstat1 OR
            a~zstat = v_zstat3 )
         and a~gjahr = p_gjahr.
      ELSEIF ph_pcnt = 'X' AND ph_acnt = 'X'.
      select awerks bmatnr bcharg aiblnr bzeili agjahr a~gidat
       bmenge azstat into table t_data
       from ikpf as a
       inner join iseg as b
       on aiblnr = biblnr
       and agjahr = bgjahr
       where a~werks in s_werks
         and a~lgort in s_lgort
         and a~gidat in s_gidat
         and a~zldat in s_zldat
         and ( a~zstat = v_zstat2 OR
            a~zstat = v_zstat3 )
         and a~gjahr = p_gjahr.
      ELSEIF ph_ncnt = 'X'.
      select awerks bmatnr bcharg aiblnr bzeili agjahr a~gidat
       bmenge azstat into table t_data
       from ikpf as a
       inner join iseg as b
       on aiblnr = biblnr
       and agjahr = bgjahr
       where a~werks in s_werks
         and a~lgort in s_lgort
         and a~gidat in s_gidat
         and a~zldat in s_zldat
         and a~zstat = v_zstat1
         and a~gjahr = p_gjahr.
      ELSEIF ph_pcnt = 'X'.
      select awerks bmatnr bcharg aiblnr bzeili agjahr a~gidat
       bmenge azstat into table t_data
       from ikpf as a
       inner join iseg as b
       on aiblnr = biblnr
       and agjahr = bgjahr
       where a~werks in s_werks
         and a~lgort in s_lgort
         and a~gidat in s_gidat
         and a~zldat in s_zldat
         and a~zstat = v_zstat2
         and a~gjahr = p_gjahr.
      ELSEIF ph_acnt = 'X'.
      select awerks bmatnr bcharg aiblnr bzeili agjahr a~gidat
       bmenge azstat into table t_data
       from ikpf as a
       inner join iseg as b
       on aiblnr = biblnr
       and agjahr = bgjahr
       where a~werks in s_werks
         and a~lgort in s_lgort
         and a~gidat in s_gidat
         and a~zldat in s_zldat
         and a~zstat = v_zstat3
         and a~gjahr = p_gjahr.
      ENDIF.

  • How to send Html message in this procedure?

    Hi all,
    here is one procedure
    DECLARE
    v_connection UTL_SMTP.CONNECTION;
    BEGIN
    v_connection := UTL_SMTP.OPEN_CONNECTION('mail.idealake.com',25);
    UTL_SMTP.HELO(v_connection,'mail.idealake.com');
    UTL_SMTP.MAIL(v_connection,'[email protected]');
    UTL_SMTP.RCPT(v_connection,'[email protected]');
    UTL_SMTP.DATA(v_connection,'Sent From PL/SQL');
    UTL_SMTP.QUIT(v_connection);
    END;
    I want to send html message throug this procedure.
    Please tell me tjhe solution.
    Thanks in advance.
    Prathamesh.

    I also have a copy of send mail package (modified copy of some code that I found on the net). Originally written with utl_smtp. Converted it to utl_tcp. Supports binary file attachments and formatted html messages now.
    You can pick it up at my website... http://www.myoracleportal.com

  • How to get a layout like this

    How to get a layout like the jpg image in the below url
    https://profiles.google.com/100269274327733617906

    1- use panel splitter (horizontal)
    2- in the first facet (the picture)
    2- in the second facets (panel tapped)

  • How to get the correct stored procedure in oracle

    Hi sir,
    i am having one stored procedure which i converted from sql it's compiled successfully.
    create or replace
    PROCEDURE Spvalidateholiday1
    v_pidate1 IN Date DEFAULT NULL ,
    v_piEmpid IN VARCHAR2 DEFAULT NULL ,
    v_pidate2 IN Date DEFAULT NULL ,
    v_poRetVal OUT Number
    --RETURN NUMBER
    AS
    v_date3 VARCHAR2(20);
    v_date4 VARCHAR2(20);
    v_date5 VARCHAR2(40);
    v_date6 VARCHAR2(40);
    v_scode VARCHAR2(10);
    v_dayoff1 VARCHAR2(20);
    v_dayoff2 VARCHAR2(20);
    BEGIN
    v_date5 := To_Char(To_Date(v_pidate1,'YYYY-MM-DD','D'));
    v_date6 := To_Char(To_Date(v_pidate2,'YYYY-MM-DD','D')) ;
    SELECT Shift_Code
    INTO v_scode
    FROM Employee
    WHERE Emp_ID = v_piEmpid;
    SELECT WeeklyOff1
    INTO v_dayoff1
    FROM Shift
    WHERE Shift_Code = v_scode;
    SELECT WeeklyOff2
    INTO v_dayoff2
    FROM Shift
    WHERE Shift_Code = v_scode;
    SELECT dayid
    INTO v_date3
    FROM Weekly
    WHERE dayss = v_dayoff1;
    SELECT dayid
    INTO v_date4
    FROM Weekly
    WHERE dayss = v_dayoff2;
    --select @date3=dayid from Weekly w join Site_Param s on w.dayss=s.WeeklyOff1
    --select @date4=dayid from Weekly w join Site_Param s on w.dayss=s.WeeklyOff2
    IF ( v_date5 = v_date3
    OR v_date6 = v_date4
    OR v_date4 = v_date5
    OR v_date3 = v_date6 ) THEN
    BEGIN
    v_poRetVal := 0 ;
    END;
    ELSE
    BEGIN
    v_poRetVal := 1 ;
    END;
    END IF;
    RETURN; --v_poRetVal;
    END;
    but getting error:
    ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'SPVALIDATEHOLIDAY1' ORA-06550: line 1, column 7: PL/SQL: Statement
    could u check the stored procedure?
    thanks

    Hi sir,
    i am calling it my application
    that is used like this
    Dim hshParam As New Hashtable
    hshParam.Add("Empid", '00000002')
    hshParam.Add("date1", '2012-10-25')
    hshParam.Add("date2", '2012-10-27')
    intRetProc = objDataTier.ExecuteStoredProcedureWithReturnT("Spvalidateholiday1", hshParam)
    and here is this method written:
    Public Function ExecuteStoredProcedureWithReturnT(ByVal sStroredProcedureName As String, ByVal phshTbl As Hashtable) As Integer
    Dim cmdCommand As OracleCommand
    Dim prmParmOutput As OracleParameter
    Dim pParam As IDictionaryEnumerator = phshTbl.GetEnumerator
    Dim sKey As String, sValue As String
    Try
    ExecuteStoredProcedureWithReturnT = True
    OpenDbConnection()
    cmdCommand = New OracleCommand(sStroredProcedureName, conConnection)
    cmdCommand.CommandType = CommandType.StoredProcedure
    cmdCommand.CommandTimeout = 0
    While pParam.MoveNext
    sKey = "v_pi" & pParam.Key
    sValue = pParam.Value
    cmdCommand.Parameters.Add(New OracleParameter(sKey, sValue))
    End While
    prmParmOutput = New OracleParameter
    cmdCommand.Parameters.Add(New OracleParameter("v_poRetVal", SqlDbType.Int)).Direction = ParameterDirection.Output
    ' If
    cmdCommand.ExecuteNonQuery()
    ExecuteStoredProcedureWithReturnT = CInt(cmdCommand.Parameters("v_poRetVal").Value)
    Catch ex As Exception
    ExecuteStoredProcedureWithReturnT = 2
    Throw ex
    End Try
    End Function
    now tell me is it correct?

  • How to get a list of WRAPPED procedures, functions and packages?

    We have over 1000 stored procs, functions and packages.
    We want to find out which ones are WRAPPED and which ones are not.
    How to do it using 1 SQL statement.
    I tried USER_OBJECTS, USER_SOURCE but there is no column indicating that that procedure is wrapped.
    Also no data dictionary view on this: SELECT * FROM dict WHERE table_name LIKE '%WRAP%'; returns 0 rows.
    Any help on this would be greatly appreciated.
    Edited by: Channa on Feb 19, 2010 3:38 AM

    Thanks Max for the SQL. This gave the solution BUT u have to do a small correction.
    SQL> select name,
    2 decode(sum(decode(instr(upper(text),'WRAPPED'),1,1,0)),0,'NOT WRAPPED','WRAPPED') wrapped
    3 from user_source
    4 group by name;
    will give only NOT WRAPPED ones. This is becuase instr(upper(text),'WRAPPED') will NOT return 1 if WRAPPED is found but a number greater than 1.
    So U have to do this to get both wrapped and unwrapped.
    SQL> select name,
    2 decode(sum(decode(instr(upper(text),'WRAPPED'), *0,0,1* )),0,'NOT WRAPPED','WRAPPED') wrapped
    3 from user_source
    4 group by name;
    Edited by: Channa on Feb 21, 2010 9:38 PM

  • How to get the output of a procedure in to a log file ?

    Hi, Everyone,
    Could you please tell me
    How do i write the output of a procedure to a log file ?
    Thanks in advance...

    Hi,
    could you please explain me more on how to use the UTL_file to get the output to a log file as in am new to PL/SQL
    my script file is
    EXEC pac_sav_cat_rfv.pro_cardbase (200910,'aaa',100,'test_tbl');
    i need the output of this statement in a log file.
    Could you please explain to me how it can be done.
    thanks in advance

Maybe you are looking for

  • Multiple Apple TV System Planning

    I am donating apple tv's to the Maine Children's Cancer Program to put in the kids treatment rooms. There will be 5 160GB apple TVs connecting to a mac mini with a 1TB WD hard drive. All of this connecting over a wireless network using an airport ext

  • Indesign CS3 crash while generating an PDF or deleting an index entry

    Indesign crashes when I will starting the PDF export. This happens in all Indesign documents which are converted from CS2 and with index entries. So I want to delete the index but Indesign crashes while deleting too. I tried to convert the files in .

  • Excel Import data

    Hi, I'm using SQL Developer 1.2 and trying to Import data into a table using Excel. I select my .XLS file, but I get an error with these details: java.lang.NullPointerException      at oracle.dbtools.raptor.dialogs.importdata.ExcelImportDialog.getStr

  • Create Organization Data programatically

    I am using ALBPM 5.7 Studio and trying to create Organization data programatically - OU, Participant, Role etc. I am able to fetch data but not able to create OU. For the following code DirOrganizationalUnit dirOrgUnit; dirOrganizationalUnit = dirOrg

  • Trackpad Admin Account Issue

    This morning, I was cleaning my computer, and when I started up my computer later on, I discovered that the trackpad of my MacBook could not click. I could move the pointer around the screen, but then my clicks on the trackpad would not register. I s