Categories > TinyButStrong general >

Dynamic MySQL fieldnames

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: DJMoran
Date: 2009-03-20
Time: 11:45

Dynamic MySQL fieldnames

Hi, I have a table which contains different fields in which the fieldname relates is the same as data in other records i.e.:
Table1:
ID_Field    Field_2
1              Text
2              Number
3              Quote
4              Other

Table2:
ID_Field    Text     Number    Quote    Other
1               hi        23             "boo"   http://

i was wondering if the syntax would be (if the blocks are merged as the table names) [Table2.[Table1.Field_2]]?

If not how would I do it?
By: Skrol29
Date: 2009-03-20
Time: 15:53

Re: Dynamic MySQL fieldnames

Hi,

Yes it would work with this syntax, assuming that you do MergeBlock() on "Table1" first, then MergeBlock() on "Table2".
Also take care that TBS is case sensitive for field names.
By: DJMoran
Date: 2009-03-20
Time: 20:28

Re: Dynamic MySQL fieldnames

Thanks for the help, I'll try it as soon as I can.