[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: SQR Call to Pro*C subprogram



> We are using SQR V 3 with AIX and Oracle 7.2.3.
>
> Can SQR handle a User Call to a Pro*C subprogram that will issue PL/SQL
> statements for Oracle V7 under the login that the SQR program established?
>
> Or are there other ways for a SQR program to call an Pro*C

Warren,

This is a little hairy, but doable.  There are two mechanisms
for calling C (or Pro*C) from SQR: ucall and ufunc.  I definitely
recommend ufunc (more flexible, more parameters, more types,
etc.)  So, you'll need to read up on the ufunc mechanism in
your SQR manual.

Also, you'll need to create your Pro*C module as a separately
compiled module, and #define SQLCA_STORAGE_CLASS extern so that
the module uses the SQLCA that SQR creates.  If you're using
the ORACA (Oracle Communication Area), you'll need to #define
ORACA_STORAGE_CLASSS extern as well.

If you've already got a routine or expect it to be callable from
other Pro*C programs, you may need to implement an interface function
which converts the parameters from the form that SQR expects,
into the form needed by your routine.

If all you're trying to do is call PL/SQL from SQR, you can do
this directly in SQR using BEGIN-SQL and use ;; anywhere you'd
use ;.  If you really need to do it in Pro*C, you should be able
to get there.

Let me know if you need a hand.

Ray
----------------------------------------------------------------------
Ray Ontko       |  Ray Ontko & Co  |  "Ask me about our SQR toolkit."
rayo@ontko.com  |  Richmond, In    |  See us at http://www.ontko.com/