dbTalk Databases Forums  

Filenames into an Oracle table?

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Filenames into an Oracle table? in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
blindsey
 
Posts: n/a

Default Filenames into an Oracle table? - 09-23-2008 , 11:20 AM






What I'm trying to do is this:

Write a script that will pull a list of filenames with a specific
extention, from a specific directory, into an Oracle table.

I've looked at the commands to shell out into DOS but I don't see how
to do it.

This is a script I will be running multiple time with the list of
filenames possibly changing, not a one-time thing.

Any ideas?

Reply With Quote
  #2  
Old   
Thomas Kellerer
 
Posts: n/a

Default Re: Filenames into an Oracle table? - 09-23-2008 , 11:43 AM






blindsey, 23.09.2008 18:20:
Quote:
What I'm trying to do is this:

Write a script that will pull a list of filenames with a specific
extention, from a specific directory, into an Oracle table.

I've looked at the commands to shell out into DOS but I don't see how
to do it.

This is a script I will be running multiple time with the list of
filenames possibly changing, not a one-time thing.

Any ideas?
This is a Windows batch question (I assume you are not really running MS-DOS) and has (nearly) nothing to do with Oracle

But something along the lines (in a batch file)

------- snip --------
@echo off
echo -- Insert filenames into table > do_insert.sql
for %%i in (*.zip) do echo insert into the_table (filename) values ('%%i'); >> do_insert.sql
sqlplus user/password@db @do_insert.sql
------- snip --------

should do the trick

Thomas


Reply With Quote
  #3  
Old   
Thomas Kellerer
 
Posts: n/a

Default Re: Filenames into an Oracle table? - 09-23-2008 , 11:43 AM



blindsey, 23.09.2008 18:20:
Quote:
What I'm trying to do is this:

Write a script that will pull a list of filenames with a specific
extention, from a specific directory, into an Oracle table.

I've looked at the commands to shell out into DOS but I don't see how
to do it.

This is a script I will be running multiple time with the list of
filenames possibly changing, not a one-time thing.

Any ideas?
This is a Windows batch question (I assume you are not really running MS-DOS) and has (nearly) nothing to do with Oracle

But something along the lines (in a batch file)

------- snip --------
@echo off
echo -- Insert filenames into table > do_insert.sql
for %%i in (*.zip) do echo insert into the_table (filename) values ('%%i'); >> do_insert.sql
sqlplus user/password@db @do_insert.sql
------- snip --------

should do the trick

Thomas


Reply With Quote
  #4  
Old   
Thomas Kellerer
 
Posts: n/a

Default Re: Filenames into an Oracle table? - 09-23-2008 , 11:43 AM



blindsey, 23.09.2008 18:20:
Quote:
What I'm trying to do is this:

Write a script that will pull a list of filenames with a specific
extention, from a specific directory, into an Oracle table.

I've looked at the commands to shell out into DOS but I don't see how
to do it.

This is a script I will be running multiple time with the list of
filenames possibly changing, not a one-time thing.

Any ideas?
This is a Windows batch question (I assume you are not really running MS-DOS) and has (nearly) nothing to do with Oracle

But something along the lines (in a batch file)

------- snip --------
@echo off
echo -- Insert filenames into table > do_insert.sql
for %%i in (*.zip) do echo insert into the_table (filename) values ('%%i'); >> do_insert.sql
sqlplus user/password@db @do_insert.sql
------- snip --------

should do the trick

Thomas


Reply With Quote
  #5  
Old   
Thomas Kellerer
 
Posts: n/a

Default Re: Filenames into an Oracle table? - 09-23-2008 , 11:43 AM



blindsey, 23.09.2008 18:20:
Quote:
What I'm trying to do is this:

Write a script that will pull a list of filenames with a specific
extention, from a specific directory, into an Oracle table.

I've looked at the commands to shell out into DOS but I don't see how
to do it.

This is a script I will be running multiple time with the list of
filenames possibly changing, not a one-time thing.

Any ideas?
This is a Windows batch question (I assume you are not really running MS-DOS) and has (nearly) nothing to do with Oracle

But something along the lines (in a batch file)

------- snip --------
@echo off
echo -- Insert filenames into table > do_insert.sql
for %%i in (*.zip) do echo insert into the_table (filename) values ('%%i'); >> do_insert.sql
sqlplus user/password@db @do_insert.sql
------- snip --------

should do the trick

Thomas


Reply With Quote
  #6  
Old   
Thomas Blankschein
 
Posts: n/a

Default Re: Filenames into an Oracle table? - 09-24-2008 , 04:29 AM




Quote:
Write a script that will pull a list of filenames with a specific
extention, from a specific directory, into an Oracle table.
Try this:
http://asktom.oracle.com/pls/asktom/...D:439619916584


Reply With Quote
  #7  
Old   
Thomas Blankschein
 
Posts: n/a

Default Re: Filenames into an Oracle table? - 09-24-2008 , 04:29 AM




Quote:
Write a script that will pull a list of filenames with a specific
extention, from a specific directory, into an Oracle table.
Try this:
http://asktom.oracle.com/pls/asktom/...D:439619916584


Reply With Quote
  #8  
Old   
Thomas Blankschein
 
Posts: n/a

Default Re: Filenames into an Oracle table? - 09-24-2008 , 04:29 AM




Quote:
Write a script that will pull a list of filenames with a specific
extention, from a specific directory, into an Oracle table.
Try this:
http://asktom.oracle.com/pls/asktom/...D:439619916584


Reply With Quote
  #9  
Old   
Thomas Blankschein
 
Posts: n/a

Default Re: Filenames into an Oracle table? - 09-24-2008 , 04:29 AM




Quote:
Write a script that will pull a list of filenames with a specific
extention, from a specific directory, into an Oracle table.
Try this:
http://asktom.oracle.com/pls/asktom/...D:439619916584


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.