Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Attempting a UNION with a memo field
Message
De
23/11/2005 03:04:44
Jill Derickson
Software Specialties
Saipan, CNMI
 
 
À
23/11/2005 02:53:39
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:
01071474
Vues:
26
>>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 )
>
>
Hi Gregory,

Thanks for your input...but, the SELECT i posted here was a stripped down version (to illustrate my specific problem)...there are many other fields and tables involved in the real statement.

I ended up doing the UNION ALL, then applied a UNIQUE index to get the unique records I needed.

Thanks, j
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform