EducationSoftwareStrategy.com
StrategyCommunity

Knowledge Base

Product

Community

Knowledge Base

TopicsBrowse ArticlesDeveloper Zone

Product

Download SoftwareProduct DocumentationSecurity Hub

Education

Tutorial VideosSolution GalleryEducation courses

Community

GuidelinesGrandmastersEvents
x_social-icon_white.svglinkedin_social-icon_white.svg
Strategy logoCommunity

© Strategy Inc. All Rights Reserved.

LegalTerms of UsePrivacy Policy
  1. Home
  2. Topics

KB484758: Error “Could not determine data type of parameter #1” is seen when the Parameterized Query is enabled


Yuwei Yang

Quality Engineer, Senior • MicroStrategy


Report executions against Amazon Redshift, PostgreSQL, and DB2 may encounter error “Could not determine data type of parameter #1” when parametrized query is enabled and metric definitions contain COUNT(“*”) syntax.

In the Strategy 2021 release, Parameterized Query is enabled by default for all major gateways. Reports containing text filters and prompts will be executed using parameter markers (?) during SQL execution.
 

Symptom


Report executions against Amazon Redshift, PostgreSQL, and DB2 may encounter error “Could not determine data type of parameter #1” when parametrized query is enabled and metric definitions contain  COUNT(“*”) syntax. 
Sample report SQL indicates the character “*” is parameterized:
select     pa11.YEAR_ID  YEAR_ID,
                avg(pa11.WJXBFS1)  WJXBFS1,
                count(?)  WJXBFS2
from      ##TMQL702UKMD000   pa11
group by              pa11.YEAR_ID
with parameters:
                *

Cause


The backend function PrepareStatement needs to know the data type of parameter against above listed data sources. However, with syntax count(?), certain gateways and drivers are not able return the correct type for special characters.
 

Action


To avoid this issue, users can redefine the metrics as COUNT(1) rather than COUNT(“*”).
 


Comment

0 comments

Details

Knowledge Article

Published:

December 11, 2020

Last Updated:

December 20, 2020