Template bug with 17.10.0.1015 - [FILE_NAME] inserts file extension as well (fixed)

Template bug with 17.10.0.1015 - [FILE_NAME] inserts file extension as well (fixed)

1

    Aug 31, 2011#1

    I'm a DBA and I've been using UE for about a decade now. For most of that time I've used the Template feature to create headers for my SQL Scripts. After upgrading recently to 17.10.0.1015 one of the Template standards, [FILE_NAME] stopped working properly. Instead of displaying just the "root" of a file's name like it always had, it started including the file's extension.

    For example, say I have a file called SQLDocumentor.sql and a Template called SQLHdr (see example below). One of the Template special strings I use in that header is [FILE_NAME]. When the template is executed [FILE_NAME] should translate to "SQLDocumentor" only. That's been the result for years now. Instead, with this version, [FILE_NAME] is returning SQLDocumentor.sql.

    Is this by design? If so, how do I downgrade?

    Here's that Header Template:

    /******
    [FILE_NAME]
    Create Date: [DATE_USER]MM'/'dd'/'yyyy[DATE_USER_END] [TIME_USER]hh':'mm':'ss tt[TIME_USER_END]
    Last Update: [DATE_USER]MM'/'dd'/'yyyy[DATE_USER_END] [TIME_USER]hh':'mm':'ss tt[TIME_USER_END]

    Desc:

    [FULL_FILE_NAME]
    ******/
    set nocount on
    DECLARE @fileDateShort nvarchar(20)
    DECLARE @instance nvarchar(100)
    SELECT @fileDateShort = replace(convert(varchar, getdate(),101),'/','-')
    SELECT @instance = case
    when CONVERT(varchar(50),SERVERPROPERTY('InstanceName')) is NULL
    then @@SERVERNAME
    else CONVERT(varchar(50),SERVERPROPERTY('InstanceName'))
    END



    PRINT 'Instance name: ' + @instance + CHAR(10) +
    'Current Database: ' + db_name() + CHAR(10) +
    'C:\Logs\' + @instance + '-[FILE_NAME]-' + @fileDateShort + '.log' + CHAR(10) +
    'DATE/TIME: ' + CONVERT(varchar, GETDATE(),120) + CHAR(13) ;
    set nocount off
    GO



    And here's what its returning. The text in bold red should read JWS-ServerTraces and not JWS-ServerTraces.sql:
    /******
    JWS-ServerTraces.sql
    Create Date: 08/31/2011 08:45:18 AM
    Last Update: 08/31/2011 08:45:18 AM

    Desc:

    C:\sqlsvr\Projects\JWS\Tuning\JWS-ServerTraces.sql
    ******/
    set nocount on
    DECLARE @fileDateShort nvarchar(20)
    DECLARE @instance nvarchar(100)
    SELECT @fileDateShort = replace(convert(varchar, getdate(),101),'/','-')
    SELECT @instance = case
    when CONVERT(varchar(50),SERVERPROPERTY('InstanceName')) is NULL
    then @@SERVERNAME
    else CONVERT(varchar(50),SERVERPROPERTY('InstanceName'))
    END



    PRINT 'Instance name: ' + @instance + CHAR(10) +
    'Current Database: ' + db_name() + CHAR(10) +
    'C:\Logs\' + @instance + '-JWS-ServerTraces.sql-' + @fileDateShort + '.log' + CHAR(10) +
    'DATE/TIME: ' + CONVERT(varchar, GETDATE(),120) + CHAR(13) ;
    set nocount off
    GO

    6,604548
    Grand MasterGrand Master
    6,604548

      Aug 31, 2011#2

      Yes, you are right. I can confirm this wrong behavior. This is definitely a bug in UE v17.10.0.1015.

      Please report it by email to IDM support as soon as possible. UltraEdit v17.20 Release Candidate 2 was already published for the beta testers. If you are quick and have luck the bug is perhaps fixed already in release version of UltraEdit v17.20.

      Same template file used with UE v17.10.0.1010 produces the correct result - just the file name without file extension is inserted.

        Nov 01, 2011#3

        This issue was fixed with UE v17.30.0.1002. Using [FILE_NAME] in a template inserts again just the file name without the point and the file extension. Users wanting entire name of file must use in the template [FILE_NAME][FILE_EXTENSION].