Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does field allow null?
Message
De
25/05/2003 12:47:13
 
 
À
24/05/2003 18:17:41
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00792603
Message ID:
00792697
Vues:
20
Nice... I don't know why I didn't think of this. I guess it's time to put a request for Null as an item you can get from dbgetprop()... My other thought was to open the DBC as a table, find the record for the field and see what the allownull field was set for. Of course your solution works for cursors also.

Although, I solved it by looking at the DBCx meta data which does expose this value as a property.

BOb

>Hi Bob.
>
>Does anyone know how to determine if a field in a view (or any field for that matter) allows nulls? There is no DBGetProp() for this, which surprises me a bit.
>
>How about this (off the top of my head and untested):
>
>
>FUNCTION DoesFieldAllowNulls( tcField, tcAlias )
>LOCAL lnFields, lnRow, llAllowsNull, laFields[ 1  ]
>
>lnFields = AFIELDS( laFields, tcAlias )
>lnRow = ASCAN( laFields, tcField, 1, -1, 1, 15 )
>IF lnRow > 0
>  llAllowsNull = laFields[ lnRow, 5 ]
>ENDIF
>
>RETURN llAllowsNull
>
Nice... I don't know why I didn't think of this. I guess it's time to put a request for Null as an item you can get from dbgetprop()... My other thought was to open the DBC as a table, find the record for the field and see what the allownull field was set for.

BOb
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform