IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

[Mapforce2010] Manipulate ID Options · View
Lborz
Posted: Monday, November 16, 2009 4:14:37 PM
Rank: Member

Joined: 10/28/2009
Posts: 20
Location: Italy
Hi,

i found a problem while using Mapforce. I want to add to a table Province new records copying them from on old table, i cannot use the function "Maximum-value" that auto-assign the value to id_fields because is disabled.
I took the all old ids from target table tabProvince, get the id with max value, add to it 1, and use this sum as seed for module of autogeneration of numbers. It seem's all correct but when i save this mapping i got this error:

Code:
The SQL-WHERE condition cannot be applied to the database field 'id_utente' because the containing table 'dbo.tabProvinces' is already connected to 'idProvince' which is an ancestor of the target connector 'idProvince'.


Where is the problem?

Thanks in advance for you help.

island
Posted: Tuesday, November 17, 2009 9:38:58 AM
Rank: Newbie

Joined: 10/28/2002
Posts: 1,283
Location: AT
Please actually provide the mapping file .mfd plus the sql to create the source and target tables so we can have an idea of what we are looking at.

vlad
Posted: Tuesday, November 17, 2009 12:39:18 PM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,856
Location: Mauritius
and please do not use confusing version number. There is no MapForce v10
Lborz
Posted: Tuesday, November 17, 2009 4:20:03 PM
Rank: Member

Joined: 10/28/2009
Posts: 20
Location: Italy
Ok, i solve the problem.
And yes, the version of Mapforce is not 10 but 2010. Thanks for the correction.
Lborz
Posted: Wednesday, November 18, 2009 10:41:46 AM
Rank: Member

Joined: 10/28/2009
Posts: 20
Location: Italy
My work around for this problem doesn't work properly so i have again the problem of manipulating the id. Below an example of my project:

http://a.imagehost.org/0349/schema.png[/img]

And here the error:

[i]Mapforce10_example_function.mfd: Mapping validation failed - 2 error(s), 0 warning(s)
[JAVA] The SQL-WHERE condition cannot be applied to the database field 'id_utente' because the containing table 'public.utente' is already connected to 'id_utente' which is an ancestor of the target connector 'id_utente'.
[JAVA] The SQL-WHERE condition cannot be applied to the database field 'id_utente' because the containing table 'public.utente' is already connected to 'public.utente' which is an ancestor of the target connector 'id_utente'.


I dont understand what is the problem, can you help me?

Thanks.
island
Posted: Wednesday, November 18, 2009 11:52:13 AM
Rank: Newbie

Joined: 10/28/2002
Posts: 1,283
Location: AT
Again .....

Please actually provide the mapping file .mfd plus the sql to create the source and target tables so we can have an idea of what we are looking at.
Lborz
Posted: Wednesday, November 18, 2009 1:28:09 PM
Rank: Member

Joined: 10/28/2009
Posts: 20
Location: Italy
Ok,

i have attached the image in my previous post, but i attach it another time.



This is the link to the mapping file.

For creation of tables i use directly the GUI of Postgres client, so i don't use directly SQL code for generation of tables. If you mean the SQL code generated from Mapforce i cannot get it because the error is on mapping validation so Altove refuses to create output. Anyway i used the same tables for a complex mapping like this:



And i don't have any problem with them.
vlad
Posted: Wednesday, November 18, 2009 1:41:04 PM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,856
Location: Mauritius
Instead of using a max function connected to the database table, create a SELECT statement and connects its result to auto_number start_at - this should work. I.e.

SELECT MAX( id_utente ) + 1 FROM utente

Rocco
Posted: Wednesday, November 18, 2009 1:57:50 PM
Rank: Advanced Member

Joined: 5/16/2009
Posts: 82
Hi Lborz,

I was also thinking the same as per Vlad. Your mapping should looks like this:


N.B. If these suggestions do not help please provide us with more details (e.g., the database type and the DDL for recreating the tables).


Rocco attached the following image(s):
SQL-Where.JPG

Lborz
Posted: Wednesday, November 18, 2009 3:35:59 PM
Rank: Member

Joined: 10/28/2009
Posts: 20
Location: Italy
Thanks, once time again you helped me.
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.