Re: Last record of a result set

From: Gerard H. Pille <ghp_at_skynet.be>
Date: Tue, 05 Oct 2010 18:37:23 +0200
Message-ID: <4cab5443$0$14255$ba620e4c_at_news.skynet.be>



JAW wrote:
> cat dhtexp.sql
>
> set heading off feedback off pagesize 0
> --
> spool zzz.par
> prompt file=data.dmp
> prompt log=data.log
> prompt direct=y
> prompt buffer=100000000
> prompt userid=data
> prompt tables=(
> select ' '|| tablename ||','
> from userz.tab_codes
> where export='Y'
> order by tablename;
> prompt )
> --
> spool off
> prompt exp parfile=zzz.par
>
> A very minor issue. I generated export cards for a group of tables
> in a codes table for an application upgrade.
>
> The last line shows up with TABLENAME, as expected.
>
> Though it is minor I was attempting to think of a way in SQL to take
> care of.
>
> Maybe LAG???

select decode(rownum,1,' ',' ,') || tablename from (select tablename from userz.tab_codes where export = 'Y' order by tablename);

? Received on Tue Oct 05 2010 - 11:37:23 CDT

Original text of this message