:doc:`Athena <../../athena>` / Client / get_named_query

***************
get_named_query
***************



.. py:method:: Athena.Client.get_named_query(**kwargs)

  

  Returns information about a single query. Requires that you have access to the workgroup in which the query was saved.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/athena-2017-05-18/GetNamedQuery>`_  


  **Request Syntax**
  ::

    response = client.get_named_query(
        NamedQueryId='string'
    )
    
  :type NamedQueryId: string
  :param NamedQueryId: **[REQUIRED]** 

    The unique ID of the query. Use  ListNamedQueries to get query IDs.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'NamedQuery': {
              'Name': 'string',
              'Description': 'string',
              'Database': 'string',
              'QueryString': 'string',
              'NamedQueryId': 'string',
              'WorkGroup': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **NamedQuery** *(dict) --* 

        Information about the query.

        
        

        - **Name** *(string) --* 

          The query name.

          
        

        - **Description** *(string) --* 

          The query description.

          
        

        - **Database** *(string) --* 

          The database to which the query belongs.

          
        

        - **QueryString** *(string) --* 

          The SQL statements that make up the query.

          
        

        - **NamedQueryId** *(string) --* 

          The unique identifier of the query.

          
        

        - **WorkGroup** *(string) --* 

          The name of the workgroup that contains the named query.

          
    
  
  **Exceptions**
  
  *   :py:class:`Athena.Client.exceptions.InternalServerException`

  
  *   :py:class:`Athena.Client.exceptions.InvalidRequestException`

  