Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trimming Values from Fox to Oracle
Message
De
18/10/2001 15:30:50
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00570333
Message ID:
00570484
Vues:
30
>>Mark,
>>
>>I am a little confused. I am not receiving an error. The data that is being saved back to the Oracle table is not trimmed and I want it to be. Is there a way that I can do this without having to use SPT to do the update?
>>
>>Matt
>
>OIC, sorry 'bout that. There is no way to trim it on the VFP side except with SPT.
>
>On the Oracle side, you can create an InsertUpdate trigger, that would trim any data you want:
>create or replace trigger ADDRESS_HISTORY_BEFORE_INSUPDT
>before insert or update on npdes.ADDRESS_HISTORY for each row
>declare
>BEGIN
> :new.VarCharField1 := rtrim(:old.VarCharField1);
> :new.VarCharField2 := rtrim(:old.VarCharField2);
>End;
>/
Mark,

Wouldn't the Trigger above reset whatever the new changes are back to what was in the table?

Any way I did create triggers on the Oracle side. They were very similar to the one above with the one exception.
:new.VarCharField1 := rtrim(ltrim(:new.VarCharField1))
The Problem with doing that was when issuing a tableupdate with a force value of .f. an error occured. The trigger changes the values of the table causing VFP to see this as a change by another user (since the trigger is executed by the server). Thus I get an error unless I set force to .t. and there are instances where business logic will not allow a force value of .t.

I will keep digging. If you come across anything please let me know.

Matt
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform