Re: Help with SQL+

From: Peter Schneider <peter.schneider_at_okay.net>
Date: 1998/04/19
Message-ID: <353a6e42.15760496_at_news.okay.net>#1/1


On Sun, 19 Apr 1998 01:50:08 GMT, aria5_at_globalnet.co.uk (S Zandi) wrote:

>Hi all,
>I would be grateful if someone could help me out with the following:
>As a novice user of SQL+, I need to do a query which involves 20+
>columns and thousands of rows (from an Oracle table). I would like to
>
>save the result and open it in, say MS Excel. Spooling it and then
>opening it in Excel does do the trick. How do I go about this? I've
>played with this but the data does not stream in cleanly as rows and
>columns.
>Am I up the wrong tree and cannot do this and need to go onto ODBC?
>Regards.
>

Hi,

try a script like this. You should be able to import it into Excel as CSV file. Also, have a look at the other available formatting commands in the SQL*Plus docs.

SET HEADING OFF
SET LINESIZE 200
SET PAGESIZE 9999
SELECT empno || ',' || ename || ',' || job || ',' ||

       to_char(hiredate, 'DD-MON-YYYY') || ',' || sal ||
       ',' || comm || ',' || deptno

  FROM emp;

HTH,
Peter

-- 
Peter Schneider
peter.schneider_at_okay.net
Received on Sun Apr 19 1998 - 00:00:00 CEST

Original text of this message