Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Attempting a UNION with a memo field
Message
De
23/11/2005 02:53:39
 
 
À
22/11/2005 19:14:30
Jill Derickson
Software Specialties
Saipan, CNMI
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
01071377
Message ID:
01071468
Vues:
22
>Hi,
>
>I am trying, and failing, to include a memo field in a UNIONed SQL SELECT. I've pared the statement down to the following:
>
>
>SELECT app_activitycomments ;
>	FROM appointments ;
>	INTO CURSOR c_Temp ;
>	WHERE !app_activity AND app_clientfk > 0 AND app_GroupnameFK=0 ;
>	UNION ;
>		SELECT app_activitycomments ;
>			FROM appointments;
>			WHERE !app_activity AND app_clientfk=0 ;
>			UNION ;
>				SELECT app_activitycomments ;
>					FROM appointments ;
>					WHERE app_activity
>
>
>and i get the error:
>
>"Operation is invalid for a Memo, Blob, General or Picture field"
>
>I can't have a memo in a UNION SQL SELECT statement?
>
>TIA, j

Jill,

With the UNION ALL you may end up with duplicate records

The statement above can be rewritten without a UNION
SELECT app_activitycomments ;
    FROM appointments ;
    INTO CURSOR c_Temp ;
    WHERE  ( app_activity ) ;
        or ( app_clientfk > 0 AND app_GroupnameFK=0 ) ;
        or ( app_clientfk=0 )

&& if app_clientfk cannot be negative

SELECT app_activitycomments ;
    FROM appointments ;
    INTO CURSOR c_Temp ;
    WHERE  ( app_activity ) ;
        or ( app_clientfk = 0 ) ;
        or ( app_GroupnameFK=0 )
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform