Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
View definiton has been changed error
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00588888
Message ID:
00589033
Vues:
33
This message has been marked as the solution to the initial question of the thread.
>I have a view called JobContact_2. If I use the view and browse it from the command window it works fine.
>
>If I put it in the DE of a form I get a "View definiton has been changed" error when it is requeried. If I remove the following from the view it works fine:
>
	Join workman_MAIN!lu_Catagory  ;
>	ON  JobContact.fk_Type_id = lu_Catagory.pk_id
>
>Anybody know what would cause this?
>
>Here is the full view code:
>
>
Create Sql View "JOBCONTACT_2" ;
>	AS Select  AddressBook.Company, ;
>	Iif(Empty(AddressBook.Prefix), "", Alltrim(AddressBook.Prefix) + " ") + ;
>	Iif(Empty(AddressBook.FirstName), "", Alltrim(AddressBook.FirstName) + " ") + ;
>	IIF(Empty(AddressBook.MiddleName), "", Alltrim(AddressBook.MiddleName) + " ") + ;
>	IIF(Empty(AddressBook.LastName), "", Alltrim(AddressBook.LastName) + " ") + ;
>	IIF(Empty(AddressBook.Suffix), "", Alltrim(AddressBook.Suffix)) As ConName, ;
>	lu_Catagory.cDesc, JobContact.* ;
>	FROM  workman_MAIN!JobContact  ;
>	LEFT Outer Join workman_MAIN!AddressBook  ;
>	ON  JobContact.fk_ab_id = AddressBook.ab_id  ;
>	Join workman_MAIN!lu_Catagory  ;
>	ON  JobContact.fk_Type_id = lu_Catagory.pk_id  ;
>	WHERE JobContact.fk_job_id = ?Thisform.ncurid  ;
>	ORDER By Company
The problem is with the ConName field. PADR the entire field so that it is always ends up being the same length. The field length is based off of the first record in the SELECT. As follows -
Create Sql View "JOBCONTACT_2" ;
	AS Select  AddressBook.Company, ;
	PADR(Iif(Empty(AddressBook.Prefix), "", Alltrim(AddressBook.Prefix) + " ") + ;
	Iif(Empty(AddressBook.FirstName), "", Alltrim(AddressBook.FirstName) + " ") + ;
	IIF(Empty(AddressBook.MiddleName), "", Alltrim(AddressBook.MiddleName) + " ") + ;
	IIF(Empty(AddressBook.LastName), "", Alltrim(AddressBook.LastName) + " ") + ;
	IIF(Empty(AddressBook.Suffix), "", Alltrim(AddressBook.Suffix)), 120) As ConName, ;
	lu_Catagory.cDesc, JobContact.* ;
	FROM  workman_MAIN!JobContact  ;
	LEFT Outer Join workman_MAIN!AddressBook  ;
	ON  JobContact.fk_ab_id = AddressBook.ab_id  ;
	Join workman_MAIN!lu_Catagory  ;
	ON  JobContact.fk_Type_id = lu_Catagory.pk_id  ;
	WHERE JobContact.fk_job_id = ?Thisform.ncurid  ;
	ORDER By Company
Dan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform