Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change fieldtype sql - select
Message
De
17/05/2008 19:47:08
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Change fieldtype sql - select
Divers
Thread ID:
01317905
Message ID:
01317905
Vues:
54
Hi,

When I browse my sqlyog I find the fields
online
and
tlUpdate
with fieldtype 'Character' , online is populated with 'TRUE', 'FALSE', .NULL., tlUpdate is populated with a Datetimeexpression or .NULL.

I could first select them as characterfields and replacing the .NULL. with '' using coalesce, make a second select to change the chracterfields to the correct fieldtype with according values.

Just wondering if this could not be done in one select?
FOR me the most logical approach would be: 

TEXT TO sqltxt noshow pretext 15 TEXTMERGE
	select
		CAST(coalesce(online,'TRUE',.T.,.F.) as L) as online ,
		CAST(coalesce(tlupdate,'') as T) as tlUpdate  
		from HORSART_WORKS
ENDTEXT
lcResult = sqlexec(lnRet, lcSql,"curHorsart_Works")
IF lcResult < 0
  * Error
ELSE
	DO my thing
ENDIF

however this gives no result

Regards,

Koen
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform