CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 CCS Incorrectly generates code for ccsBoolean

Print topic Send  topic

Author Message
DAVID
Posted: 01/17/2003, 9:01 AM

in functions ToSQL, SQLValue

even though project-wide boolean format is set to 1;0
and db connection boolean format is set to 1;0

CCS instead of:
----------------------------------------------------------------------------
--------
sub ToSQL {
my ($self, $Value, $ValueType) = @_;
if ( length($Value) || $ValueType == $ccsBoolean ) {
if ( $ValueType == $ccsInteger || $ValueType == $ccsFloat ) {
return ( 0 + replace($Value, ",", ".") );
} elsif ( $ValueType == $ccsDate ) {
return $self->{dbh}->quote($Value);
} elsif ( $ValueType == $ccsBoolean ) {
return ( uc($Value) eq "FALSE" || $Value eq "0" ) ? "0" : "1";
} else {
return $self->{dbh}->quote($Value);
}
} else {
return "NULL";
}
}

sub SQLValue {
my ($self, $Value, $ValueType) = @_;
if ( length($Value) || $ValueType == $ccsBoolean) {
if ( $ValueType == $ccsInteger || $ValueType == $ccsFloat ) {
return ( 0 + replace($Value, ",", ".") );
} elsif ( $ValueType == $ccsBoolean ) {
return ( uc($Value) eq "FALSE" || $Value == 0 ) ? "0" : "1";
} else {
# return $self->{dbh}->quote($Value);
return $Value;
}
}
}
----------------------------------------------------------------------------
--------
produces:
sub ToSQL {
my ($self, $Value, $ValueType) = @_;
if ( length($Value) || $ValueType == $ccsBoolean ) {
if ( $ValueType == $ccsInteger || $ValueType == $ccsFloat ) {
return ( 0 + replace($Value, ",", ".") );
} elsif ( $ValueType == $ccsDate ) {
return $self->{dbh}->quote($Value);
} elsif ( $ValueType == $ccsBoolean ) {
return ( uc($Value) eq "FALSE" || $Value eq "0" ) ? "FALSE" :
"TRUE";
} else {
return $self->{dbh}->quote($Value);
}
} else {
return "NULL";
}
}

sub SQLValue {
my ($self, $Value, $ValueType) = @_;
if ( length($Value) || $ValueType == $ccsBoolean) {
if ( $ValueType == $ccsInteger || $ValueType == $ccsFloat ) {
return ( 0 + replace($Value, ",", ".") );
} elsif ( $ValueType == $ccsBoolean ) {
return ( uc($Value) eq "FALSE" || $Value == 0 ) ? "FALSE" : "TRUE";
} else {
# return $self->{dbh}->quote($Value);
return $Value;
}
}
}


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.