Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Index a cursor within transaction?
Message
From
13/06/2007 10:11:30
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
13/06/2007 00:10:27
Aye Mya Thida Kyaw
Ingenuity Microsystems Sdn Bhd.
Kuala Lumpur, Malaysia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01232486
Message ID:
01232574
Views:
19
>Dear all,
>
> I need to index a cursor which is within begin-end transaction. But I'm having error message "command cannot be issued within a transaction" on "index" line. My coding syntax goes as follow :
>
      Select myCursor_one
>      lcmdbf=dbf()
>      select 0
>      use (lcmdbf) again alias cursor_one
>      index on chassis_no tag chassis_no
>      set order to chassis_no
>
>      select myTable
>      set relation to myTable.chassis_no into cursor_one
>
What's mycursor_one, a table? If it's a table, you need to have it open exclusive - which then doesn't make much sense within a transaction. Transaction is all about writing into tables in non-exclusive environment.

If it's a cursor, you should try to index it before the transaction begins.

As an alternative, you may try to index it on a non-structural index, i.e. give it a temporary index file:
lcTmp=forcepath(forceext(sys(2015),"cdx"), getenv("temp"))
index on chassis_no tag chassis_no of (lcTmp)
... your code here...

...and when you close the cursor, kill the file:
erase (lcTmp)
Haven't tried this inside a transaction, though.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform