SAS SQL Pass-Through Facility does not work as expected for Postgres database - postgresql

I am working with SCD Type 2 transformation in SAS Data integration Studio (4.905) and using Postgres (12) as database.
I am facing the following error when I try to execute a query via passthrough:
When using passthrough in Postgres, SCD Type 2 doesn't enclose the table name in quotes (which would keep the name uppercase, since postgres converts all unquoted data to lowercase) and so doesn't find it as you can see.
My questions are:
Is there a way to make SCD2 transformation declare the table’s name, used via passthrough, in quotes?
Is there a way to make the SCD2 transformation create intermediate tables ‘name in lower case so that the reference is not lost when doing passthrough?
Is there a global option in DI that allow us to modify/edit temporary table names?
Source and target tables are postgresql tables, with name and columns name in lowercase:
Please, if anyone has faced this problem before or knows what is missing, please, let I know.

To solve this issue, we have to select the following highlighted (source and target) table options. It results in quotes around source/target table names:
Then, SCD2 transformation automatically put quotes in tables y columns names as you can see:

Related

Can we have Table Declaration in Snowflake similar to Oracle SQL?

I am trying to make use of Table declaration syntax and creating the same in Snowflake SQL.
I've gone through the snowflake community & documentations and all I could find is Table variable directly being assigned similar to SQL table variable or making use of a Table function.
generally Snowflake doesn't allow indexes nor type declarations.
other than that, you have two options:
use JS stored procedures, but they are not meant to return a range of values, all you can do is make a temporary table and put your set in there
use UDFs, that are (or well, can be) SQL and can return a table, but have a limited set of functionality

On Google Data Studio, using PostgreSQL data, how do I "SELECT * ..." but for camelCase columns?

On Google Data Studio, I cannot create a chart from Postgres data if table columns are in camelCase. I have data in PostgreSQL where I want to get charts from. Integrating it as a data source works fine. Now, I have a problem when creating a chart.
After creating a chart and selecting a data source, I try to add a column, which results in this error:
Error with SQL statement: ERROR: column "columnname" does not exist Hint: Perhaps you meant to reference the column "table.columnName". Position: 8
It just so happens that all my columns are in camelCase. Is there no way around this? Surely this is a basic question that has been resolved.
When connecting to your data source, try using 'Custom query' instead of selecting a table from your database. Then manually write your SQL query where you cast your camel case column names to lower case using sql alias. Worked for me.
example:
SELECT
"camelCaseColA" as cola,
"camelCaseColB" as colb,
"camelCaseColC" as colc
FROM
tableName as table

table naming and organizing of tables in postgresql

I'm trying to organize my PosgtresSql tables according to the application components they correspond to. For example, tables related to 'story' such as 'story_contents', 'story_comments', 'story_layout': would it best to keep a simple '' naming convention as presented? Would there be any drawback to using a '.' instead of ''? ... or is there a best practice that I'm completely overlooking?
Short answer:
Sure, if you place the entire database/table/column name reference in quotes
Long answer:
In Postgres, and most other databases, the dot is used to separate database name from table name, and table name from column name. For example, if you had a database called MyDB, with a table called MyTable and column in that table MyCol, then you could write the following SELECT statement:
SELECT MyDB.MyTable.MyCol
FROM MyDB.MyTable
However, if your database, table, and/or column names themselves had dots in them, then doing a SELECT might not work. In this case, I believe you can escape the fully qualified name (or portion) with quotes. So, if you had a column called MyCol.Col1, you could do the following:
SELECT "MyDB.MyTable.MyCol.Col1"
FROM MyDB.MyTable
The comment by #vector seems to be pointing in the right direction (no pun intended), and you should lean towards using underscores or some other character to separate out your schema names, rather than using a dot.

How to add extended properties in PostgreSQL

Is it possible to add a kind of Extended Properties in tables and/or columns in PostgreSQL as we can do in SQL Server?
I've been looking for this in Google, but I can't find anything about it.
I want to describe columns (data dictionary) and add parameters that I can later match by reflection with my properties in Java.
Postgres (and many other DBMS) does this through a DDL statement comment on.
To attach a comment to a table, view, column, foreign key (pretty much everything) use comment on, e.g:
comment on table orders is 'Our orders';
comment on column orders.amount is 'Total amount of this order';
More details in the manual: http://www.postgresql.org/docs/current/static/sql-comment.html
The JDBC driver will return this information in the remarks column in the result of e.g. getTables() or getColumns()
To access the values through SQL, use the functions provided by Postgres:
http://www.postgresql.org/docs/current/static/functions-info.html#FUNCTIONS-INFO-COMMENT-TABLE

exporting data from one table to another in different database using DOS command

I have to transfer data from old database to new database where table name and column name is different.
Can it be done with DOS command or any other solution?
One is POSTGRESQL and old is MYSQL.
My concern is table name and column names are different, column number is same.
Thank you
I do not know the postgresql part but for sql server you can use sqlcmd.exe to export data as text format with or w/o column names
Please check
http://msdn.microsoft.com/en-us/library/ms162773.aspx