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 > Calling one DDL script from another

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-30-12, 10:19
mikecico mikecico is offline
Registered User
 
Join Date: Jan 2012
Posts: 3
Calling one DDL script from another

If I have to DDL scripts, A, and B, is it possible to call script B from script A, and retain the current connection/user context?
Reply With Quote
  #2 (permalink)  
Old 01-30-12, 10:53
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Are they shell scripts or DB2 command scripts?

Andy
Reply With Quote
  #3 (permalink)  
Old 01-30-12, 11:21
mikecico mikecico is offline
Registered User
 
Join Date: Jan 2012
Posts: 3
They're both DB2 command scripts. The desired architecture is to have one script that sets up the current schema and schema user, grants permissions, creates tablespaces, etc, and have that call out to others to create tables, etc, within the context of the same connection.
Reply With Quote
  #4 (permalink)  
Old 01-30-12, 11:35
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
What DB2 version and OS are you using?

Andy
Reply With Quote
  #5 (permalink)  
Old 01-30-12, 11:47
mikecico mikecico is offline
Registered User
 
Join Date: Jan 2012
Posts: 3
We have to support v9.7, on Windows & Linux primarily. Does the OS version impact the db2 CLI syntax?
Reply With Quote
  #6 (permalink)  
Old 01-30-12, 11:52
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
I cannot think of a way to do it with normal DDL type scripts. Usually I would just use a shell script that ran the first script and then the second.

But with v9.7, you now have CLPPlus which may work for you. I have not used it yet as we are not totally on V9.7 yet.

Andy
Reply With Quote
Reply

Tags
cli, ddl

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