Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 12th, 2005, 06:31 AM
Chettiar
Guest
 
Posts: n/a
Default UDB Query

I have a created a table as follows:
CREATE TABLE DB2ADMIN.D_EL_LR
(DEAL_ID INTEGER NOT NULL,
LOB VARCHAR(4) NOT NULL DEFAULT '',
LR_NAME VARCHAR(100) NOT NULL DEFAULT '');

I start to insert data in the table.
My insert statement is as follows:
insert into d_el_lr (deal_id) values (1234);

I get a message that 1 row is inserted.

When I say in the command centre

select * from D_EL_LR

I get the following result:

DEAL_ID LOB LR_NAME
------- ---- -------
1234

When I give the select query from any 3rd party tool, I get the following
DEAL_ID LOB LR_NAME
------- ---- -------
1234 Null Null

But this violates the table definition.

Can anyone help as to why this is happening.

Best Regards
Sandip
  #2  
Old November 12th, 2005, 06:31 AM
Serge Rielau
Guest
 
Posts: n/a
Default Re: UDB Query

Seems like a tool problem.
What sorts of "any" tool have you tried?
Given that command center gives you output as expected and the insert
worked, My vote goes to DB2 being corect.

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab
  #3  
Old November 12th, 2005, 06:32 AM
PM \(pm3iinc-nospam\)
Guest
 
Posts: n/a
Default Re: UDB Query

To double check, in the clp, use Where LR_NAME is null.

PM


"Chettiar" <chettiarsandip@yahoo.com> a écrit dans le message de
news:c130a4b8.0402090053.288cb5af@posting.google.c om...[color=blue]
> I have a created a table as follows:
> CREATE TABLE DB2ADMIN.D_EL_LR
> (DEAL_ID INTEGER NOT NULL,
> LOB VARCHAR(4) NOT NULL DEFAULT '',
> LR_NAME VARCHAR(100) NOT NULL DEFAULT '');
>
> I start to insert data in the table.
> My insert statement is as follows:
> insert into d_el_lr (deal_id) values (1234);
>
> I get a message that 1 row is inserted.
>
> When I say in the command centre
>
> select * from D_EL_LR
>
> I get the following result:
>
> DEAL_ID LOB LR_NAME
> ------- ---- -------
> 1234
>
> When I give the select query from any 3rd party tool, I get the following
> DEAL_ID LOB LR_NAME
> ------- ---- -------
> 1234 Null Null
>
> But this violates the table definition.
>
> Can anyone help as to why this is happening.
>
> Best Regards
> Sandip[/color]


  #4  
Old November 12th, 2005, 06:48 AM
Joseph
Guest
 
Posts: n/a
Default Re: UDB Query

yes. your 3rd party tool is displaying NULL for the empty string,
which I don't think is a very good idea.

Joseph

chettiarsandip@yahoo.com (Chettiar) writes:
[color=blue]
>I have a created a table as follows:
>CREATE TABLE DB2ADMIN.D_EL_LR
> (DEAL_ID INTEGER NOT NULL,
> LOB VARCHAR(4) NOT NULL DEFAULT '',
> LR_NAME VARCHAR(100) NOT NULL DEFAULT '');[/color]
[color=blue]
>I start to insert data in the table.
>My insert statement is as follows:
>insert into d_el_lr (deal_id) values (1234);[/color]
[color=blue]
>I get a message that 1 row is inserted.[/color]
[color=blue]
>When I say in the command centre[/color]
[color=blue]
>select * from D_EL_LR[/color]
[color=blue]
>I get the following result:[/color]
[color=blue]
>DEAL_ID LOB LR_NAME
>------- ---- -------
>1234[/color]
[color=blue]
>When I give the select query from any 3rd party tool, I get the following
>DEAL_ID LOB LR_NAME
>------- ---- -------
>1234 Null Null[/color]
[color=blue]
>But this violates the table definition.[/color]
[color=blue]
>Can anyone help as to why this is happening.[/color]
[color=blue]
>Best Regards
>Sandip[/color]
  #5  
Old November 12th, 2005, 06:48 AM
Knut Stolze
Guest
 
Posts: n/a
Default Re: UDB Query

Joseph <joseph@aracnet.com> wrote:
[color=blue]
> yes. your 3rd party tool is displaying NULL for the empty string,
> which I don't think is a very good idea.[/color]

That's simply wrong because NULL is something completely different than an
empty string.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,248 network members.