Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Query language and DCS > Query builder ambiguous field problem

Forum

Search UsersRules
Query builder ambiguous field problem
#1
Interested
Points:: 15
Joined:: Oct 27, 2011

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.

Profile
#2
Guest
Points::
Joined::

Hello, Alexey!

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

Profile
#3
Just came
Points:: 0
Joined:: Jan 22, 2015

You can just rename table name in your query:

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

Profile
#4
Interested
Points:: 15
Joined:: Oct 27, 2011

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.

Profile
#5
Guest
Points::
Joined::

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?

Profile
#6
Interested
Points:: 15
Joined:: Oct 27, 2011

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

Profile
#7
Guest
Points::
Joined::

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

On 8.3.8 I received following error message:

Profile
#8
Interested
Points:: 15
Joined:: Oct 27, 2011

Yes, this is the message. You are welcome

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.