database field names

Got an idea for enhancing SpiderBasic? New command(s) you'd like to see?
nad
Posts: 11
Joined: Sat Feb 10, 2024 1:41 pm

database field names

Post by nad »

the ability to access database fields by field name.
Instead of getting a field by DatabaseField(1,1), it would be nice to get the field by name.
For example if I have a sqlite table called item with field names of itemNum,descr,on Hand,
It would ideal to get the data by DataBaseName(i"temNum"), DataBaseName("descr"), DataBaseName("onHand")

It should also work with JOINS where the tables joined may have the same field name.
We could join the item table wtih cust table and they both have a field named descr
So in that case it should include the table such as: DataBaseName("item.descr") and DataBaseName("cust.descr")

Problem is I have system with about 80 programs that can acess any of about 50 tables in the db.
If someone adds a field for example between itemNum and descr such as shortName. Then I have to check all programs to see if they use the item table. And since it currently uses relative position to get the data, I'd have to change all the programs tha use the item table because their relative position no longer is valid.
User avatar
Peter
Posts: 1093
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: database field names

Post by Peter »

nad wrote: Sat Feb 10, 2024 7:40 pmthe ability to access database fields by field name.
I have already answered that: viewtopic.php?p=9702#p9702
nad
Posts: 11
Joined: Sat Feb 10, 2024 1:41 pm

Re: database field names

Post by nad »

Im the one who ask the question .
No one answered if it would work or not?
Anyway that is a work around and not a command to retrieve data by field name.
So does that question I posted work or not?

This is my first time looking at spiderbasic, so the question may be something everyone already does.
But I couldn't find any command to do a retrieval of fields by name?
Post Reply