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: Suggestions - DOS Command - Return value

Re: Suggestions - DOS Command - Return value

From: bigKED <tme2slp_at_yahoo.com>
Date: Tue, 01 Oct 2002 15:52:47 GMT
Message-ID: <jxjm9.50548$8o3.1291300@twister.austin.rr.com>


Now that sounds pretty reasonable. Actually, never heard of PL/File. I'll research and give it a shot.

Would you recommend this method over something like Java? from the previous post.

Thanks.... a bunch!

Ked

"T. Schmidt" <t.schmidt_at_rmv.spm.semantica.nl> wrote in message news:ancacv$kgm$1_at_reader10.wxs.nl...
> You may want to take a look at the PL/SQL package PL/File. PL/File offers
> advanced file-, directory- and zip file functionality from within Oracle.
> Through PL/SQL these functions can be called in any Oracle application. It
> makes no difference if these files are located on the database machine or
> other machines, PL/File guarantees platform independence.
>
> Here's an example :
>
> Listing a directory
> This script shows the usage of the PL/File dir list function and general
> filelist functions. The example shows the contents of a directory.
>
> declare
> machine varchar2(100) := 'LINUX';
> service varchar2(100) := 'service_1';
> password varchar2(100) := 'THEPASSWORD';
> location varchar2(100) := '/tmp';
> nh plfile.node_type;
> fh plfile.file_type;
> flh plfile.filelist_type;
> i number;
> begin
> --
> -- Connect to the file service
> --
> nh := plfile.node_login( machine, service, password );
> --
> -- Obtain a handle to the location
> --
> fh := plfile.file_handle( nh, location );
>
> if not plfile.file_isdirectory( fh )
> then
> dbms_output.put_line( location || ' is not a directory' );
> else
> --
> -- Obtain a handle to a filelist
> --
> flh := plfile.dir_list( fh );
> --
> -- Display the items in the filelist
> --
> dbms_output.put_line( 'The directory contains ' ||
> to_char( plfile.filelist_count( flh ) )
||
> ' item(s)'
> );
> i := 1;
> while ( i <= plfile.filelist_count( flh ) )
> loop
> dbms_output.put_line( plfile.filelist_item( flh, i ) );
> i := i + 1;
> end loop;
> --
> -- Remove the obtained filelist handle
> --
> plfile.filelist_clear( flh );
> end if;
> --
> -- Remove the obtained file handle
> --
> plfile.file_handle_remove( fh );
> --
> -- Logout from the file service
> --
> plfile.node_logout( nh );
>
> exception
> when others
> then
> dbms_output.put_line( 'SQLCODE = ' || SQLCODE );
> dbms_output.put_line( 'SQLERRM = ' || SQLERRM );
> end;
>
>
> More information, examples and trial download can be found at
www.plfile.com
>
> Kind regards,
> --TS
>
>
> "bigKED" <tme2slp_at_yahoo.com> wrote in message
> news:fX3m9.49594$Fw2.1207285_at_twister.austin.rr.com...
> > I'm using Oracle 9i on Windows 2000 Professional:
> >
> > I need to execute a command (DIR) and insert the number of files in the
> > directory to a field. At some point, the file number will not grow,
which
> I
> > will have another field set to 'Done'. (Set to 'Done' by end user.)
> >
> > I take it that once the file count is done, I will set a trigger on the
> > 'Done' field, so the DOS command or whatever command I use does not
> execute
> > in the future. And the highest file count will be inserted to database.
> >
> > My questions are 'Do I use SQL to execute the DOS command?' And have it
> > executed each time the user views the field? Unless it is set to 'Done'
> > which in that case will give the highest file count. Or since I plan to
> use
> > the web to add/view data to the database, use something like ASP to do
all
> > the work?
> >
> > Hope you can follow my logic. Remember, that I'm new, not a student,
just
> > trying to learn Oracle 9i.
> >
> > Thanks..
> >
> > Ked
> >
> >
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.391 / Virus Database: 222 - Release Date: 20-09-02
>
>
Received on Tue Oct 01 2002 - 10:52:47 CDT

Original text of this message

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