Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Q: SQL+, set COLSEP = "TAB" ?

251 views
Skip to first unread message

Martin B.

unread,
Nov 2, 1998, 3:00:00 AM11/2/98
to
Hello,

We'd like to set the column separator of SQL+ to TAB, in order to
<spool> a query result directly to a table-formated text document, which
can be recognized and imported automatically by any spread-sheet
program.

We tried several solutions, but no one worked.

Could anybody out there help us, please ?

Thanks in advance,

Martin.

--
Martin.B...@LycosMail.com_antispam
Sorry, you'll have to remove the two "_antispam" pieces from my e-mail.

Christopher Beck

unread,
Nov 2, 1998, 3:00:00 AM11/2/98
to
On Mon, 02 Nov 1998 11:45:10 +0000, "Martin B."
<martin.b...@lycosmail.com_antispam> wrote:

>Hello,
>
>We'd like to set the column separator of SQL+ to TAB, in order to
><spool> a query result directly to a table-formated text document, which
>can be recognized and imported automatically by any spread-sheet
>program.
>
>We tried several solutions, but no one worked.
>
>Could anybody out there help us, please ?

set colsep ' '
will set the colsep to tab.

but you might consider selecting one column made up of all your
columns concatenated together with tabs.


SQL> set heading off
SQL> set feedback off
SQL> select ename||chr(9)||sal||chr(9)||empno
2 from scott.emp;


SMITH 800 7369
ALLEN 1600 7499
WARD 1250 7521
JONES 2975 7566
MARTIN 1250 7654
BLAKE 2850 7698
CLARK 2450 7782
SCOTT 3000 7788
KING 5000 7839
TURNER 1500 7844
ADAMS 1100 7876
JAMES 950 7900
FORD 3000 7902

SQL>

This way you can 'escape' tabs in your data by enclosing the columns
in '"' like

1 select '"'||ename||'"'||chr(9)||
'"'||sal||'"'||chr(9)||
'"'||empno||'"'
2* from scott.emp
SQL> /

"SMITH" "800" "7369"
"ALLEN" "1600" "7499"
"WARD" "1250" "7521"
"JONES" "2975" "7566"
"MARTIN" "1250" "7654"
"BLAKE" "2850" "7698"
"CLARK" "2450" "7782"
"SCOTT" "3000" "7788"
"KING" "5000" "7839"
"TURNER" "1500" "7844"
"ADAMS" "1100" "7876"
"JAMES" "950" "7900"
"FORD" "3000" "7902"
"MILLER" "1300" "7934"
SQL>


Hope this helps.

chris.


>
>Thanks in advance,
>
>Martin.


Alexander I. Doroshko

unread,
Nov 4, 1998, 3:00:00 AM11/4/98
to
make with an appropriate editor (I used MultiEdit) an .sql file, containing
set colsep 'c'
where c is for hex code of tab (X'09')
---
Alexander I.Doroshko, a...@grant.kharkov.ua
* Bank "Grant", Kharkov, Ukraine

Martin B. <martin.b...@lycosmail.com_antispam> wrote in article
<363D9B45...@lycosmail.com_antispam>...

0 new messages