Query builder ambiguous field problem

Common questions about 1C:Query language, Query builder tool and Data composition schema

#1
People who like this:0Yes/0No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

If you create some query and one of the table fields name is the same as the table name you can get an ambiguous field problem generated by query builder.

Example: Imagine that you have InformationRegister.Names table and that table have Names attribute. Query builder will generate query like this:

Code
"SELECT
      |   COUNT(Names.Cedula) AS Cedulas
      |FROM
      |   InformationRegister.Names AS Names";


but it will fail to execute because of ambiguous field. I hope that helps to improve the platform.

 
#2
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello, Alexey!

Could you please create a sample configuration and provide the version of platform where you experience this problem?

 
#3
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Jan 22, 2015
Company:

You can just rename table name in your query:

Code
"SELECT
|   COUNT(IR_Names.Cedula) AS Cedulas
|FROM
|   InformationRegister.Names AS IR_Names";

 
#4
People who like this:0Yes/0No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

Yes, Valerii, I know that renaming the table solves the problem, I just wanted to notify you so you can enhance platform behavior. For the beginner it could be challenging to figure it out.

 
#5
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

Alexey, I tried to reproduce this issue and the name of the table that the query builder created was not Names, but InformationRegisterNames, and there was no that problem.

Could you please create a sample configuration and provide the version of platform where you experience this problem?

 
#6
People who like this:0Yes/0No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

8.3.6.2100
Empty configuration is fine to reproduce it. Just create one Information register - Names
and create one attribute (dimension) "Id" and value attribute "Names".

And create query in builder to count Ids

 
#7
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

Thank you, I will send this to the developer team.

On 8.3.8 I received following error message:

Download 1.png (4.77 KB)
 
#8
People who like this:0Yes/0No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

Yes, this is the message. You are welcome

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.