Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: my function to run in Sqlplus console

Re: my function to run in Sqlplus console

From: Thomas T <T_at_T>
Date: Thu, 2 Oct 2003 16:41:36 -0400
Message-ID: <3f7c8d81$1@rutgers.edu>


<quikquic_at_yahoo.com> wrote in message
news:ead1f717.0309300925.63b003f2_at_posting.google.com...
> I am running oracle. Besides all those build-in "select, insert,
> delete...", can I define my own function which can be run inside
> SQL-plus console?
>
> Suppose I save an image as a blob in the database, my table is
>
> ImageID blob
> 100 **
> 101 **
>
> and I would like to have something like "Showimage blob from
> imagetable where imageid = 100", where "Showimage" will be a function
> written in C and packaged as a dll.
>
> How can I do it?
>
> Thanks,
>
> qk

You want SQLPlus to call a component in a DLL?? Ignoring the blob, which I'm not familar at all with, why not use the host command to call an .EXE that calls the component?

I'm assuming Visual C... I'd say to write a Win32 Console Application (basically an .exe you'd run from the command prompt, no gui interfaces) in Visual C++. Have it take parameters. An example, using an exe name of "myapp param1 param2", where param1 is the schema and table name, and param2 is the image id. Write the console application to call your DLL component with the imageid. Then, from SQLPlus, type "host myapp myschema.imagetable 100", which will call your console application, which will call your dll. Heck, it wouldn't even have to be a console application... under Win2k and Oracle8i, if I'm in sqlplus, and type "ho notepad", Notepad pops up, and SQL*Plus waits for me to exit Notepad before continuing.

Just a guess! And because it's just my guess, I won't crosspost my response. <grin>

-Thomas Received on Thu Oct 02 2003 - 15:41:36 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US