×
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!
  • Students Click Here

*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.

Students Click Here

Calling a C program from PL/SQL
2

Calling a C program from PL/SQL

Calling a C program from PL/SQL

(OP)
I want to call a C program from PL/SQL. I need to pass the C program a block of data and return results. I have checked the Oracle books that I have and can not find any way to do this.

RE: Calling a C program from PL/SQL

You can use winrsh to call your C program.

RE: Calling a C program from PL/SQL

2
Two ways to do this: the old way and the new way.

The old way involved using the DBMS_PIPE pipe between the PL/SQL procedure/function/trigger and a "C" program. This package became part of the Oracle RDBMS with 7.0, but there were lots of bugs prior to 7.1.6. It's not very documented in the standard Oracle doc-set, but I'm certain that Steve Feuerstein explained it thoroughly in at least one of his three books on PL/SQL! It's possible that an example is available on Oracle Support's "Metalink" site (support.oracle.com/metalink)...

The "new" way came in with Oracle8.0, and it is "external procedures", documented in chapter 10 of the PL/SQL reference manual. Again, I'm sure that Steve has documented it thoroughly, and there may be code fragments or other help on MetaLink...

Last, the older Oracle Procedural Gateway product included an SDK (software developers kit), of which only 6 copies were ever sold (I've been told)! As a result, Oracle pulled it off the market, but if that's not true, you can build a really high-end custom solution with the PGDK. To be honest, I think the "external procedures" functionality occupies the same space as the old PGDK, so it probably wouldn't be money well spent!

Hope this helps...

-Tim

RE: Calling a C program from PL/SQL

Update on my previous answer: I recently had the pleasure of using "external procedures" on two recent engagements, and it's great! It's well-documented ("Oracle8 PL/SQL Reference", chapter 10 and "Oracle8 Administration", chapter on "Managing Processes" and demos in "$ORACLE_HOME/plsql/demo") and provides great performance. No memory leaks or anything like that. I was using v8.0.5 on both occasions, once on HP-UX 11 and the other time on Solaris 2.x (not sure which version)...

...it's much less complicated than the old PGDK...

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! Already a Member? Login

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