Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Null Values Structure

7 posts in General Discussion (old) Last posting was on 2000-03-16 02:26:23.0Z
Nick Meredith Posted on 2000-03-15 14:05:35.0Z
Newsgroups: sybase.public.easerver
From: "Nick Meredith" <nickm@iplbath.com>
Subject: Null Values Structure
Date: Wed, 15 Mar 2000 14:05:35 -0000
Lines: 14
Organization: IPL
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
NNTP-Posting-Host: h1.iplbath.com 195.153.211.7
Message-ID: <347_YJCU9goj$GA.151@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26382
Article PK: 157053

All,
Am I right to assume that when passing a structure from a powerbuilder
nvo to a powerbuilder component in jaguar via a proxy that even though the
Null Values structure will be used, it will not indicate the 'Null-ness' of
the elements of the structure. Ie. the structures unsignedlong elements will
become 0.
If so is there an easy way round this other than to mimic the null
values flag scheme for the structure myself!!

TIA

Nick


Evan Ireland Posted on 2000-03-15 20:32:31.0Z
Newsgroups: sybase.public.easerver
Date: Thu, 16 Mar 2000 09:32:31 +1300
From: Evan Ireland <eireland@sybase.com>
Organization: Sybase, Inc.
X-Mailer: Mozilla 4.7 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Nick Meredith <nickm@iplbath.com>
Subject: Re: Null Values Structure
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 27
NNTP-Posting-Host: 158.159.8.79
Message-ID: <347_38CFF35F.841FAA8D@sybase.com>
References: <347_YJCU9goj$GA.151@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26343
Article PK: 157010


Nick Meredith wrote:
>
> All,
> Am I right to assume that when passing a structure from a powerbuilder
> nvo to a powerbuilder component in jaguar via a proxy that even though the
> Null Values structure will be used, it will not indicate the 'Null-ness' of
> the elements of the structure. Ie. the structures unsignedlong elements will
> become 0.
> If so is there an easy way round this other than to mimic the null
> values flag scheme for the structure myself!!

I would recommend defining your structure as follows:

struct MyStruct
{
string name;
boolean nameIsNull;
string phone;
boolean phoneIsNull;
}

rather than passing this information in separate parameters. This is especially
useful if your project may involve more than one component model.
________________________________________________________________________________

Evan Ireland Sybase EAServer Engineering eireland@sybase.com
Wellington, New Zealand +64 4 934-5856


