This lesson is part of the SQL in Ignition course. You can browse the rest of the lessons below.

LESSON LIST

Autoplay Off
Take topic challenge

LESSON

Named Query Introduction

Description

Take a quick tour of the Named Query workspace.

Transcript

(open in window)

[00:00] Named queries are predefined queries that may be invoked somewhere in a project. They're conceptually very similar to project scripts in the sense that they are defined in a single location and then referenced in multiple places throughout a project. When executing a named query, parameters may be passed to return a dynamic result set. This way, it may be written once and then called from multiple locations throughout the project. We will visit named query parameters in a later video, but for now let's create a simple named query and let's take a look at some of the features related to the named query design space. From the project browser tree, there's a section for named quarries. I will simply right click on it to create a new query named My Query. Once it is created, the named query design space appears. In the settings tab, you're able to control the query security, description, as well as controlling its caching behavior. The authoring tab allows users to design their query. Users can control what database connection their query points to, its type, as well as what parameters it takes in.

[01:07] I will set my database connection setting to point to my DB database and will leave it's query type as query. Once I select my database, notice how all my databases tables are listed in the table browser. Now, let's write a simple query that returns all the data inside my databases inventory table. My query takes no parameters, so I will simply delete the pre-configured parameters. I will then head over to the testing tab to test my query for functionality. Pressing the execute query button, we see that the query executes and I'm able to see its results in real time. I am also able to limit its sample size and export its results into a CSV file.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.