Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
Database Services "SearchIndex" Function vs. RList Subroutine
I recently came across the Database_Services("SearchIndex") function and have started using it instead of simple RList routines that retrieves a list of records. For example, if I wanted to select a list of records that have a status of "ACTIVE" using an RList routine, I would do something along the lines of the statement below:
- RList("SELECT TABLE_NAME with STATUS 'ACTIVE'", 5)
- Then I would loop through the list returned and append each @ID to a list I'll call "activeRecords" for now.
After learning about Database_Services("SearchIndex"), I've replaced the entire RList and loop routine above to a one line statement below:
- activeRecords = Database_Services("SearchIndex", "TABLE_NAME", "STATUS", "ACTIVE", FALSE$)
My question is, are there any disadvantages to using Database_Services("SearchIndex") instead of RList in the example above? If not this would simplify a lot of my code. I've gotten accurate results from a couple tests I tried but don't want to go ahead and start replacing every instance of an RList routine for this project I'm working on until confirmed.
- RList("SELECT TABLE_NAME with STATUS 'ACTIVE'", 5)
- Then I would loop through the list returned and append each @ID to a list I'll call "activeRecords" for now.
After learning about Database_Services("SearchIndex"), I've replaced the entire RList and loop routine above to a one line statement below:
- activeRecords = Database_Services("SearchIndex", "TABLE_NAME", "STATUS", "ACTIVE", FALSE$)
My question is, are there any disadvantages to using Database_Services("SearchIndex") instead of RList in the example above? If not this would simplify a lot of my code. I've gotten accurate results from a couple tests I tried but don't want to go ahead and start replacing every instance of an RList routine for this project I'm working on until confirmed.
Comments
RList("SELECT TABLE_NAME with STATUS 'ACTIVE'", 2,ActiveRecords)
I wonder if RList always had that functionality but it wasn't exposed, especially in the 16bit days.