INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

JavaScript/vbscript + OLEDB + Oracle Stored Procedure

JavaScript/vbscript + OLEDB + Oracle Stored Procedure

JavaScript/vbscript + OLEDB + Oracle Stored Procedure

(OP)
I have a HTA tool developed using JavaScript. It connects to backend Oracle database and perform the operation.

DMLs are running fine but PLSQL doesn't run.

Can someone please help me to run a Oracle stored procedure using OLEDB in JavaScript.

For normal sqls , am using below command

`

try {
var connection = new ActiveXObject('ADODB.Connection');
//alert(RepoConnStr);
connection.open(RepoConnStr);

}
catch (e) {
alert(e);
return;
}
try {
SQL = "SELECT unique job_name as job_name FROM DATPRD.JMS_JOB_INVENTORY";
var rows = new ActiveXObject("ADODB.Recordset");
rows.open(SQL,connection);
while(rows.EOF == false)
{

Job_Name_List=Job_Name_List.concat(rows("job_name")).concat("\n");
rows.MoveNext();
}
//alert(DB_Details);
rows.close();
}
catch (e) {
alert(e);
alert("Unable to Fetch Job Name List");
window.location.reload(1);
}

`
But it doesn't work with stored Proc. Can someone plz help me with the syntax for stored Proc. I need to execute stored_Porc(param1,param2). Both parameters are input variable. Am ok with either Javascript or VBScript.

RE: JavaScript/vbscript + OLEDB + Oracle Stored Procedure

Quote:

Can someone please help me to run a Oracle stored procedure using OLEDB in JavaScript.

You can't.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.

RE: JavaScript/vbscript + OLEDB + Oracle Stored Procedure

(OP)
That's sad :(

not using vbscript also ? any other way to achieve it ?

RE: JavaScript/vbscript + OLEDB + Oracle Stored Procedure

Use an AJAX call to server side scripts is the only option for javascript.

vbscript, if running in a browser context is subject to similar constraints, and you will have to use the XMLHTTP object to make a server side request.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.

RE: JavaScript/vbscript + OLEDB + Oracle Stored Procedure

(OP)
Thanks for replying !
As it's a HTA tool, i don't have any server side concept.
However, after few more googling i found this and it worked. its a VBScript

ConnStr = "Provider=OraOLEDB.Oracle;" & _
"Data Source=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=ficoopdbp1-scan)(PORT=1521))" & _
"(CONNECT_DATA=(SERVICE_NAME=xyz)));User Id="&Repo_Username&";Password="&Rep_Password&";OLEDB.NET=True;"
Set connection = CreateObject("ADODB.Connection")
connection.connectionString=ConnStr
connection.open
connection.execute(exec proc('param1','param2'))

RE: JavaScript/vbscript + OLEDB + Oracle Stored Procedure

You may also be able to get it working with an ODBC connection string but it needs the odbc driver installed

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close