Zero-length Data Properties

5 messages Options
Embed this post
Permalink
Jackie Ng

Zero-length Data Properties

Reply Threaded More More options
Print post
Permalink
Hi All,

I have two related questions about Data Properties

A) Why does FDO allow zero-length string/CLOB/BLOB data properties? In my feeble little mind, zero-length strings/CLOBs/BLOBs makes no sense whatsoever.

B) I noticed that for some providers, the GetMaximumDataValueLength() method returns -1 for string/BLOB/CLOB properties. The same goes for GetMaximumDecimalPrecision() and GetMaximumPrecisionScale(). If I were to do something like this:

ISchemaCapabilities capabilities;
...
DataPropertyDefinition def = new DataPropertyDefinition("StringProp", "");
def.Length = capabilities.GetMaximumDataValueLength(DataType.DataType_String);

It would throw an exception because the Length property of DataPropertyDefinition can't be negative. So what should this value (-1) be interpreted as?

- Jackie
Thomas Knoell

RE: Zero-length Data Properties

Reply Threaded More More options
Print post
Permalink
Hi Jackie,

The -1 is an indicator that the exact value cannot be determined. This is especially the case in ODBC that can connect to multiple data store sources, all with different limitations. Because the capability information is available before a connection is actually established more precise information cannot be provided.

Thanks

  Thomas

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Jackie C. Ng
Sent: Tuesday, September 02, 2008 4:47 AM
To: [hidden email]
Subject: [fdo-internals] Zero-length Data Properties


Hi All,

I have two related questions about Data Properties

A) Why does FDO allow zero-length string/CLOB/BLOB data properties? In my
feeble little mind, zero-length strings/CLOBs/BLOBs makes no sense
whatsoever.

B) I noticed that for some providers, the GetMaximumDataValueLength() method
returns -1 for string/BLOB/CLOB properties. The same goes for
GetMaximumDecimalPrecision() and GetMaximumPrecisionScale(). If I were to do
something like this:

ISchemaCapabilities capabilities;
...
DataPropertyDefinition def = new DataPropertyDefinition("StringProp", "");
def.Length =
capabilities.GetMaximumDataValueLength(DataType.DataType_String);

It would throw an exception because the Length property of
DataPropertyDefinition can't be negative. So what should this value (-1) be
interpreted as?

- Jackie

-----
http://themapguyde.blogspot.com

http://www.linkedin.com/in/jackieng
--
View this message in context: http://www.nabble.com/Zero-length-Data-Properties-tp19266363p19266363.html
Sent from the FDO Internals mailing list archive at Nabble.com.

_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals
_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals
Jackie Ng

RE: Zero-length Data Properties

Reply Threaded More More options
Print post
Permalink
Thomas,

But for something like SDF, even it returns -1 for string/BLOB/CLOB. It is a fixed format with fixed specifications. What is the deal there?

- Jackie

Thomas Knoell wrote:
Hi Jackie,

The -1 is an indicator that the exact value cannot be determined. This is especially the case in ODBC that can connect to multiple data store sources, all with different limitations. Because the capability information is available before a connection is actually established more precise information cannot be provided.

Thanks

  Thomas

-----Original Message-----
From: fdo-internals-bounces@lists.osgeo.org [mailto:fdo-internals-bounces@lists.osgeo.org] On Behalf Of Jackie C. Ng
Sent: Tuesday, September 02, 2008 4:47 AM
To: fdo-internals@lists.osgeo.org
Subject: [fdo-internals] Zero-length Data Properties


Hi All,

I have two related questions about Data Properties

A) Why does FDO allow zero-length string/CLOB/BLOB data properties? In my
feeble little mind, zero-length strings/CLOBs/BLOBs makes no sense
whatsoever.

B) I noticed that for some providers, the GetMaximumDataValueLength() method
returns -1 for string/BLOB/CLOB properties. The same goes for
GetMaximumDecimalPrecision() and GetMaximumPrecisionScale(). If I were to do
something like this:

ISchemaCapabilities capabilities;
...
DataPropertyDefinition def = new DataPropertyDefinition("StringProp", "");
def.Length =
capabilities.GetMaximumDataValueLength(DataType.DataType_String);

It would throw an exception because the Length property of
DataPropertyDefinition can't be negative. So what should this value (-1) be
interpreted as?

- Jackie

-----
http://themapguyde.blogspot.com

http://www.linkedin.com/in/jackieng
--
View this message in context: http://www.nabble.com/Zero-length-Data-Properties-tp19266363p19266363.html
Sent from the FDO Internals mailing list archive at Nabble.com.

_______________________________________________
fdo-internals mailing list
fdo-internals@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-internals
_______________________________________________
fdo-internals mailing list
fdo-internals@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-internals
Traian Stanev

RE: Zero-length Data Properties

Reply Threaded More More options
Print post
Permalink

In this case -1 means "limited by available system resources", which is also not easy to determine.

Traian



> -----Original Message-----
> From: [hidden email] [mailto:fdo-internals-
> [hidden email]] On Behalf Of Jackie C. Ng
> Sent: Tuesday, September 02, 2008 11:05 AM
> To: [hidden email]
> Subject: RE: [fdo-internals] Zero-length Data Properties
>
>
> Thomas,
>
> But for something like SDF, even it returns -1 for string/BLOB/CLOB. It
> is a
> fixed format with fixed specifications. What is the deal there?
>
> - Jackie
>
>
> Thomas Knoell wrote:
> >
> > Hi Jackie,
> >
> > The -1 is an indicator that the exact value cannot be determined.
> This is
> > especially the case in ODBC that can connect to multiple data store
> > sources, all with different limitations. Because the capability
> > information is available before a connection is actually established
> more
> > precise information cannot be provided.
> >
> > Thanks
> >
> >   Thomas
> >
> > -----Original Message-----
> > From: [hidden email]
> > [mailto:[hidden email]] On Behalf Of Jackie C.
> Ng
> > Sent: Tuesday, September 02, 2008 4:47 AM
> > To: [hidden email]
> > Subject: [fdo-internals] Zero-length Data Properties
> >
> >
> > Hi All,
> >
> > I have two related questions about Data Properties
> >
> > A) Why does FDO allow zero-length string/CLOB/BLOB data properties?
> In my
> > feeble little mind, zero-length strings/CLOBs/BLOBs makes no sense
> > whatsoever.
> >
> > B) I noticed that for some providers, the GetMaximumDataValueLength()
> > method
> > returns -1 for string/BLOB/CLOB properties. The same goes for
> > GetMaximumDecimalPrecision() and GetMaximumPrecisionScale(). If I
> were to
> > do
> > something like this:
> >
> > ISchemaCapabilities capabilities;
> > ...
> > DataPropertyDefinition def = new DataPropertyDefinition("StringProp",
> "");
> > def.Length =
> > capabilities.GetMaximumDataValueLength(DataType.DataType_String);
> >
> > It would throw an exception because the Length property of
> > DataPropertyDefinition can't be negative. So what should this value
> (-1)
> > be
> > interpreted as?
> >
> > - Jackie
> >
> > -----
> > http://themapguyde.blogspot.com
> >
> > http://www.linkedin.com/in/jackieng
> > --
> > View this message in context:
> > http://www.nabble.com/Zero-length-Data-Properties-
> tp19266363p19266363.html
> > Sent from the FDO Internals mailing list archive at Nabble.com.
> >
> > _______________________________________________
> > fdo-internals mailing list
> > [hidden email]
> > http://lists.osgeo.org/mailman/listinfo/fdo-internals
> > _______________________________________________
> > fdo-internals mailing list
> > [hidden email]
> > http://lists.osgeo.org/mailman/listinfo/fdo-internals
> >
> >
>
>
> -----
> http://themapguyde.blogspot.com
>
> http://www.linkedin.com/in/jackieng
> --
> View this message in context: http://www.nabble.com/Zero-length-Data-
> Properties-tp19266363p19271951.html
> Sent from the FDO Internals mailing list archive at Nabble.com.
>
> _______________________________________________
> fdo-internals mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-internals
_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals
Thomas Knoell

RE: Zero-length Data Properties

Reply Threaded More More options
Print post
Permalink
In reply to this post by Jackie Ng
Hi Jackie,

-1 is also returned when something is not supported. For example, if you ask for the maximum data value length for a BLOB/CLOB in SDF, -1 is returned because those types are not supported. And then there is the case that Trajan mentioned.

Maybe the -1 indicator is too overloaded with different contexts and may require some reviewing.

Thanks

  Thomas

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Jackie C. Ng
Sent: Tuesday, September 02, 2008 11:05 AM
To: [hidden email]
Subject: RE: [fdo-internals] Zero-length Data Properties


Thomas,

But for something like SDF, even it returns -1 for string/BLOB/CLOB. It is a
fixed format with fixed specifications. What is the deal there?

- Jackie


Thomas Knoell wrote:

>
> Hi Jackie,
>
> The -1 is an indicator that the exact value cannot be determined. This is
> especially the case in ODBC that can connect to multiple data store
> sources, all with different limitations. Because the capability
> information is available before a connection is actually established more
> precise information cannot be provided.
>
> Thanks
>
>   Thomas
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Jackie C. Ng
> Sent: Tuesday, September 02, 2008 4:47 AM
> To: [hidden email]
> Subject: [fdo-internals] Zero-length Data Properties
>
>
> Hi All,
>
> I have two related questions about Data Properties
>
> A) Why does FDO allow zero-length string/CLOB/BLOB data properties? In my
> feeble little mind, zero-length strings/CLOBs/BLOBs makes no sense
> whatsoever.
>
> B) I noticed that for some providers, the GetMaximumDataValueLength()
> method
> returns -1 for string/BLOB/CLOB properties. The same goes for
> GetMaximumDecimalPrecision() and GetMaximumPrecisionScale(). If I were to
> do
> something like this:
>
> ISchemaCapabilities capabilities;
> ...
> DataPropertyDefinition def = new DataPropertyDefinition("StringProp", "");
> def.Length =
> capabilities.GetMaximumDataValueLength(DataType.DataType_String);
>
> It would throw an exception because the Length property of
> DataPropertyDefinition can't be negative. So what should this value (-1)
> be
> interpreted as?
>
> - Jackie
>
> -----
> http://themapguyde.blogspot.com
>
> http://www.linkedin.com/in/jackieng
> --
> View this message in context:
> http://www.nabble.com/Zero-length-Data-Properties-tp19266363p19266363.html
> Sent from the FDO Internals mailing list archive at Nabble.com.
>
> _______________________________________________
> fdo-internals mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-internals
> _______________________________________________
> fdo-internals mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fdo-internals
>
>


-----
http://themapguyde.blogspot.com

http://www.linkedin.com/in/jackieng
--
View this message in context: http://www.nabble.com/Zero-length-Data-Properties-tp19266363p19271951.html
Sent from the FDO Internals mailing list archive at Nabble.com.

_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals
_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals