?
Solved

calling an oracle stored proc in an asp page

Posted on 2001-06-22
6
Medium Priority
?
874 Views
Last Modified: 2008-02-01
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
Comment
Question by:v13stories
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 3

Accepted Solution

by:
mathavra earned 900 total points
ID: 6219242
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
 

Author Comment

by:v13stories
ID: 6219284
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
 
LVL 3

Expert Comment

by:mathavra
ID: 6219345
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 2

Expert Comment

by:RMZ
ID: 6221019
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
 
LVL 1

Expert Comment

by:Moondancer
ID: 7033807
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
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7046123
Force accepted

** Mindphaser - Community Support Moderator **
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question