Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UNION incompatability
Message
De
17/06/2014 15:52:37
 
 
À
17/06/2014 15:46:13
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 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01602005
Message ID:
01602008
Vues:
43
You should be able to CAST() the second field to Currency as is required (see below).

>Hi All:
>
>How do I fix the following to make it UNION compatible? It's not compatible since one field is numeric and the other is currency. This is just a scaled-down example. In the real system, I'm not able to change the definition of Currency in File1.
CLOSE ALL

CREATE TABLE ('file1') ;
	(fname C(30), ;
	extprice    Y)
	
CREATE TABLE ('file2') ;
	(fname   c(30))	
	
SELECT fname, extprice ;
FROM file1 ;
union all ;
SELECT fname, CAST( 0 AS Y ) as extprice ;
FROM file2 ;
INTO CURSOR blarg
>
>Thanks,
>
>Yossi
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform