Declaring Aliases with SQL

Hi everyone,

I’m trying to set an aliases name on a table, but no matter what I try, i can’t make it work.

Can someone help me with this issue?

Thanks in Advance.

@PedroGalindo welcome to the KNIME forum. What kind of SQL database are you using? Depending on that the syntax might look different.

AS T1
AS "T1"
AS 'T1'
AS `T1`
T1

are all possible options. The same might be true for the way a data table or column name is being addressed.

2 Likes

Hi @PedroGalindo , you problem is use of the word AS. This is not valid syntax for a table skuas in Oracle. (The error message is an oracle error message)

AS can be used for column aliases but not table aliases.

We can try this out at livesql.oracle.com

If I try the following query

select table_name from user_tables as T

I get an error

The reason you get a different error (missing right parenthesis) is because KNIME wraps your query with an outer select, and oracle discovers the invalid keyword AS before it has closed the parenthesis.

e.g.
select * from (select table_name from user_tables as T)

So the solution is to remove the AS keyword

Then it should run without error.

7 Likes

Hi @takbb, it worked!!

Thank you for your help.

Best Regards.

2 Likes

Hi @mlauber71,

I tried all this options, except without the keyword “AS”. Now it works.

Thank you for your answer.

Best regards.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.