Issues

Select view

Select search mode

 

CHAR type in cfprocparam passes empty string as NULL

Fixed

Description

Lucee treats empty strings as NULL for the CHAR type in cfprocparam

Lucee treats empty strings, inside the CHAR CF SQL type of the cfprocparam tag, as:

NULL

Lucee treats empty strings, inside the VARCHAR CF SQL type of the cfprocparam tag, as:

EMPTY STRING

If you wish to follow the way ACF treats NULLs, in relation to SQL, please use the VARCHAR

Example:

<cfprocparam cfsqltype="CF_SQL_CHAR" maxlength="32" value="#variables.stInstance.szPosterRole#" type="in"/>

Change to:

<cfprocparam cfsqltype="CF_SQL_VARCHAR" maxlength="32" value="#variables.stInstance.szPosterRole#" type="in"/>

https://dev.lucee.org/t/how-pass-send-empty-char-strings-to-the-database/12817

https://github.com/lucee/Lucee/blob/5c70608c5bf4b474f20029bc24d557fb47d5bbab/core/src/main/java/lucee/runtime/db/SQLCaster.java#L201

Environment

Lucee 5.3.9.166

Windows Server 2016

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Created 20 July 2023 at 09:55
Updated 21 July 2023 at 10:29
Resolved 21 July 2023 at 10:29

Activity

Show:

Pothys - MitrahSoft21 July 2023 at 10:27

I checked this issue with lucee latest versions 5.4.2.14-RC and 6.0.0.517-SNAPSHOT. Now the char type in cfprocparam successfully passes the empty string and it doesn't change the empty string as null value. The issue was solved.

Flag notifications