Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 5th, 2005, 07:53 AM
Registered User
 
Join Date: Oct 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default stored proc c# call issue

CREATE OR REPLACE PACKAGE WES_UAT.MAILSERVICE
AS
PROCEDURE InsertEMail
(
    i_SendTo IN EMAIL.SendTo%TYPE,
    i_SendFrom IN EMAIL.SendFrom%TYPE,
    i_Subject IN EMAIL.Subject%TYPE,
    i_EMailBody IN EMAIL.EMailBody%TYPE,
    i_BodyFormat IN EMAIL.BodyFormat%TYPE,
    i_Priority IN EMAIL.Priority%TYPE,
    i_LastUpdated IN EMAIL.LastUpdated%TYPE DEFAULT SYSDATE,
    i_errorEmailAddress IN EMAIL.errorEmailAddress%TYPE,
    i_ccEmailAddress IN EMAIL.ccEmailAddress%TYPE,
    i_systemName IN EMAIL.systemName%TYPE,
    i_inputDate IN EMAIL.inputDate%TYPE DEFAULT SYSDATE

);

PROCEDURE InsertEMail
(
    i_SendTo IN EMAIL.SendTo%TYPE,
    i_SendFrom IN EMAIL.SendFrom%TYPE,
    i_Subject IN EMAIL.Subject%TYPE,
    i_EMailBody IN EMAIL.EMailBody%TYPE,
    i_BodyFormat IN EMAIL.BodyFormat%TYPE,
    i_Priority IN EMAIL.Priority%TYPE,
    i_LastUpdated IN EMAIL.LastUpdated%TYPE DEFAULT SYSDATE,
    i_errorEmailAddress IN EMAIL.errorEmailAddress%TYPE,
    i_ccEmailAddress IN EMAIL.ccEmailAddress%TYPE,
    i_systemName IN EMAIL.systemName%TYPE,
    i_inputDate IN EMAIL.inputDate%TYPE DEFAULT SYSDATE




)
IS
BEGIN

    INSERT INTO
        EMail
        (SendTo,
         SendFrom,
         Subject,
         EMailBody,
         BodyFormat,
         Priority,
         LastUpdated,
         errorEmailAddress,
         ccEmailAddress,
         systemName,
         inputDate
         )
    VALUES
        (i_SendTo,
         i_SendFrom,
         i_Subject,
         i_EMailBody,
         i_BodyFormat,
         i_Priority,
         i_LastUpdated,
         i_errorEmailAddress,
         i_ccEmailAddress,
         i_systemName,
         i_inputDate
         );

    COMMIT;

END INsertEMail;

The procedure is part of a package...

This is the c# that calls it...

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;

using System.Web.Mail;
using log4net;
using MCE.ConfigHandler;

namespace WebApplication4
{
    /// <summary>
    /// Summary description for WebForm1.
    /// </summary>
    public class WebForm1 : System.Web.UI.Page
    {

        public OracleConnection _oraConnection = null;
        public void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here

            OracleCommand _oraCommand = new OracleCommand();
            _oraCommand.CommandText = "MAILSERVICE.InsertEMail";
            _oraCommand.CommandType = CommandType.StoredProcedure;
            _oraCommand.Connection = GetConnection();
            _oraCommand.Parameters.Add("i_SendTo", OracleDbType.Varchar2, ParameterDirection.Input).Value = "[email protected]";
            _oraCommand.Parameters.Add("i_SendFrom", OracleDbType.Varchar2, ParameterDirection.Input).Value = "[email protected]";
            _oraCommand.Parameters.Add("i_Subject", OracleDbType.Varchar2, ParameterDirection.Input).Value = "[email protected]";
            _oraCommand.Parameters.Add("i_EMailBody", OracleDbType.Varchar2, ParameterDirection.Input).Value = "[email protected]";
            _oraCommand.Parameters.Add("i_BodyFormat", OracleDbType.Double, ParameterDirection.Input).Value = 1;
            _oraCommand.Parameters.Add("i_Priority", OracleDbType.Double, ParameterDirection.Input).Value = 1;

            _oraCommand.Parameters.Add(" i_errorEmailAddress", OracleDbType.Varchar2, ParameterDirection.Input).Value = "[email protected]";
            _oraCommand.Parameters.Add(" i_ccEmailAddress", OracleDbType.Varchar2, ParameterDirection.Input).Value = "[email protected]";
            _oraCommand.Parameters.Add(" i_systemName", OracleDbType.Varchar2, ParameterDirection.Input).Value = "CC";


            try
            {
                _oraCommand.ExecuteNonQuery();
            }
            catch (OracleException oex)
            {
                Response.Write("Failed to execute stored procedure MAILSERVICE.InsertEMail"+"<br/>"+"<br/>"+ oex);
            }
        }

        public OracleConnection GetConnection()
        {
            if ( _oraConnection == null )
            {
                _oraConnection = new OracleConnection(SecurityConfig.GetVersionSetting( "WebSecurityDB") + SecurityConfig.GetVersionSetting("WebSecurityDBIde ntity"));
                _oraConnection.Open();
            }
            return _oraConnection;
        }

        #region Web Form Designer generated code
        override protected void OnInit(EventArgs e)
        {
            //
            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            //
            InitializeComponent();
            base.OnInit(e);
        }

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.Load += new System.EventHandler(this.Page_Load);

        }
        #endregion
    }
}


This is the error I am getting...

Failed to execute stored procedure MAILSERVICE.InsertEMail

Oracle.DataAccess.Client.OracleException ORA-06550: line 1, column 103: PLS-00103: Encountered the symbol ":" when expecting one of the following: ( - + case mod new not null others avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp interval date pipe at Oracle.DataAccess.Client.OracleException.HandleErr orHelper(Int32 errCode, OracleConnection conn, IntPtr opsErrCtx, IntPtr opsSqlCtx, Object src, String procedure, String[] args) at Oracle.DataAccess.Client.OracleException.HandleErr or(Int32 errCode, OracleConnection conn, String procedure, IntPtr opsErrCtx, IntPtr opsSqlCtx, Object src, String[] args) at Oracle.DataAccess.Client.OracleCommand.ExecuteNonQ uery() at WebApplication4.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\webapplication4\webform1.aspx.c s:line 50


The error revolves around the three extra columns i have added and trying to added data to them

 i_errorEmailAddress,
 i_ccEmailAddress,
 i_systemName,

I have no idea what the problem is as all the other values work and it seems the exact same.....

Can anyone spot the problem,,,
I dont think the column values are wrong as two are taken from sysdate so are not there as parameters but i'm not sure :(







Similar Threads
Thread Thread Starter Forum Replies Last Post
Stored Proc that returns a value elygp SQL Server 2000 4 May 9th, 2007 01:05 AM
Calling an insert stored proc from a select stored dzitam SQL Language 10 April 2nd, 2007 12:39 PM
How to get value from stored proc busybee ASP.NET 1.0 and 1.1 Basics 4 April 2nd, 2006 01:06 AM
Poor performance with ADO stored proc. call aldovalerio VBScript 0 August 23rd, 2004 08:21 AM
How i can OUTPUT in Stored Proc yoord SQL Server 2000 2 July 19th, 2004 03:11 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.