Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Is it possible using stored procedure like this way???

Re: Is it possible using stored procedure like this way???

From: tojo <Tojo_at_hotmail.com>
Date: Wed, 4 Aug 2004 11:45:08 +0200
Message-ID: <MPG.1b7ace8e463ccdb09896fa@news.t-online.de>


In article <ceq3nm$94s$1_at_sunnews.cern.ch>, dominique_hung_at_hotmail.com says...
> First off, thank you to have a look my question.
>
>
> Here is the ASP code
> ----------------------------------------------------------------------------
> ---------------
>
> <%@ Language=VBScript %>
>
> <%
> Dim partName, Comm, con,param
>
> set con = Server.CreateObject("ADODB.Connection")
>
> con.ConnectionString = "DRIVER={Microsoft ODBC for Oracle};SERVER=ora92;
> UID=test;PWD=test"
> con.Open()
>
> Set Comm = Server.CreateObject("ADODB.Command")
>
> Comm.ActiveConnection = con
> With Comm
> .CommandText = "{CALL PkgPartition.add(?)}"
> .CommandType = 1 '1=adCmdText
> End With
> Set param = Comm.CreateParameter("paramPartName", 8, 1,100,ASPTest)
> Comm.Parameters.Append param
> Comm.Execute ,,128
> Response.Write ("<p> The partitionName is " &
> Comm.Parameters("paramPartName"))
> con.Close
> %>
>
> Error message
> ----------------------------------------------------------------------------
> ---------
>
> Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
> [Microsoft][ODBC driver for Oracle][Oracle]ORA-20004:
> /partition.asp, line 23
>
>
> Package code
> ----------------------------------------------------------------------------
> ------------
> CREATE OR REPLACE PACKAGE PkgPartition IS
> FUNCTION createPartition(paramPartName IN VARCHAR2) RETURN NUMBER;
> PROCEDURE add(paramPartName IN VARCHAR2);
> END PkgPartition;
> /

At first glance I notice the following:

  1. Your IN parameter is a VARCHAR2, so you should be binding the parameter with adVarChar (200), not a adBSTR (8)
  2. What is the "128" on your Execute line for?
    • Tom
Received on Wed Aug 04 2004 - 04:45:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US