# Checking Query Parameters with CFQUERYPARAM

You can use the CFQUERYPARAM tag to check data types of query parameters and perform data validation.

### Example: Checking data types

    <!--------------------------------------------------------------------
    This example shows the use of CFQUERYPARAM when valid input is given in
    Dept_ID.
    ----------------------------------------------------------------------->
    <HTML>
    <HEAD>
    <TITLE>CFQUERYPARAM Example</TITLE>
    </HEAD>

    <BODY>
    <H3>CFQUERYPARAM Example</H3>
    <CFSET Course_ID=12>
    <CFQUERY NAME="getFirst" DataSource="CompanyInfo">
        SELECT *
        FROM departments
        WHERE Dept_ID=<CFQUERYPARAM VALUE="#Dept_ID#"
        CFSQLTYPE="CF_SQL_INTEGER">
    </CFQUERY>
    <CFOUTPUT QUERY="getFirst">
    <p>Department Number: #number#<br>
     Description: #descript#
    </P>
    </CFOUTPUT>
    </BODY>
    </HTML>