Why does SQL Explorer put quotes around my Schemas, Tables, and Columns if I drag them from the selection pane?
Using Quotes around Schema, Table, and Column names is best practice to ensure the SQL Parser doesn’t get mixed up with SQL Keywords. For example, the word order could be either a column name, or a command to order the results from a table. For example:
select order
from schema.table
order by order
A SQL Parser wouldn’t know how to read this, and so would error. The standard solution is to use quotes around schemas, tables, and columns so they don’t get confused with keywords. For example:
select "order"
from "schema"."table"
order by "order"This would run successfully. As such, when automatically generating these names, we always put quotes around them so that whatever is generated by SQL Explorer can't cause an error
Why does my one schema have two copies of each table?
The One schema has two copies for most tables, for example:
"one"."prd_employee"
"one"."prd_employee_7654"The first prd_employee table is actually a view that exists on top of the second prd_employee table. This is done so that during a data load, we create a third copy which might be:
"one"."prd_employee_7655"This third copy will take anywhere from a few seconds to over an hour to build, but during that time any Explore or Storyboard queries still need to reference the old data. As such, we have a step at the end of our Processing Script that updates all of the views to point to the newest table, and then deletes the old ones.
When using SQL Explorer, both the numbered and unnumbered copies of tables can be queried. Querying the unnumbered table will always give the same result as the Explore and Storyboard pages.
Why do I have a numbered copy of my one and processing schemas?
You may find copies of your “one” and “processing’ schemas with numbers appended to them, such as:
"processing_101"
"one_101"These numbered copies for your “one” and “processing” schemas are created from our Test runs of processing scripts. The number will correspond to the Processing Script version number on the Processing Scripts page. They can be queried here for validation purposes.
Comments
0 comments
Please sign in to leave a comment.