Issue Details (XML | Word | Printable)

Key: CORE-1875
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Vlad Khorsun
Reporter: Zhuldyz
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Error on script with current_date

Created: 30/Apr/08 10:45 AM   Updated: 18/Nov/08 12:48 PM
Component/s: Scripts
Affects Version/s: 2.1.0
Fix Version/s: 2.5 Alpha 1, 2.1.1

Time Tracking:
Not Specified

Environment: Windows Server 2003, Server Version: WI-V2.1.0.17798 Firebird 2.1 Classic

Planning Status: Unspecified


 Description  « Hide
DDL:

SET SQL DIALECT 3;

SET NAMES WIN1251;

CREATE TABLE NEW_TABLE (
    F1 VARCHAR(30),
    F2 VARCHAR(30),
    F3 VARCHAR(30),
    DATA_REG DATE
);

Error on script:

EXECUTE BLOCK(
IN_F1 VARCHAR(30) = :IN_F1,
IN_F2 VARCHAR(30) = :IN_F2,
IN_F3 VARCHAR(30) = :IN_F3)
AS
BEGIN
    IF (NOT(EXISTS(SELECT * FROM NEW_TABLE NT WHERE NT.F1=:IN_F1 AND NT.F2=:IN_F2 AND NT.DATA_REG=CURRENT_DATE))) THEN
        BEGIN
        END ELSE
        BEGIN
        END
END

Server closes connection on script:

EXECUTE BLOCK(
IN_F1 VARCHAR(30) = :IN_F1,
IN_F2 VARCHAR(30) = :IN_F2,
IN_F3 VARCHAR(30) = :IN_F3)
AS
BEGIN
    IF (NOT(EXISTS(SELECT * FROM NEW_TABLE NT WHERE NT.F1=:IN_F1 AND NT.F2=:IN_F2 AND NT.DATA_REG=CAST(CURRENT_DATE AS DATE) ))) THEN
        BEGIN
        END ELSE
        BEGIN
        END
END

No problem on script, eg:

EXECUTE BLOCK(
IN_F1 VARCHAR(30) = :IN_F1,
IN_F2 VARCHAR(30) = :IN_F2,
IN_F3 VARCHAR(30) = :IN_F3)
AS
BEGIN
    IF (NOT(EXISTS(SELECT * FROM NEW_TABLE NT WHERE NT.F1=:IN_F1 AND NT.F2=:IN_F2 AND NT.DATA_REG='dd.mm.yyyy'))) THEN
        BEGIN
        END ELSE
        BEGIN
        END
END


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.