Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
>I have created a procedure in which I created a View that selects only one field(Batch_num) from table Claims say lv_Batch_nums. To go through each record of lv_Batch_nums i used a for loop like
> use lv_Batch_nums
> if reccount() > 0
> for cnt = 1 to reccount() step 1
> goto cnt
>* Here I created another view and worked with other tables.
>endfor
>endif
>
> I found that the for loop keeps me on the same record in lv_Batch_nums. It keeps me on the very first record thoughout the loop. If I remove the view or other tables i am working within the loop, then it works fine.
>Any help
>
>Thanks
>Bharat
Bharat --
I think the problem you're running into is the choice of work area. Your view lv_Batch_nums is selected after you open it with a USE. But, it's not selected when you return from the "cnt" routine. To fix your existing code, do a SELECT lv_Batch_nums prior to either this code. Mark recommended using the SCAN/ENDSCAN construct, which automatically reselects the work area.
BTW, I think you'll find more response if you use a more descriptive header for your message. I think everyone who posts a question here considers it "important". Some folks simply refuse to read messages without a descriptive header. Something might "Record pointer won't move" simply describes your situation.
Jay
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement