View previous topic :: View next topic |
Author |
Message |
yadav2005 Intermediate
Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Mon Mar 12, 2007 3:27 am Post subject: Julian date data type needed |
|
|
Hai All,
I want to define a column of a DB2 table which will hold Julian Date data type ? I do not know what data type we should use?
Can anyone help me with the snytax if possible ? |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Mon Mar 12, 2007 3:32 am Post subject: |
|
|
1) Are you going to hold the century? i.e. ccyyddd?
2) How do you want to hold it - eye-readble (CHAR) or packed decimal (DECIMAL)
If you know the answer to 1 and 2 then you know the answer - read the manual if you are not sure how to code DECIMAL or CHAR _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
yadav2005 Intermediate
Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Mon Mar 12, 2007 4:38 am Post subject: |
|
|
Thanks Nic,
I want to store in YYDDD format (Julian) and i want in eye readable format. |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Mon Mar 12, 2007 4:47 am Post subject: |
|
|
look up section 2.8 of the SQL Reference _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
yadav2005 Intermediate
Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Mon Mar 12, 2007 4:56 am Post subject: |
|
|
Thanks Nic,
I have gone through the link.Can you not post the syntax to declare a column of a table which will hold Julian datatype ? |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Mon Mar 12, 2007 5:02 am Post subject: |
|
|
no - you are a programmer - it is explained in the manual. i have my own coding to do for my employers. Why should I have to read the manual for you? and do your coding for you? I will - but I want my 500 euro fee - in advance. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Mon Mar 12, 2007 5:20 am Post subject: |
|
|
Well Nic,
no need to become rude. I don't know, which DB2 manual you are looking at. Mine has no numbering after the chapter number. Your attempt to direct anyone to "2.8" therefore fails.
Perhaps you give the propper title of the section you are referring to.
regards
Christian |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Mon Mar 12, 2007 5:45 am Post subject: |
|
|
If you look at the links above to the manual and select DB2 V7 SQL Reference you are placed at the table of contents.These have section and subsection numbering : 2.8 is Data Types click on there and scroll down and you actually have sections 2.8.1 through 2.8.9 - the numbers are there on the screen. Now, I admit, in the PDF version of the manual subsections are not numbered - I've just checked but I assumed, bad mistake, that Yadav would have gone to the links at the top. So it is DATA TYPES that one should be looking for.
And, is it rude for me to tell someone to do there own work after I have pointed them in the right direction or is it rude for someone to ask me to do their coding for them? If one does not do things for oneself one does not learn. There must be numerous examples of how to code columns in a table definition within his shop and plenty of people to help. the first day I started in IT I was told - 'If in doubt - ask!' But you do not ask someone to do it for you - you ask for guidance. I have given guidance, I should not be asled to code it.
OK - off my high-horse - I will go and find my dummy. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Mar 12, 2007 6:58 am Post subject: |
|
|
yadav,
All you need is to define the column as character type. That's all
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
yadav2005 Intermediate
Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Mon Mar 12, 2007 8:04 am Post subject: |
|
|
Thanks Kolusu,
After looking into your answer it looks so simple. |
|
Back to top |
|
|
blitz2 Beginner
Joined: 23 Jan 2007 Posts: 84 Topics: 14
|
Posted: Mon Mar 12, 2007 9:06 am Post subject: |
|
|
Quote: |
Can you not post the syntax to declare a column of a table which will hold Julian datatype ?
|
I felt that the sentence was not a very polite one.. especially if you are looking for help from someone else. Nic, I'm sure that it wasn't his/her intension to offend anyone. I'd blame it on English-as-a-foreign-language-problem... It's just like the French speaking English. (Before anyone pounces on me, let me steer clear.. I do not hold anything personal against the French.. or Germans, Spanish, etc. Everyone makes mistakes, including me.)
________
Algerian cooking
Last edited by blitz2 on Thu Mar 10, 2011 5:28 pm; edited 1 time in total |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Mon Mar 12, 2007 9:21 am Post subject: |
|
|
I've had my knuckles rapped on this so I will not really make much of a comment except that I DO try and make allowance for English-as-a-second(third etc)-language. And I suppose I could have posted the SYSNTAX but it would have been cut'n'pasted from the manual and I gave a clue - eye-readble (CHAR) or packed decimal (DECIMAL). But 'end of story' except - I too make mistakes - just now I realised I'd forgotten that 'DO i = 1 TO x' leaves i at x+1 which is a bit of a bummer when you try and use the value of I after the loop! Elementary - but I figured it out myself. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
|
|