|
|
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.
|
|
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.
|
|
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
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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):

|
|
Rank: Member
Joined: 10/28/2009 Posts: 20 Location: Italy
|
Thanks, once time again you helped me.
|
|
|
guest |