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 > Data Access, Manipulation & Batch Languages > PHP > Once db2cmd instance Executing multiple CLP commands

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-10-03, 02:19
vram vram is offline
Registered User
 
Join Date: Apr 2003
Location: India
Posts: 14
Cool Once db2cmd instance Executing multiple CLP commands

Hi friends
I execute db2 commands thru a webpage using PHP script..For executing db2 commands ,i need to call db2cmd

everytime like this to initialise command line environment.
<?php Start of PHP
//Initialised session
..
.
system('db2cmd /c /w /i db2 get instance');
system('db2cmd /c /w /i db2 connect to sample');
system('db2cmd /c /w /i db2 select * from staff');
.
.
//Close the session
?> End of PHP

The problem here is the commands getting executed in separate environments which gives erroneous o/p
ie after connecting to sample database,i tried to select the values from the table staff,I get this error
"Database connection does not exist". Anybody pls tell me how to initialise command line envoironment once and execute db2 commands in it until i terminate from the enviroment.Thanx in advance.
Bye
With regards
Vram
Reply With Quote
  #2 (permalink)  
Old 12-23-03, 09:15
galith galith is offline
Registered User
 
Join Date: Dec 2003
Posts: 1
Try


open(DB2CMD,'| db2cmd /c "connect to infqas user db2inst1 using db2inst1", "db2 list tablespaces>C:\TEST.lst","db2 terminate"');
close(DB2CMD);


Galit.
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