Jump to content
Changes to the Jaspersoft community edition download ×

SQL alias for columns with identical names


ktrinad

Recommended Posts

By: Kaloian Dantchev - kalo

SQL alias for columns with identical names

2003-05-27 05:33

Hello, lets take a look at the following query:

SELECT a.id, a.name, b.text, c.text as atext

FROM questionnaires a, questions b, answers c

WHERE a.id = b.qstnre_id

AND c.qstn_id = b.id

After "Read fields" operation in "Report query..." window I got 4 fields:

ID, NAME, TEXT, TEXT

The alias for the second "text" field is not working. Is there any workaround I am doing something wrong? I appreciate any help. Thanks in advance!

 

 

 

 

 

 

By: Philippe Damerval - damerval

RE: SQL alias for columns with identical name

2003-05-27 06:28

I believe the keyword "AS" is SQL-Server only. At any rate I have never used it in Oracle. If you are using Oracle, simply write c.text atext.

 

 

 

 

 

By: Kaloian Dantchev - kalo

RE: SQL alias for columns with identical names

2003-05-27 07:03

Sorry, it's my fault. I am using Firebird Database Server 1.0. Bacause JDBC drivers do not work, I had to use ODBC driver. Described problem with SQL statement is with "XTG Systems InterBase6 ODBC driver". Now I am using "Gemini InterBase ODBC Driver 2.0" and all work fine, but it is not free. The problem was not in "AS" keyword. It is the driver. Thanks to all!

 

 

 

 

By: Giulio Toffoli - gt78

RE: SQL alias for columns with identical names

2003-05-27 07:06

AS is a standard sql keyword. However several users have reported that sometimes alias fields could have some problems.

I think that the problem could be the specific JDBC driver. Try to search in forum the keyword ALIAS.

 

Giulio

 

 

 

 

By: Giulio Toffoli - gt78

RE: SQL alias for columns with identical names

2003-05-27 07:09

Why you could not use JDBC driver? IReport 0.1.0 support all JDBC drivers.

 

Giulio

 

 

 

 

By: Kaloian Dantchev - kalo

RE: SQL alias for columns with identical names

2003-05-27 08:10

I am currently with iReport 0.1.0. Two days ago I had a problems with Firebird JDBC driver. Now I have downloaded a new one and all work fine with JDBC driver. Thaks!

 

KALO

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...