Home » SQL & PL/SQL » SQL & PL/SQL » Calling an Procedure in ASP
Calling an Procedure in ASP [message #189582] Fri, 25 August 2006 03:05 Go to next message
plgladio
Messages: 19
Registered: March 2005
Location: Vellore
Junior Member
this is simply an ASP application. All what i did is i created a procedure which out's a value. I want to get that value in the asp application. thnx in advance.
Re: Calling an Procedure in ASP [message #189865 is a reply to message #189582] Mon, 28 August 2006 03:29 Go to previous messageGo to next message
kimant
Messages: 201
Registered: August 2006
Location: Denmark
Senior Member
Hi

Why not use a function?
- They are designed for returning values.

Regarding the ASP part, I am sure You can find many answers out on the internet....

Br
Kim
Re: Calling an Procedure in ASP [message #190168 is a reply to message #189865] Tue, 29 August 2006 09:20 Go to previous messageGo to next message
plgladio
Messages: 19
Registered: March 2005
Location: Vellore
Junior Member
My Procedure.

create or replace procedure ma
(sn in varchar2,zc in number,pin in number,a1 in varchar2,a2 in varchar2,ci in varchar2,db in date,pn in varchar2,po in varchar2,
ph in number,em in varchar2,dep in varchar2,coll in varchar2,
cou in varchar2,quo in varchar2,ta in number,pa in number,
dj in date,uco in varchar2 DEFAULT 'Nill',
uga in number DEFAULT 00.00,ugc in varchar2 DEFAULT 'Nill',
re in varchar2 DEFAULT 'Nill',m out varchar2)
is
a varchar2(3);
b number;
c varchar2(2);
d varchar2(2);
e varchar2(2);
f varchar2(2);
g varchar2(2);
h varchar2(2);
s varchar2(3);
j number;
begin
select depta.val,college.val,course.val into c,d,e from depta,college,course where depta.dname like dep and college.cname like coll and course.cname like cou;
f:=c;
g:=d;
h:=e;
s:='0';
a:='0';
select nvl(max(substr(sid,Cool),'0') into a from master where substr(sid,5,2) like h and substr(sid,3,2) like f and substr(sid,1,2) like g;
j:=to_number(a)+1;
if (j+1)>100 then
s:=to_char(j);
elsif (j+1)>10 then
s:='0'||to_char(j);
else
s:='00'||to_char(j);
end if;
m:=g||f||h||s;
insert into master values(m,sn,db,pn,po,pin,a1,a2,ci,zc,ph,em,ta,pa,uco,uga,ugc,dep,coll,cou,quo,re,dj);
commit;
exception
when NO_DATA_FOUND then
m:=g||f||h||'001';
insert into master values(m,sn,db,pn,po,pin,a1,a2,ci,zc,ph,em,ta,pa,uco,uga,ugc,dep,coll,cou,quo,re,dj);
commit;
end ma;


all these input values are from asp page. the only value what i want is to get the m as output what to do.(I Edited here might be some pblm in the code)

The matter is all the details abt the student is gathered in the asp page and sended as input to the oracle there i need to generate the Student ID if i send the ID back to the asp. I will show the ID and their is one more job left to do with the id. this is my pblm. if u can't understand this clearly u reply me so that i send u the whole content.
Re: Calling an Procedure in ASP [message #190169 is a reply to message #190168] Tue, 29 August 2006 09:24 Go to previous messageGo to next message
plgladio
Messages: 19
Registered: March 2005
Location: Vellore
Junior Member
the smile=, 8
Re: Calling an Procedure in ASP [message #190271 is a reply to message #190169] Wed, 30 August 2006 00:08 Go to previous messageGo to next message
plgladio
Messages: 19
Registered: March 2005
Location: Vellore
Junior Member
Oracle Procedure:

create or replace procedure ganesh
(i in number, j in number,m out number)
is
begin
m:=i+j;
end;
/

ASP:

<%
dim custID,Pcustid,paction,custFname,pcustfname
custId=6
custFname=3
set ocmd=server.createobject("adodb.command")
ocmd.activeconnection="Datasource=cdo;user Id=scott;Password=tiger;"
ocmd.commandtext="ganesh"
ocmd.commandtype=4
set Pcustid=ocmd.createparameters("i",131,1,3,custID)
ocmd.parameters.append Pcustid
set pcustfname=ocmd.createparameters("j",131,1,3,custFname)
ocmd.parameters.append pcustfname
set paction=ocmd.createparameters("ioaction",131,1,50,0)
ocmd.parameters.append paction
ocmd.execute
response.write(ocmd("ioaction"))
%>

when i try to pass a varchar2 or a number greater than 10 it denies. please help all i what to do is to pass and get varchar variable's help me.
Re: Calling an Procedure in ASP [message #190297 is a reply to message #190271] Wed, 30 August 2006 02:10 Go to previous message
kimant
Messages: 201
Registered: August 2006
Location: Denmark
Senior Member
Hi plgladio

I have no knowledge of ASP, so probably I cannot help You a lot.

Brut could You please explain what exactly what it does when You say that it "denies". An error code is always nice to have.

Br
Kim
Previous Topic: can we update CLOB column?
Next Topic: resize partioned column ?
Goto Forum:
  


Current Time: Sun Dec 11 08:29:32 CST 2016

Total time taken to generate the page: 0.08737 seconds