Glenn Santa Cruz Posted on 2000-03-15 22:45:50.0Z
Newsgroups: sybase.public.easerver
Date: Wed, 15 Mar 2000 16:45:50 -0600
From: Glenn Santa Cruz <spam?no.glenn_santacruz@dailyaccess.com>
Organization: Daily Access Concepts
X-Mailer: Mozilla 4.7 [en] (Win95; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Null Values Structure
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 41
NNTP-Posting-Host: 12.6.74.30
Message-ID: <347_38D0129E.1F298BF6@dailyaccess.com>
References: <347_YJCU9goj$GA.151@forums.sybase.com> <347_38CFF35F.841FAA8D@sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26329
Article PK: 156998

I'm feeling a bit dense today, so please bear with me... ;)

Is the non-nullness of IDL datatypes reflected in
TabularResults::ResultSet? In other words, I retrieve a certain number
of rows into a datastore (and one or more fields that were retrieved are
NULL), then GenerateResultSet and pass back the
ResultSet to the calling client. I've not yet experienced any problem
with this, but was curious to know where it fits into the greater scheme
of things.

TIA

Glenn

Evan Ireland wrote:
>
> Nick Meredith wrote:
> >
> > All,
> > Am I right to assume that when passing a structure from a powerbuilder
> > nvo to a powerbuilder component in jaguar via a proxy that even though the
> > Null Values structure will be used, it will not indicate the 'Null-ness' of
> > the elements of the structure. Ie. the structures unsignedlong elements will
> > become 0.
> > If so is there an easy way round this other than to mimic the null
> > values flag scheme for the structure myself!!
>
> I would recommend defining your structure as follows:
>
> struct MyStruct
> {
> string name;
> boolean nameIsNull;
> string phone;
> boolean phoneIsNull;
> }
>
> rather than passing this information in separate parameters. This is especially
> useful if your project may involve more than one component model.
> ________________________________________________________________________________
>
> Evan Ireland Sybase EAServer Engineering eireland@sybase.com
> Wellington, New Zealand +64 4 934-5856


Dave Wolf [Sybase] Posted on 2000-03-16 01:27:22.0Z
Newsgroups: sybase.public.easerver
From: "Dave Wolf [Sybase]" <dwolf@sybase.com>
Subject: Re: Null Values Structure
Date: Wed, 15 Mar 2000 20:27:22 -0500
Lines: 64
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
NNTP-Posting-Host: vpn-eme-022.sybase.com 130.214.8.22
Message-ID: <347_zHPodduj$GA.285@forums.sybase.com>
References: <347_YJCU9goj$GA.151@forums.sybase.com> <347_38CFF35F.841FAA8D@sybase.com> <347_38D0129E.1F298BF6@dailyaccess.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26323
Article PK: 156997

TabularResults.ResultSet handles this. Dont forget in JDBC nulls arent
returned. Rather replacement values are using and you need to call
wasNull(). We handle this and make sure the resulting implementation of
java.sql.ResultSet is correct.

Dave Wolf
Internet Applications Division

"Glenn Santa Cruz" <spam?no.glenn_santacruz@dailyaccess.com> wrote in
message news:38D0129E.1F298BF6@dailyaccess.com...
> I'm feeling a bit dense today, so please bear with me... ;)
>
> Is the non-nullness of IDL datatypes reflected in
> TabularResults::ResultSet? In other words, I retrieve a certain number
> of rows into a datastore (and one or more fields that were retrieved are
> NULL), then GenerateResultSet and pass back the
> ResultSet to the calling client. I've not yet experienced any problem
> with this, but was curious to know where it fits into the greater scheme
> of things.
>
> TIA
>
> Glenn
>
> Evan Ireland wrote:
> >
> > Nick Meredith wrote:
> > >
> > > All,
> > > Am I right to assume that when passing a structure from a
powerbuilder
> > > nvo to a powerbuilder component in jaguar via a proxy that even though
the
> > > Null Values structure will be used, it will not indicate the
'Null-ness' of
> > > the elements of the structure. Ie. the structures unsignedlong
elements will
> > > become 0.
> > > If so is there an easy way round this other than to mimic the null
> > > values flag scheme for the structure myself!!
> >
> > I would recommend defining your structure as follows:
> >
> > struct MyStruct
> > {
> > string name;
> > boolean nameIsNull;
> > string phone;
> > boolean phoneIsNull;
> > }
> >
> > rather than passing this information in separate parameters. This is
especially
> > useful if your project may involve more than one component model.
> >

____________________________________________________________________________
____
> >
> > Evan Ireland Sybase EAServer Engineering
eireland@sybase.com
> > Wellington, New Zealand +64 4
934-5856


Evan Ireland Posted on 2000-03-16 02:26:23.0Z
Newsgroups: sybase.public.easerver
Date: Thu, 16 Mar 2000 15:26:23 +1300
From: Evan Ireland <eireland@sybase.com>
Organization: Sybase, Inc.
X-Mailer: Mozilla 4.7 [en] (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
To: "Dave Wolf [Sybase]" <dwolf@sybase.com>
Subject: Re: Null Values Structure
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 55
NNTP-Posting-Host: 158.159.8.79
Message-ID: <347_38D0464F.2EC1D02E@sybase.com>
References: <347_YJCU9goj$GA.151@forums.sybase.com> <347_38CFF35F.841FAA8D@sybase.com> <347_38D0129E.1F298BF6@dailyaccess.com> <347_zHPodduj$GA.285@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26322
Article PK: 156994


"Dave Wolf [Sybase]" wrote:
>
> TabularResults.ResultSet handles this. Dont forget in JDBC nulls arent
> returned. Rather replacement values are using and you need to call
> wasNull(). We handle this and make sure the resulting implementation of
> java.sql.ResultSet is correct.
>
> Dave Wolf
> Internet Applications Division

Specificallt, the definition of TabularResults::Column is

/**
** A result column consists of meta data and data values, as well as
** a sequence indicating which rows contain null values. The length of
** 'nulls' may be less than the number of result rows. The default value
** if a row's 'nulls' entry is not present is false (i.e. non-null). This
** optimisation is particularly useful when the column's 'flags' contains
** the FLAG_NOT_NULLABLE bit.
** <p>The precision for floating-point decimal values is calculated as
** 'width - sign - dot', where sign = 1 if the flags bit FLAG_UNSIGNED
** is set (otherwise sign = 0), and dot = 1 if scale > 0 (otherwise
** dot = 0).
** <p>The scale must be zero for TYPE_BIGINT.
**/
struct Column
{
unsigned long flags;
unsigned long width;
unsigned long scale;
string name;
string label;
::TabularResults::Data values;
::TabularResults::BooleanSeq nulls;
};

> "Glenn Santa Cruz" <spam?no.glenn_santacruz@dailyaccess.com> wrote in
> message news:38D0129E.1F298BF6@dailyaccess.com...
> > I'm feeling a bit dense today, so please bear with me... ;)
> >
> > Is the non-nullness of IDL datatypes reflected in
> > TabularResults::ResultSet? In other words, I retrieve a certain number
> > of rows into a datastore (and one or more fields that were retrieved are
> > NULL), then GenerateResultSet and pass back the
> > ResultSet to the calling client. I've not yet experienced any problem
> > with this, but was curious to know where it fits into the greater scheme
> > of things.
________________________________________________________________________________

Evan Ireland Sybase EAServer Engineering eireland@sybase.com
Wellington, New Zealand +64 4 934-5856


Jim O'Neil [Sybase] Posted on 2000-03-15 15:57:27.0Z
Newsgroups: sybase.public.easerver
Date: Wed, 15 Mar 2000 10:57:27 -0500
From: "Jim O'Neil [Sybase]" <joneil@sybase.com>
Organization: Sybase, Inc.
X-Mailer: Mozilla 4.7 [en]C-CCK-MCD (WinNT; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Null Values Structure
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 31
NNTP-Posting-Host: joneil-nt.sybase.com 204.167.42.111
Message-ID: <347_38CFB2E7.F059DAFD@sybase.com>
References: <347_YJCU9goj$GA.151@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26364
Article PK: 157033


Nick Meredith wrote:

> All,
> Am I right to assume that when passing a structure from a powerbuilder
> nvo to a powerbuilder component in jaguar via a proxy that even though the
> Null Values structure will be used, it will not indicate the 'Null-ness' of
> the elements of the structure. Ie. the structures unsignedlong elements will
> become 0.
> If so is there an easy way round this other than to mimic the null
> values flag scheme for the structure myself!!
>
> TIA
>
> Nick

Yes, you're right. The flag will indicate the 'nullness' of the structure, but
not of the individual elements within the structure - given the potential
complexity of a structure, you can see how this could severely impact
performance. I suppose you could mimic this with some sort of sentinel value
that you know would never occur in 'real' life. In general, though you may want
to investigate if you truly need to pass null values at all. Keep in mind, that
a Java client, like a page in PowerDynamo will have to know about that extra
nullvalues argument, so it makes processing a bit less tidy for clients other
than PowerBuilder.
--
Jim O'Neil
Senior Technical Support Engineer
Sybase, Inc


Dave Wolf [Sybase] Posted on 2000-03-15 15:05:22.0Z
Newsgroups: sybase.public.easerver
From: "Dave Wolf [Sybase]" <dwolf@sybase.com>
Subject: Re: Null Values Structure
Date: Wed, 15 Mar 2000 10:05:22 -0500
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
NNTP-Posting-Host: dwolf-nt.sybase.com 157.133.41.72
Message-ID: <347_f8gl#Bpj$GA.201@forums.sybase.com>
References: <347_YJCU9goj$GA.151@forums.sybase.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:26375
Article PK: 157042

CORBA doesnt allow null values to be passed in 2.2. So PB has a feature
where it creates a structure of indicator values. Each value indicates
whether a passed parameter is actually null. Rather than pass the illegal
null we use a replacement value like "" or 0 and then set the indicator flag
to indicate the value is truly null.

Dave Wolf
Internet Applications Division

"Nick Meredith" <nickm@iplbath.com> wrote in message
news:YJCU9goj$GA.151@forums.sybase.com...
> All,
> Am I right to assume that when passing a structure from a powerbuilder
> nvo to a powerbuilder component in jaguar via a proxy that even though the
> Null Values structure will be used, it will not indicate the 'Null-ness'
of
> the elements of the structure. Ie. the structures unsignedlong elements
will
> become 0.
> If so is there an easy way round this other than to mimic the null
> values flag scheme for the structure myself!!
>
> TIA
>
> Nick
>
>