Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with Trigger
Message
De
08/09/2004 11:24:20
 
 
À
08/09/2004 11:21:36
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00940269
Message ID:
00940299
Vues:
18
thank you very much Cetin
U gave me a great help indeed
Alessio

>Mimic your N(x,y) with a constant value. ie: for N(6,3) 00.000
>
>select *, ;
>  space(10) as myAddedStringColumn, ;
>  {/:} as myAddedDatetimeColumn, ;
>  0000.0000 as myNumeric ;
>  from myTable ;
>  where .f. ;
> into cursor crsMyCursor readwrite
Cetin
>
>
>
>>Uhm, I was thinking about something that sometimes gives me problems,
>>If I want to add a numeric field with a select command, it creates a field
>>of Type N(x) where x is the lenght of the field, how can I manage the x value ?
>>Sometimes i need a larger field than the one created by the sql command.
>>..................
>>
>>-Thank You Cetin, I'll try to follow your indication, after all it's what i
>>-usually do when I use the selct command, I was thinking about the reason
>>-why I did not use that command in my CreateCursor Procedure... maybe the
>>-previous version of VFP didn'tcreate empty cursor using the select command ?
>>-Thank you again
>>-Alessio
>>
>>>Alessio,
>>>I see. You might add columns on the fly though. ie:
>>>
>>>select *, ;
>>>  space(10) as myAddedStringColumn, ;
>>>  {/:} as myAddedDatetimeColumn ;
>>>  from myTable ;
>>>  where .f. ;
>>> into cursor crsMyCursor readwrite
>>>
>>>Array processing is generally faster but with these types of things it might not worth to test which one is really faster. However ALTER TABLE would have a problem. If you have longname field or add one with longname than next ... ADD COLUMN ... would error.
>>>I suggest 'Select ... where .F. ...'.
>>>Cetin
>>>
>>>
>>>>I've chosen (I hope it's the right english verb) the afield function because
>>>>I pass some parameters to my routine to add some columns to the cursor.
>>>>Do you think is faster to exwcute an alter table after the select command or to add row to the afield Array ?
>>>>
>>>>
>>>>>>I'm trying to work with triggers, I call a procedure when insert, update or delete records. It seems to work fine but.... if I create a cursor as an image of a triggered table the trigger starts working even on this cursor and that is not what i want to :-).
>>>>>>I create the trigger with create cursor "cursorname" from array "arrayname" where the array is generated by the Afield fuction.
>>>>>>
>>>>>>Thank you
>>>>>>Alessio
>>>>>
>>>>>Alessio,
>>>>>1) You might set cols 13..15 to '' to avoid triggers.
>>>>>2) Instead of afields() and create ... from array you might select into cursor. ie:
>>>>>select * from myTable where .F. into cursor crsMyCursor readwrite
>>>>>Cetin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform