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 > Query regarding the parameterization of shell script in SQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-09-09, 02:22
k.kutty k.kutty is offline
Registered User
 
Join Date: Jun 2009
Posts: 9
Query regarding the parameterization of shell script in SQL

Hi,

I have a SQL like this(please find the SQL below) to unload the target table .

Select carrd_cd,carr_path,platg_carr_cd from f_abcd_path where
platg_carr_cd='KK' AND (carr_path LIKE '%AA%' OR carr_path LIKE '%BB%' OR carr_path LIKE '%CC%' OR carr_path LIKE '%DD%' OR carr_path LIKE '%EE%' OR carr_path LIKE '%FF%' OR carr_path LIKE '%DD%' OR carr_path LIKE '%HH%' OR carr_path LIKE '%II%' OR carr_path LIKE '%JJ%');

Since each month I recieve a new carr_path,I have to parameterize all the carr_path which I have in the where clause.Currently,I have a shell script(carr_path.ksh) which lists all these carr_path like 'AA','BB','CC','DD','HH','II','JJ' .. etc.But when I use it in the SQL as parameter to unload my target table ,it doesn't work.

Select carrd_cd,carr_path,platg_carr_cd from f_abcd_path where
platg_carr_cd='KK' AND (carr_path LIKE '%${carr_path}%');

Could you help me to resolve this.

Thanks
Kavitha
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