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: PL / SQL Variable

Re: PL / SQL Variable

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Tue, 07 May 2002 15:09:43 GMT
Message-ID: <3CD7EE2F.6743D755@exesolutions.com>


David Williams wrote:

> I am trying to write a SQL script that will access and read a text file
> (comma or tab separated values) and use the values from the text file as
> parameters or variables in my SQL code. For example:
>
> select part_no,
> sub_part_no,
> unit_measure,
> from inventory_part_table
> where part_no = '&Part_No'
>
> &Part_No is my variable. The code needs to use the text file for
> variable input. Any ideas and if so, what would the code look like.
>
> Thank you
>
> David
>
> --
> Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

Look at the UTL_FILE built-in package.

Also look at DBMS_UTILITY.COMMA_TO_TABLE.

UTL_FILE can be used in a stored procedure to read the file. Then you can parse it manually or use the COMMA_TO_TABLE procedure.

Daniel Morgan Received on Tue May 07 2002 - 10:09:43 CDT

Original text of this message

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