473,322 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

SYSCOLUMNS - COLTYPE or TYPENAME?

I am one of the authors of MyGeneration, I'm working on enhancing our
DB2 support, which datatype do I want to use from SYSCOLUMNS when it
comes to creating parameters to stored procedures or datatypes for a
CREATE TABLE statemment?

COLTYPE TYPENAME
=====================
CHAR CHARACTER
LONGVCHAR LONG VARCHAR
TIMESTMP TIMESTAMP

If I was creating a parameter would I use

char(50) or character(50) ?

Again, Should I use COLTYPE or TYPENAME FROM SYSCOLUMNS if my
intentions are to generate valid DB2 SQL script code?
Nov 12 '05 #1
5 6572
Mike wrote:
I am one of the authors of MyGeneration, I'm working on enhancing our
DB2 support, which datatype do I want to use from SYSCOLUMNS when it
comes to creating parameters to stored procedures or datatypes for a
CREATE TABLE statemment?

COLTYPE TYPENAME
=====================
CHAR CHARACTER
LONGVCHAR LONG VARCHAR
TIMESTMP TIMESTAMP

If I was creating a parameter would I use

char(50) or character(50) ?
CHAR is identical to CHARACTER.
Again, Should I use COLTYPE or TYPENAME FROM SYSCOLUMNS if my
intentions are to generate valid DB2 SQL script code?


You shouldn't use SYSCOLUMNS (or any other object from the SYSIBM schema,
except SYSIBM.SYSDUMMY1) because that table is not documented and it might
change or go away at any time. Instead, stick to the documented catalog
views from the SYSCAT schema (see Appendix D in the SQL Reference or here
http://publib.boulder.ibm.com/infoce.../r0011297.htm).

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #2
> You shouldn't use SYSCOLUMNS (or any other object from the SYSIBM schema,
except SYSIBM.SYSDUMMY1) because that table is not documented and it might
change or go away at any time. Instead, stick to the documented catalog
views from the SYSCAT schema (see Appendix D in the SQL Reference or here


Okay, thanx, I switched but my question remains, can you define a
parameter like this:

LONG VARCHAR(100) or do you have to use LONGVCHAR(100)

and for "bit data" types would I say:

CHAR FOR BIT DATA(30)
CHARACTER FOR BIT DATA(30)

or none of the above?

- Mike
Nov 12 '05 #3
Mike wrote:
Okay, thanx, I switched but my question remains, can you define a
parameter like this:

LONG VARCHAR(100) or do you have to use LONGVCHAR(100)

and for "bit data" types would I say:

CHAR FOR BIT DATA(30)
CHARACTER FOR BIT DATA(30)


You did install DB2 UDB V8 on one of your machines, right? You could also
install Information Center on one or your machines or visit:

http://publib.boulder.ibm.com/infoce...help/index.jsp

In my personal opinion checking syntax in the newsgroup appears to be excessive
use of internet - not mentioning even fact that your checks with documentation
would be significantly faster.

Nevertheless, here is relevant fragment from the syntax diagram:

+-+-+-CHARACTER-+--+-----------+--------------+--+---------------------+-+
| | '-CHAR------' '-(integer)-' | | (1) | |
| +-+-VARCHAR----------------+--(--integer--)-+ '--------FOR BIT DATA-' |
| | '-+-CHARACTER-+--VARYING-' | |
| | '-CHAR------' | |
| '-LONG VARCHAR------------------------------' |

which should answer your current question.
Jan M. Nelken
Nov 12 '05 #4
Mike wrote:
You shouldn't use SYSCOLUMNS (or any other object from the SYSIBM schema,
except SYSIBM.SYSDUMMY1) because that table is not documented and it
might
change or go away at any time. Instead, stick to the documented catalog
views from the SYSCAT schema (see Appendix D in the SQL Reference or here
Okay, thanx, I switched but my question remains, can you define a
parameter like this:

LONG VARCHAR(100) or do you have to use LONGVCHAR(100)


I don't know if the second variant works (never tried it). It is an
unnecessary abbreviation and it would just make things more difficult to
comprehend. That would be a no-go for me.
and for "bit data" types would I say:

CHAR FOR BIT DATA(30)
CHARACTER FOR BIT DATA(30)


As I said before, CHAR and CHARACTER are identical - just synonyms for the
same data type. So either one would be correct:

CHAR(30) FOR BIT DATA
CHARACTER(30) FOR BIT DATA

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #5
Knut, thank you so much, you've been a big help. We're getting a lot
of interest from DB2 folks, maybe because of IBM's Stinger push and
their DB2.NET managed driver, anyway, next I'm writing a template that
will generate the DB2 stored proc's and then an instance of our
dOOdads .NET architecture. I will go with your suggestions, thanx
again.

Mike Griffin
MyGeneration Software
http://www.mygenerationsoftware.com

PS: I'm on UDB 7 but upgrading to UDB 8 ...
Nov 12 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Tina Harris | last post by:
I ran the following query in Query Analyzer for a 7 column table. SELECT c.name,c.colid FROM syscolumns c WHERE c.id=925962375 ORDER BY c.colid The results were: I_CSD 1 X_STE_XML 2...
1
by: I wish | last post by:
I wrote some test code template <typename T> class A {}; class B{}; template < template <typename T> typename U > class C {}; int main( void )
2
by: Chris Foster | last post by:
Hi, I'm having some difficulty using types which are defined in a base class inside a derived class. The problem crops up using template classes. The following test code encapsulates what I'd...
1
by: lutorm | last post by:
Hi all, I'm working on migrating my code from KCC to gcc, and I'm having some issues with "implicit typename" warnings from gcc. Essentially, what happens is described by this example: ...
13
by: Staffan Langin | last post by:
Hello, In the following code-snippet, template<class Base> class Foo : public Base {
1
by: Carlos Martinez Garcia | last post by:
Hi all: I have the template class: template<typename InfoTabla> class TablaBusqueda { typename InfoTabla::Tabla TipoTabla; typename InfoTabla::Registro TipoRegistro; typename...
8
by: xuatla | last post by:
Hi, When I compile the following test code I got a warning about implicit typename. This happens in the member functions. Do you know the detail reason and solution? Thanks. - X ----------
1
by: ma740988 | last post by:
I'm wading my way through Josuttis template text. I'm having a hard time understanding some things. So given: template <class T> class generic_traits { public: typedef T value_type; };...
7
by: StephQ | last post by:
First of all: distinction of keywords typename and class in template arguments. Accoarding to a post in a well known moderated group: "There are three possibilities for template arguments: 1)...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.