Ciao a tutti,
ho provato a cercare sul web ma non ho trovato soluzione per il mio problema probabilmente ignoro qualcosa di cui non vengo a capo. Spero qualcuno mi possa dare indicazioni utili...
Sto lavorando su un sistema in Asp 3.0 che si interfaccia con un db Oracle.
Ho necessità di richiamare da asp funzioni e procedure pl sql presenti su db.
Riesco ad eseguire procedure mentre invece ho problemi con le funzioni.
Al momento sto provando ad eseguire una funzione di test:
codice:
------Codice della funzione
CREATE OR REPLACE FUNCTION F_TEST
(
vIN IN NUMBER
)
RETURN NUMBER AS
vOUT NUMBER;
BEGIN
vOUT := vIN + 10;
return vOUT;
END F_TEST;
-----Codice Asp
Set Conn = Server.CreateObject("ADODB.Connection")
Set Cmd = Server.CreateObject("ADODB.Command")
Conn.Open "Provider=OraOLEDB.Oracle; Data Source=XXX; User ID=xxxxx; Password=xxxx"
Cmd.ActiveConnection = Conn
Cmd.CommandText = "F_TEST"
Cmd.CommandType = adCmdStoredProc '4
Cmd.CommandTimeout = 15
'Cmd.Parameters.Refresh
set objParam = Cmd.CreateParameter ("vIN",adInteger,adParamInput,100,4)
Cmd.Parameters.Append objParam
Cmd.Execute
Note:
questo è invece il codice con cui riesco ad eseguire ad esempio una procedura che genera un file txt:
codice:
Set Conn = Server.CreateObject("ADODB.Connection")
Set Cmd = Server.CreateObject("ADODB.Command")
Conn.Open "Provider=OraOLEDB.Oracle; Data Source=xxxx; User ID=xxxxxxx;Password=xxxxxxxxxxx"
Cmd.ActiveConnection = Conn
Cmd.CommandText = "EXP_FILEXXXX"
Cmd.CommandType = adCmdStoredProc '4
Cmd.CommandTimeout = 15
'Cmd.Parameters.Refresh
set objParam = Cmd.CreateParameter ("p_anno",adVarChar,adParamInput,100,"2011")
Cmd.Parameters.Append objParam
set objParam2 = Cmd.CreateParameter ("p_mese",adVarChar,adParamInput,100,"02")
Cmd.Parameters.Append objParam2
set objParam3 = Cmd.CreateParameter ("p_append",adVarChar,adParamInput,100,"N")
Cmd.Parameters.Append objParam3
Cmd.Execute
grazie