Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Preserving data if not NULL
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01156159
Message ID:
01156177
Vues:
25
>I think this should handle it. I hope we do always have NULL in FK and not empty:
>
>if (IsNull(cursor_trans_stage.cDischarge_status_code_fk) ;
>				and isnull(cursor_trans_stage.cAdmit_type_code_fk) ;
>				and isnull(cursor_trans_stage.cAdmit_Source_code_fk)) or ;
>			   (nvl(cursor_trans_stage.cDischarge_status_code_fk,"A") == ;
>			    nvl(Load_Trans.cDischarge_status_code_fk,"A") and ;
>			    nvl(cursor_trans_stage.cAdmit_type_code_fk,"A") == ;
>			    nvl(Load_Trans.cAdmit_type_code_fk,"A") and ;
>			    nvl(cursor_trans_stage.cAdmit_Source_code_fk,"A") == ;
>			    nvl(Load_Trans.cAdmit_Source_code_fk,"A"))
>				** Do nothing - all empty or exactly the same
>			else
>				replace cDischarge_status_code_fk ;
>				with nvl(Load_Trans.cDischarge_status_code_fk, ;
>				cursor_trans_stage.cDischarge_status_code_fk), ;
>				cAdmit_type_code_fk ;
>				with nvl(Load_Trans.cAdmit_type_code_fk, ;
>				cursor_trans_stage.cAdmit_type_code_fk), ;
>				cAdmit_Source_code_fk ;
>				with nvl(Load_Trans.cAdmit_Source_code_fk, ;
>				cursor_trans_stage.cAdmit_Source_code_fk) in Load_Trans	
>		    endif	
>
No, this would not work, if we have something in cursor and something in Trans, for example, cursor.Field1 = "B" and Trans.field1 = "C". I want to preserve C and don't touch the record if cursor other fields are empty.
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