Oracle Consulting Oracle Training Oracle Support Development
Home
Catalog
Oracle Books
SQL Server Books
IT Books
Job Interview Books
eBooks
Rampant Horse Books
911 Series
Pedagogue Books

Oracle Software
image
Write for Rampant
Publish with Rampant
Rampant News
Rampant Authors
Rampant Staff
 Phone
 800-766-1884
Oracle News
Oracle Forum
Oracle Tips
Articles by our Authors
Press Releases
SQL Server Books
image
image

Oracle 11g Books

Oracle tuning

Oracle training

Oracle support

Remote Oracle

STATSPACK Viewer

Privacy Policy

 

   
  SQL Server Tips by Burleson

Code Highlights

The code is pretty straightforward and uses the various parameters to set the attributes of the CDO message before it is sent. Some of the highlights include:

Use is made of the various XP++ macros to access the values in the ‘XP_VARIANT_PARAMETER’ structure. For example:

TCHAR* pszFrom = XP_TTEXT(m_pParameterData[FROM_INDEX].m_Data);
msg->From = pszFrom;



Special consideration needs to be given to the optional parameters. For example to use the ‘CC’ parameter, the following code is used:

if (m_pParameterData[CC_INDEX].m_bType != SRVNULL)
{
TCHAR* pszCC = XP_TTEXT(m_pParameterData[CC_INDEX].m_Data);
XP_ASSERT(pszCC);
msg->CC = pszCC;
}


In addition some parameters, which are declared as optional in the parameter map become required, depending on the values of other parameters. For example if Basic Authentication is used to send the email, then the @User and @Password parameters to the XP should be achieved. This is accomplished using the following code:

case CDO::cdoBasic:
{
msg->Configuration->Fields->Item[_bstr_t("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")]->Value = _variant_t(nAuthentication);
bRequiresFieldUpdate = TRUE;

if (m_pParameterData[USER_INDEX].m_bType == SRVNULL)
{
sprintf(szErrorMsg, "%s: \"@User\" parameter is required if using Basic Authentication", m_szFunctionName);
SendErrorMsg(szErrorMsg);
return FALSE;
}
.
.


The above book excerpt is from:

Super SQL Server Systems
Turbocharge Database Performance with C++ External Procedures

ISBN: 0-9761573-2-2
Joseph Gama, P. J. Naughter

 http://www.rampant-books.com/book_2005_2_sql_server_external_procedures.htm  

Linux Oracle commands syntax poster

ION Oracle tuning software

Oracle data dictionary reference poster



Oracle Forum

BC Oracle consulting support training

BC remote Oracle DBA   

 

   

 Copyright © 1996 -2016 by Burleson. All rights reserved.


Oracle® is the registered trademark of Oracle Corporation. SQL Server® is the registered trademark of Microsoft Corporation. 
Many of the designations used by computer vendors to distinguish their products are claimed as Trademarks
 

Hit Counter