If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > How to execute the sample.sql script file in db2 command prompt.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-24-08, 08:15
goudelly1 goudelly1 is offline
Registered User
 
Join Date: Apr 2008
Posts: 21
How to execute the sample.sql script file in db2 command prompt.

Hi,

I have generated a sample.sql ddl script from windows platform through db2look command.


The sample.sql copied into aix platform. How to execute the sample.sql script file in db2 command prompt.

Please help me.. how to run the ddl sample.sql script file db2 command prompt of aix platform.

Thanks,

Mohan Reddy
Reply With Quote
  #2 (permalink)  
Old 04-24-08, 08:22
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
db2 -tvsf sample.sql

Andy
Reply With Quote
  #3 (permalink)  
Old 04-24-08, 08:32
goudelly1 goudelly1 is offline
Registered User
 
Join Date: Apr 2008
Posts: 21
I have executed the script with below given command. but the following error:

$ db2 -tvsf sample.sql
DB21006E The input command is too long. The maximum length is 65535.


Thanks,

Mohan Reddy
Reply With Quote
  #4 (permalink)  
Old 04-24-08, 08:41
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
What is your statement terminating character? (It usually is a semicolon ";").

Andy
Reply With Quote
  #5 (permalink)  
Old 04-24-08, 08:47
goudelly1 goudelly1 is offline
Registered User
 
Join Date: Apr 2008
Posts: 21
Hi,

The some part of the code is pasted here below:

$ view sample.sql
"sample.sql" [Read only] 8864 lines, 479330 characters
% Using database SAMPLE ^M
% Using userid ^M
% Database Manager Version DB2/NT Version 8.2.0 ^M
% Database Codepage 1252^M
% Database Collating Sequence is UNIQUE^M
\documentclass{article} ^M
\setlength{\textwidth}{6in} ^M
\setlength{\oddsidemargin}{-0.3in} ^M
\setlength{\evensidemargin}{-0.3in} ^M
\setlength{\textheight}{8.0in} ^M
\begin{document}^M
^M
^M
\sf^M
^M
\section*{Database Manager Version: DB2/NT Version 8.2.0}^M
^M
^M
\section*{Database Codepage: 1252}^M
^M
^M
\section*{Database Name: SAMPLE}^M


..........


I think is is ^M

Thanks,

Mohan Reddy
Reply With Quote
  #6 (permalink)  
Old 04-24-08, 09:01
Cougar8000 Cougar8000 is offline
Registered User
 
Join Date: Nov 2005
Location: IL
Posts: 554
"t" tell the system that termination char should be ";". If you want to use something else you have to use td@ where @ is your termination char
__________________
--
IBM Certified DBA on DB2 for Linux, UNIX, and Windows

DB2 v9.1.0.2 os 5.3.0.0
Reply With Quote
  #7 (permalink)  
Old 04-24-08, 09:42
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
Originally Posted by goudelly1
$ view sample.sql
"sample.sql" [Read only] 8864 lines, 479330 characters
% Using database SAMPLE ^M
% Using userid ^M
% Database Manager Version DB2/NT Version 8.2.0 ^M
% Database Codepage 1252^M
% Database Collating Sequence is UNIQUE^M
\documentclass{article} ^M
\setlength{\textwidth}{6in} ^M
You should have used the db2look -e option. Also make sure you transfer the resulting file to the AIX box in ASCII mode.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On