|
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
boolean cfsqltype
So, I just noticed that there isn't a documented cf_sql_boolean typeDeanna Schneider 08/23/05 01:43 P Did you try cf_sql_bit or cf_sql_integer? Not boolean, I know, butBarney Boisvert 08/23/05 01:48 P Both bit and integer fail as well. I hard-coded a 1 in there, just soDeanna Schneider 08/23/05 01:59 P Deanna Schneider wrote:Jochem van Dieten 08/23/05 02:05 P Nope. Again it defaults it to char if you use no type.Deanna Schneider 08/23/05 02:15 P Deanna,Mark A Kruger 08/23/05 01:48 P On 8/23/05, Deanna Schneider <deanna.schneider@gmail.com> wrote:Eddie Awad 08/23/05 04:33 P Yah, I changed it to number and used 1/0. But, I'm still annoyed. :PDeanna Schneider 08/23/05 04:51 P Eddie Awad wrote:Jochem van Dieten 08/23/05 05:50 P On 8/23/05, Jochem van Dieten <jochemd@oli.tudelft.nl> wrote:Eddie Awad 08/23/05 06:12 P Eddie Awad wrote:Jochem van Dieten 08/23/05 06:32 P On 8/23/05, Jochem van Dieten <jochemd@oli.tudelft.nl> wrote:Eddie Awad 08/23/05 06:45 P See if cf_sql_bit works.S. Isaac Dealey 08/23/05 01:50 P > On 8/23/05, Deanna Schneider <deanna.schneider@gmail.com>S. Isaac Dealey 08/23/05 05:36 P
Author: Deanna Schneider
So, I just noticed that there isn't a documented cf_sql_boolean type for use with stored procedures. If you use it, though, it doesn't fail to compile, and it converts it to a cf_sql_char. But, with my stored proc in Oracle 10g - it's not going in as a boolean. (I get the error about wrong number or type of paramaters.) Does anyone know if there's a workaround that will really send a boolean to the stored proc, or do I need to alter my stored proc to not expect a boolean?
Author: Barney Boisvert
Did you try cf_sql_bit or cf_sql_integer? Not boolean, I know, but those seem like they'd have a better chance of working right than a CHAR value (which presumably CF uses as a default for unknown types, rather than erroring). cheers, barneyb On 8/23/05, Deanna Schneider <deanna.schneider@gmail.com> wrote: -- Barney Boisvert bboisvert@gmail.com 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 50 invites.
Author: Deanna Schneider
Both bit and integer fail as well. I hard-coded a 1 in there, just so I was sure I was sending a 1 or 0. No go. On 8/23/05, Barney Boisvert <bboisvert@gmail.com> wrote:
Author: Jochem van Dieten
Deanna Schneider wrote: > Both bit and integer fail as well. I hard-coded a 1 in there, just so > I was sure I was sending a 1 or 0. No go. Try no type and value TRUE. Jochem
Author: Deanna Schneider
Nope. Again it defaults it to char if you use no type. Dang - this is an annoying lack of functionality. On 8/23/05, Jochem van Dieten <jochemd@oli.tudelft.nl> wrote:
Author: Mark A Kruger
Deanna, Try a "CF_SQL_BIT" and pass 0 or 1. -Mark So, I just noticed that there isn't a documented cf_sql_boolean type for use with stored procedures. If you use it, though, it doesn't fail to compile, and it converts it to a cf_sql_char. But, with my stored proc in Oracle 10g - it's not going in as a boolean. (I get the error about wrong number or type of paramaters.) Does anyone know if there's a workaround that will really send a boolean to the stored proc, or do I need to alter my stored proc to not expect a boolean?
Author: Eddie Awad
On 8/23/05, Deanna Schneider <deanna.schneider@gmail.com> wrote: Oracle's PL/SQL Boolean data type does not have an equivalent in ColdFusion, I think this may be because "Boolean" is not a native SQL data type. So, what I usually end up doing is to change the data type of the Boolean argument in my stored procedure to something like varchar2(1), accepting values of Y/N or T/F. -- Eddie Awad. http://awads.net/
Author: Deanna Schneider
Yah, I changed it to number and used 1/0. But, I'm still annoyed. :P On 8/23/05, Eddie Awad <ra3masis@gmail.com> wrote:
Author: Jochem van Dieten
Eddie Awad wrote: > > Oracle's PL/SQL Boolean data type does not have an equivalent in > ColdFusion, I think this may be because "Boolean" is not a native SQL > data type. Boolean is a native SQL datatype. Strangely enough it is not a JDBC datatype though. Jochem
Author: Eddie Awad
On 8/23/05, Jochem van Dieten <jochemd@oli.tudelft.nl> wrote: > Boolean is a native SQL datatype. In Oracle, Boolean is not a native SQL datatype. It is a PL/SQL datatype. In other words, you cannot create a database table having a column with a boolean datatype: H:\SQLplus>sqlplus scott/tiger SQL*Plus: Release 9.2.0.1.0 - Production on Tue Aug 23 15:03:57 2005 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Connected to: Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production With the Partitioning, OLAP and Oracle Data Mining options JServer Release 9.2.0.1.0 - Production scott@eddev> create table t (mycol boolean); create table t (mycol boolean) * ERROR at line 1: ORA-00902: invalid datatype scott@eddev> create table t (mycol varchar2(1)); Table created. Related Oracle documentation: http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96524/c13datyp.htm http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96624/03_types.htm -- Eddie Awad. http://awads.net/
Author: Jochem van Dieten
Eddie Awad wrote: I think you are reading me wrong. When I write that boolean is a native SQL datatype I am not refering to some implementation, I am refering to the SQL standard. See ISO/IEC 9075-2:2003 4.1.2 And I find it far more likely that the reason there is no cf_sql_boolean type is that there is no boolean type in JDBC then that some implementation choose to implement a certain type in some weird way. Jochem
Author: Eddie Awad
On 8/23/05, Jochem van Dieten <jochemd@oli.tudelft.nl> wrote: > I think you are reading me wrong. When I write that boolean is a > native SQL datatype I am not refering to some implementation, I > am refering to the SQL standard. See ISO/IEC 9075-2:2003 4.1.2 Jochem, I think we misunderstood each other. I was referring to Oracle's implementation. No harm done :) -- Eddie Awad. http://awads.net/
Author: S. Isaac Dealey
See if cf_sql_bit works. s. isaac dealey 954.522.6080 new epoch : isn't it time for a change? add features without fixtures with the onTap open source framework http://www.fusiontap.com http://coldfusion.sys-con.com/author/4806Dealey.htm
Author: S. Isaac Dealey
> On 8/23/05, Deanna Schneider <deanna.schneider@gmail.com> Seems like it'd make a lot more sense to use a bit or int column and the values 0 or 1 since these are commonly used as boolean values in config files and most databases around the world when a boolean datatype isn't available or isn't used. Plus CF can evaluate a 0 or 1 value in a query column on its own without the need to determine if it's using Y/N or T/F. I've seen people use Y/N or T/F or "Yes" and "No" in db columns and I LOATHE them all. I'd accept a boolean datatype if the db has one, although I'm not likely to create a column with that data type myself. s. isaac dealey 954.522.6080 new epoch : isn't it time for a change? add features without fixtures with the onTap open source framework http://www.fusiontap.com http://coldfusion.sys-con.com/author/4806Dealey.htm
|
Mailing Lists
|
Latest Fusion Authority Articles
|
||||||