Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check Constraint
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Titre:
Check Constraint
Divers
Thread ID:
00620352
Message ID:
00620352
Vues:
51
Anyone have an idea on how i can create a column check constraint on a char(15) column that only allows the digits 0-9 and the characters A-F?

In fox pro I did this...
FOR i=1 TO LEN(ALLT(THISFORM.txtnic.VALUE))
   IF !INLIST(SUBSTR(ALLT(THISFORM.txtnic.VALUE),i,1), '1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F')
      warningmessage=warningmessage+CHR(13)+'Invalid NIC address. (Non hex digit)'+' "'+SUBSTR(ALLT(THISFORM.txtnic.VALUE),i,1)+'"'
       THISFORM.txtnic.SETFOCUS
       oktosave=.F.
   ENDIF
ENDFOR
but im not sure if you can loop through each character. Any help is appreciated.

Eric Stephani
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform