Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I add an empty logical field to my SQLselect?
Message
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 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01207912
Message ID:
01207960
Vues:
29
>>>Hallo.
>>>If I want to add an extra empty field when I do a SQLselect i do like this:
>>>
>>>sqlexec(nHandle,"select Table1.*, space(19) as extrafield from Table1","Mytable")
>>>
>>>for an extra character field,
>>>
>>>sqlexec(nHandle,"select Table1.*, 0 as extrafield from Table1","Mytable")
>>>
>>>for an extra integer field,
>>>
>>>sqlexec(nHandle,"select Table1.*, alltrim(space(256)) as extrafield from Table1","Mytable")
>>>
>>>for an extra memo field... and so on.
>>>
>>>BUT, how do I do if I want an extra logical field???
>>>I cant use a zero because it will result in an integer field, and I have tried 'false', and even an 'L'. (The 'L' was a last desperate try, when nothing else worked :-) )
>>>Nothing I do works, so I will ask if someone knows how to add an empty logic field to my SQLselect???
>>>
>>>Thanks
>>>/Kjell
>>
>>You're wrong in the last sample, it doesn't create memo field.
>
>It does (if there is no ALLTRIM() in it :o))
>SQL Server has no ALLTRIM() function. AND ALLTRIM(SPACE(256)) == [] :-). I think Kjell has typo (or over typing) here ;o)

I tried against VFP table and got string is too long to fit. I think it would work in SQL Server and produce a memo field. That's why it's important to know the back-end to create back-end specific conversion.

Otherwise you can just take the actual fields and append the result into existing cursor.
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform