Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change fieldtype sql - select
Message
 
 
To
17/05/2008 19:47:08
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01317905
Message ID:
01317906
Views:
6
I'm pretty sure that SQLEXEC() return negative value indicating an error. Why do you ignore it?
LOCAL ARRAY laError[1]
IF lcResult < 0
  =AERROR(laError)
  ? ALLTRIM( laError[1,2] )
ENDIF
What backend are you using? You should use data type conversion method for that backend because query runs on backend.

>
>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
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform