Re: pl/sql problem

From: <hhyde_at_my-dejanews.com>
Date: Thu, 30 Jul 1998 16:40:22 GMT
Message-ID: <6pq7lm$9du$1_at_nnrp1.dejanews.com>


I don't quite get the specifics of your question, but I have a couple of comments. UTL_FILE, as well as all of the PL/SQL built-in packages, are very well documented in Steven Feurstein et al's book 'Oracle Built-in Packages', pub. O'Reilly Press 1998, ISBN #1-56592-375-8. Feurstein's main book, 'Oracle PL/SQL Programming', same pub 1997 ISBN #1-56592-335-9 is probably the best source around for learning PL/SQL in general.

The last executable line in your sample loop
> UTL_FILE.GET_LINE(file_out, line_out);
...should probably be PUT_LINE, not GET_LINE, shouldn't it.

I know this doesn't completely answer your question, but maybe you need to clarify the question for the slower ones like me.

Best Regards

In article <35C077DF.1C82B886_at_nxx.nokia.com>,   Givenname Surname <givenname.surname_at_nxx.nokia.com> wrote:
> Hi!
> I am quite new with pl/sql and I am asking how to do this:
>
> I am reading a file using UTL_FILE, from that file I should get
> parameters to SELECT clause (WHERE something = something_from_the_file).
> How do I send these values to SELECT clause. Output should be more than
> just one line from the query.
> I am trying with something like this:
>
> DECLARE
> file_in UTL_FILE.FILE_TYPE;
> file_out UTL_FILE.FILE_TYPE;
> my_var NUMBER;
> line_buf VARCHAR2(1023);
> line_out VARCHAR2(1023);
>
> BEGIN
> file_in := UTL_FILE.FOPEN('/directory', ' my_file.txt', 'r');
>
> LOOP
> UTL_FILE.GET_LINE(file_in, line_buf);
> -- some lines to get out my_var (they work just fine)
>
> --IF line includes something i want THEN
> SELECT something
> INTO line_out
> FROM somewere
> WHERE something_else = my_var;
> UTL_FILE.GET_LINE(file_out, line_out);
>
> END LOOP;
> ......
> Everything else seems to be fine except that select-thing.
> Thanks for advance
> Marko
>
>

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum Received on Thu Jul 30 1998 - 18:40:22 CEST

Original text of this message