REST API Reference > Saved SQL query REST APIs > Viewing a saved SQL query
  

Viewing a saved SQL query

Use the following URI to view a saved SQL query:
GET /datavalidation-service/api/v1/savedSqlQuery/{savedSqlQueryId}/
Use the IDS-SESSION-ID header in the GET request:
GET request
Use the saved SQL query ID to view the query.
When you open a saved SQL query, the numeric value that you see in the URI is the saved SQL query ID. For example, in the following image, the saved SQL query ID is 259:
The image shows the saved SQL query ID highlighted, which is 259.
GET response
If the saved SQL query was found, the GET request returns a 200 Successful operation response and the following response fields:
Field
Description
name
Name of the saved SQL query.
description
Description of the saved SQL query.
query
Saved SQL query that is used.
databaseType
Connection ID and database type for the saved SQL query.
id
<>
databaseTypeName
Type of the database that the saved SQL query fetches data from.
Displays one of the following values:
  • - Amazon Redshift v2
  • - Databricks
  • - DB2
  • - Google BigQuery V2
  • - Microsoft Azure Synapse SQL
  • - MySQL
  • - Oracle
  • - PostgreSQL
  • - Snowflake Data Cloud
  • - SqlServer
frsdocLocation
The location of the saved SQL query.
validationState
Validation status of the SQL query. Displays one of the following values:
  • - INVALID. The query is not valid. Fix the query and validate it again.
  • - VALID. The query is valid and can be used in a test case.
  • - NOT VALIDATED. The query has not been validated. You must validate the query to use it in a test case.
orgId
ID of the organization that contains the saved SQL query.
createDateTime
Date and time when the saved SQL query was created.
updateDateTime
Date and time when the saved SQL query was last updated.
If the saved SQL query was not found, the GET request returns a 500 Internal Server Error response and the following response fields:
Field
Type
Description
code
String
Code of the error message.
message
String
Error message.
debugMessage
String
Message that can be used for debugging the issue.
requestId
String
String that uniquely identifies the request. Used for debugging purposes.
details
String
Detailed information about the error message.