Informatica Cloud DB2 for i cdc connection type SQL Override not working - db2

Source for the Informatica Cloud is of type DB2 for I cdc. There are few tables that contain # in their column names. If the mapping was run with a column name containing # in the name then the mapping fails.
Example : If there is an Employee table with the column First#Name then used SQL Override
So to eliminate # from the column name tried using SQL Override to alias the column name.
Used a select statement that contains a column list for the same table. Sample SQL statement for the same:
Select First#Name as First_Name
Last#Name as Last_Name
.
.
.
.
.
.
.
Employee;
But still, the column name is being fetched with a # symbol and this is breaking the mapping.
Any solution how the # can be aliased _ in the column name?

You have two options -
You can enclose column names with double uotes "col_name".
Select "First#Name" as First_Name
"Last#Name" as Last_Name
.
Employee;
If this doesnt solve the issue, please do not mention any sql override and connect only required columns. Informatica should automatically built sql and fetch data.
If above two doesnt work, then you need to change some settings in DB2 so as to handle the special char in column name. I have not tested this so i can not gurantee this.

Select First#Name AS First_Name,Last#Name AS Last_Name,Column3,Column4,Column5,Column6,Column7,Column8 FROM Employee;
The SQL query should be in such a way that there are no spaces except when required and the entire query should be present in a single line.
Remove all the spaces (Except the below mentioned ones) and new line characters from the query. That will solve the issue.
Where spaces can be left over:
After the SELECT statement
Before the FROM keyword
After the FROM keyword
Before and after the AS keyword when aliasing the columns that have special characters (Here 2 spaces will be utilized, one before the AS keyword and second after the AS keyword)

Related

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

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:

How do you get a list of tables name that contains a specific column name on Firebird?

I have to find a table (or more than one) that contains a column named 'idRec' on a Firebird database.
You can query the RDB$RELATION_FIELDS table for this:
select RDB$RELATION_NAME
from RDB$RELATION_FIELDS
where RDB$FIELD_NAME = 'idRec'
This will only match columns that are actually called idRec (and thus are required to be quoted when used in SQL statements). If you are actually looking for a column called IDREC (unquoted object names are stored in uppercase), use where RDB$FIELD_NAME = 'IDREC'

Is it mandatory to use "" around the table name performing query on PostgreSQL?

I am not so into PostgreSQL and pgAdmin 4 and I have the following doubt.
Following a screenshot of what I can see in my pgAdmin4:
As you can see it is performing this very simple query:
SELECT * FROM public."Example"
ORDER BY id ASC
The thing that I am not understanding is what is this public name in front of the Example table name. What is it?
I was trying to perform a query in this way but it is not working:
SELECT * FROM Example
ORDER BY id ASC
It give me a syntax error. I often used MySql and in MySql it is working.
I tried to replace the query in this way:
SELECT * FROM "Example"
ORDER BY id ASC
and so it is working. So it means that in PosgreSQL database the "" around the table name are mandatory?
The thing that I am not understanding is what is this public name in front of the Example table name. What is it?
As said in postgres documentation:
"By default tables (and other objects) are automatically put into a schema named "public". Every new database contains such a schema."
So it means that in PosgreSQL database the "" around the table name
are mandatory?
Not really but you need to use it if you are using reserved keywords (such as "user","name"and other)or if your table's name contains uppercase(it's your case) letters. Anyways, in this case if you can it's better change your table's name.
You should change your table name to all alphabet in lowercase then try again with
select * from example

INSERT with alias name is not working on PostgreSQL

SQL Query on PostgreSQL:
insert into TOKEPOOLAMT (TOKEPOOLAMT.TOKEPOOLAMTID,TOKEPOOLAMT.TOKERULEID)
values (151, 176);
Giving error:
com.edb.util.PSQLException:
ERROR: column "tokepoolamt" of relation "tokepoolamt" does not exist
But:
insert into TOKEPOOLAMT (TOKEPOOLAMTID,TOKERULEID) values (151, 176);
is working fine.
Can anybody explain why alias name with column in insert statement not working?
There are no aliases involved here. Your error is that column names in the column list of an INSERT command cannot be table-qualified. #pozs already provided the fitting quote from the manual in his comment.
I don't think it's an issue of case. I tried with both the cases.
That's missing the point. In Postgres, identifiers are folded to lower case unless double-quoted. If you double-quoted a name at creation time you preserved a case sensitive spelling and need to double-quote for the rest of the object's life - unless it was a legal, lower-case name to begin with, then quoting won't make a difference. Details:
Are PostgreSQL column names case-sensitive?

Reserved word "CLUSTER" used as Column name in Oracle 10g

These is an existing table with column name "CLUSTER". I have to query this table to retrieve values of column "CLUSTER". I am getting missing expression error, since CLUSTER is a reserved word in Oracle. Since oracle has allowed to create a column by name CLUSTER, there should be way to retrieve the same. How can query for this column?
PS - I don't have an option to rename the column.
Thanks in advance.
Just use double quotes to refer to that column, like:
select "CLUSTER" from table;
Also, make sure you match the case in the column name.