Command Line Processor - Multi-Line Support

Command Line Processor - Multi-Line Support

Post by Jame » Fri, 10 May 2002 13:09:07



Hi,

Just wondering whether the CLP can support multi-lines,
just like in Oracle. Everytime I press "enter" to the
second line, the command would be intepreted straight away.

This is indeed pretty troublesome. Eg: If I want to create
a table through the CLP, I need to have everything on
the same line which is really a mess. This is the same
for the Command Window as well.

Do I really need to create a script file just to solve
this or is there any way around?

Thanks in advance.

Regards,
DB2 Novice

 
 
 

Command Line Processor - Multi-Line Support

Post by Jan M. Nelke » Fri, 10 May 2002 13:32:40



> Just wondering whether the CLP can support multi-lines,
> just like in Oracle.

What is Oracle?

In DB2 CLP you can enter multiple lines in two ways:

1:

db2                     \
        create          \
        table           \
        test            \
        (               \
                col1    \
                int     \
                not     \
                null    \
        )

2:

db2 -tvf myscript.sql

where myscript.sql may contains:

create
table
test
(
col1
int
not
null
)
;

Method 1 is for use ininteractive CLP session, while method 2: is used
in batch scripts.

Jan M. Nelken

 
 
 

Command Line Processor - Multi-Line Support

Post by Ian D. Bjorhovd » Fri, 10 May 2002 15:25:37



> Hi,

> Just wondering whether the CLP can support multi-lines,
> just like in Oracle. Everytime I press "enter" to the
> second line, the command would be intepreted straight away.

> This is indeed pretty troublesome. Eg: If I want to create
> a table through the CLP, I need to have everything on
> the same line which is really a mess. This is the same
> for the Command Window as well.

Start the CLP with 'db2 -t' instead of just 'db2'.  This
sets the statement terminator to ';' and you can enter
your commands on as many lines as you need.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----

 
 
 

Command Line Processor - Multi-Line Support

Post by Serge Riela » Fri, 10 May 2002 23:18:43


Use
db2 -t
to use ';' as end of statement character
db2 -td<char>
to use <char> as end of statement character.

Cheers
Serge
--
Serge Rielau
DB2 UDB SQL Compiler Development
IBM Software Lab, Canada