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 > Db2 Stored Procedure

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-02-03, 18:44
gsinha gsinha is offline
Registered User
 
Join Date: Oct 2003
Posts: 10
Db2 Stored Procedure

Hi

I am new to the Db2 Stored procedure so would like to get some help on it

I am writing an Outbound script to output data from my Db2 Contact table in a flat file. The Field Date value is stored as 2003-10-14 17:17:54.333 (date and Timestamp)

I would like to get an output value of 031014 in my flat file.

Can some one write an SQL Procedure for me...

Any help would be appreciated

Thanks

Gautam S
Reply With Quote
  #2 (permalink)  
Old 12-02-03, 20:23
GertK GertK is offline
Registered User
 
Join Date: Nov 2003
Location: Netherlands
Posts: 96
Re: Db2 Stored Procedure

Quote:
Originally posted by gsinha
Hi

I am new to the Db2 Stored procedure so would like to get some help on it

I am writing an Outbound script to output data from my Db2 Contact table in a flat file. The Field Date value is stored as 2003-10-14 17:17:54.333 (date and Timestamp)

I would like to get an output value of 031014 in my flat file.

Can some one write an SQL Procedure for me...

Any help would be appreciated

Thanks

Gautam S

You don't need a stored procedure,
substr(datefield,3,2) concat substr(datefield,6,2) concat substr(datefield,9,2) will return the string you want.

Hope this helps
Reply With Quote
  #3 (permalink)  
Old 12-03-03, 12:05
gsinha gsinha is offline
Registered User
 
Join Date: Oct 2003
Posts: 10
Smile

Thanks a lot
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