Unable to determine where Coldfusion Error is coming from

65 Views Asked by At

The following error is populating when trying to retrieve data from the database on a website form: "An error occurred while executing the application. Please try again or contact the administrator". I see this error on the inspector tool (on the network). What populates on the page itself is that no data can be found. I am unable to determine whether it is has to do with the setup when installing CF2021 or it has to do with the way the query is pulling the data.

At fist I thought it had to do with secure profile being enabled but it is not.

The following is the query:

<cfquery name="Cities" datasource="DataSource">
        DECLARE @tmpTable TABLE ( col1 nvarchar(255) )
        
        INSERT INTO @tmpTable
        SELECT DISTINCT city
        FROM CityLocation
        WHERE Utilizedspecialty = 'CC'
        AND Network NOT LIKE '%Cal%'
        AND Company IN ('RMTCG','RCG')
        ORDER BY City
        
        DECLARE @tmp nvarchar(MAX) = ''
        
        SELECT @tmp = RTRIM(LTRIM(@tmp)) 
                +  ',{"value":"' + col1 + '"}'
        FROM @tmpTable
        
        SELECT '{"Cities":[' + stuff(@tmp,1,1,'') + ']}' AS col
    </cfquery>

Any help would be appreciated.

0

There are 0 best solutions below