Re: default values for Oracle stored procedure
- From: "Daniel Crichton" <msnews@xxxxxxxxxxxxxxxx>
- Date: Mon, 19 Jun 2006 14:35:27 +0100
Hervé wrote on Mon, 19 Jun 2006 04:21:02 -0700:
I'm trying to use default values for Oracle stored procedure in an asp
page and ADO
When the parameter isn't define in the asp page , an error message
occurs.
example :
stored procedure :
CREATE PROCEDURE UPW_S_ECHEANCES_ALEAS(
@P_INDIVIDU integer,
@P_DATEDEBUT varchar(10),
@P_DATEFIN varchar(10),
@P_INDIV_VISUALISE integer default -1)
As
blabla
end;
asp page
set cmdDB = Server.CreateObject("ADODB.Command")
cmdDB.ActiveConnection = DBConnexion
cmdDB.CommandType = adCmdStoredProc
cmdDB.CommandText = "UPW_S_ECHEANCES_ALEAS"
cmdDB.Parameters.Append cmdDB.CreateParameter("P_INDIVIDU",
adInteger, adParamInput, , Cookies_INDIVIDU)
cmdDB.Parameters.Append cmdDB.CreateParameter("DATEDEBUT", adVarChar,
adParamInput, 10, DateDebutQuery)
cmdDB.Parameters.Append cmdDB.CreateParameter("DATEFIN", adVarChar,
adParamInput, 10, DateFinQuery)
set AleasSet = cmdDB.Execute
the following message occurs :
Microsoft OLE DB Provider for Oracle erreur '80040e14'
ORA-06550: Ligne 1, colonne 7 : PLS-00306: numéro ou types d'arguments
erronés dans appel à 'UPW_S_ECHEANCES_ALEAS' ORA-06550: Ligne 1, colonne 7
:
PL/SQL: Statement ignored
/premium/21/mdb_agenda_planaction.asp, ligne 378
Thanks.
I think you still have to define the parameters, just not give them a value.
The names used in the parameters collection in ADO are not the actual names
of the parameters, you can call them anything you like - when ADO passes the
SQL to the provider it simply uses the ordinal positions of the parameters
collection to pass in the values.
Dan
.
- Follow-Ups:
- Re: default values for Oracle stored procedure
- From: Hervé
- Re: default values for Oracle stored procedure
- Prev by Date: Re: ADOX - Catalog.Procedures only returns part of existing procs
- Next by Date: Re: Here's a rather broad question...
- Previous by thread: Re: ADOX - Catalog.Procedures only returns part of existing procs
- Next by thread: Re: default values for Oracle stored procedure
- Index(es):
Relevant Pages
|
|