Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cast('' as M) and UNION problem in SQL select
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01259819
Message ID:
01259822
Vues:
21
Looks like this is the answer Re: Attempting a UNION with a memo field Thread #1071377 Message #1071378

>The code below returns an error saying operation is invalid for a Memo, Blob...
>
>It looks like I can't use cast('' as M) in a SQL select on more than one part of a UNION. If I remove the code after the union it works. As an easy fix I can remove the CAST() and do an alter table afterwards to add the memo.
>Any comments?
>
>
TEXT TO mSqlCommand noshow pretext 15 TEXTMERGE
>  select
>  prempl.lname,
>  prempl.fname,
>  prempl.emplid,
>  jsusers.user,
>  cast(0 as  N(1,0) ) as updtflag,
>  cast('' as M) as fmemo
>  from <<xfjsusers>>
>  join <<xfprempl>> on prempl.k_prempl = jsusers.k_prempl
>  where jsusers.dbname == '<<mdbname>>'
>
>  UNION
>  select
>  jsusers.lname,
>  jsusers.fname,
>  jsusers.emplid,
>  jsusers.user,
>  cast(0 as N(1,0) ) as updtflag,
>  cast('' as M) as fmemo
>  from <<xfjsusers>>
>  where jsusers.dbname == '<<mdbname>>'
>  and jsusers.k_prempl = 0
>
>  into cursor c_jsusers readwrite
>ENDTEXT
>&mSqlCommand
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform