• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 889
  • Last Modified:

calling an oracle stored proc in an asp page

calling a stored procedure from an ASP page through ADO. my background is in SQL, so pardon my oracle-ignorance. below is a sample of the asp we're attempting, I'm getting an error on the j.execute line, saying it's either a syntax or access violation. I'm unsure if oracle needs rights granted to the stored procedures or if I'm just using the wrong syntax.

Thanks for any help you can provide!
--Van

asp code below:

Dim j, c, r'*********************************************stored procedure section begins
Set c = Server.CreateObject("ADODB.Connection")
c.ConnectionTimeout = Application("Scheduler_ConnectionTimeout") 'looking for Scheduler
c.CommandTimeout = Application("Scheduler_CommandTimeout")
c.Open Application("Scheduler_ConnectionString")
Set j = Server.CreateObject ("ADODB.Command")
Set r = Server.CreateObject ("ADODB.Recordset")
Set r.ActiveConnection = c
Set j.ActiveConnection = c

j.CommandType = adCmdStoredProc
j.CommandText = "bbq"
' Add the Return Value Parameter
j.Parameters.Append j.CreateParameter("return", adInteger, adParamReturnValue )

'Add the Input Values
j.Parameters.Append j.CreateParameter("res_id", adInteger, adParamInput )
j.Parameters.Append j.CreateParameter("start", adDBTimeStamp, adParamInput )
j.Parameters.Append j.CreateParameter("end", adDBTimeStamp, adParamInput )
j.Parameters.Append j.CreateParameter("off", adInteger, adParamInput )


'Add the output parameter
j.Parameters.Append j.CreateParameter("start1", adDBTimeStamp, adParamOutput )
j.Parameters.Append j.CreateParameter("end1", adDBTimeStamp, adParamOutput )
j.Parameters.Append j.CreateParameter("result", adInteger, adParamOutput )

'Add Values to Input Params
j("res_id") = resource_id 'sets resource id value for the stored procedure
j("start") = date_desired.value&" "&start_time_desired 'sets start time value for the stored procedure
'j("end") = OracleDateTime(date_desired.value&" "&end_time_desired) 'sets end time value for the stored procedure
j("end") = date_desired.value&" "&end_time_desired
j("off") = offsetion 'sets offset value for the stored procedure
j("start1") = null 'this null value is for a output parameter from the stored procedure
j("end1") = null 'this null value is for a output parameter from the stored procedure
j("result") = NULL 'this null value is for a output parameter from the stored procedure
j.Execute
0
v13stories
Asked:
v13stories
1 Solution
 
mathavraCommented:
In most cases, this is related to the client issues. Apply any latest patch you might for the client versions.

In our case, we had the same issue in two instances.

1) We were getting this error with 8.1.6 client. After applying 8.1.6.1 patch the error was gone.

2) With odbc driver version for 817 also we had the same issue. Whe  we upgraded to 81730, the problem went away.

In summary, apply any latest patch and try.
0
 
v13storiesAuthor Commented:
do you have a url where i can get the latest odbc driver? i've heard conflicting reviews on the oracle vs. microsoft odbc drivers for oracle.
thanks,
--v
0
 
mathavraCommented:
I was able to download it without log on to OTN.

From Oracle:

http://otn.oracle.com/software/utilities/software_index.htm

I have heard the same conflicting reviews about Oracle VS Microsoft ODBC drivers too. In our environment, Oracle ODBC drivers work OK.

Also, I have heard from my friends that, they try both the ODBC drivers and choose which ever works better.  

-Mathav
0
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
RMZCommented:
hi
first chk for your odbc and try connect to oracle from visual basic or delphi to chk odbc is run or not
u can call a stord procedure from any browser
all u do make connect to database then call a stord procedure.
the connection may be using odbc or jdbc
this is different from asp and jsp and ....
i have an example for connect to oracle and call a stord procedure using asp. if u want i'll send it
to u ---
in your asp file
    set cn = server.CreateObject("ADODB.Connection")
    cn.Open "DSN=a2zdb"  /*rem odbc name*/
    cn.Execute "SessionOnEnd ('"& session("uid")
&"','"&  session("pw") &"')"
    cn.close

here stored procedure named SessionOnEnd and has two parameter session("uid") ,session("pw")
first u make odbc to connect to database name a2zdb,
to execute storded procedure use the command
but u must create procedure in database using
create or replace procedure proc_name
0
 
MoondancerCommented:
Please update and finalize this old, open question. Please:

1) Award points ... if you need Moderator assistance to split points, comment here with details please or advise us in Community Support with a zero point question and this question link.
2) Ask us to delete it if it has no value to you or others
3) Ask for a refund so that we can move it to our PAQ at zero points if it did not help you but may help others.

EXPERT INPUT WITH CLOSING RECOMMENDATIONS IS APPRECIATED IF ASKER DOES NOT RESPOND.

Thanks to all,
Moondancer - EE Moderator

P.S.  Click your Member Profile, choose View Question History to go through all your open and locked questions to update them.
0
 
MindphaserCommented:
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now