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
Titre:
Cast('' as M) and UNION problem in SQL select
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:
01259819
Vues:
68
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
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform