1. Matt: EuSQL Question About Returning Field Types
- Posted by c.k.lester <euphoric at ckle?ter.?om> Sep 22, 2007
- 487 views
You have a function in eusql for returning a flat list of fields. What's the best way to get a list of field types for a table?
2. Re: Matt: EuSQL Question About Returning Field Types
- Posted by Matt Lewis <matthewwalkerlewis at g??il.com> Sep 22, 2007
- 481 views
c.k.lester wrote: > > You have a function in eusql for returning a flat list of fields. What's the > best way to get a list of field types for a table? Take a look at flat_field_names(). You could also take the return value of blank_record() and flatten it out. Send me the code and I'll put it into the library. :) Matt
3. Re: Matt: EuSQL Question About Returning Field Types
- Posted by c.k.lester <euphoric at ck??ster.com> Sep 22, 2007
- 487 views
Matt Lewis wrote: > c.k.lester wrote: > > You have a function in eusql for returning a flat list of fields. What's the > > best way to get a list of field types for a table? > Take a look at flat_field_names(). You could also take the return value > of blank_record() and flatten it out. Send me the code and I'll put it > into the library. :) flat_field_names uses get_record_struct(), but get_record_struct does not return the field types... only the field names and an empty sequence. I think I'll just cheat and grab the data from the table_info table. What are you using for wxEDB these days? I'm having a heck of a time getting it on my home PC. I have it at work and it works fine. :(
4. Re: Matt: EuSQL Question About Returning Field Types
- Posted by c.k.lester <euphoric at cklester?co?> Sep 22, 2007
- 486 views
Matt Lewis wrote: > c.k.lester wrote: > > You have a function in eusql for returning a flat list of fields. What's the > > best way to get a list of field types for a table? > Take a look at flat_field_names(). You could also take the return value > of blank_record() and flatten it out. Send me the code and I'll put it > into the library. :) Here's the code I've stuck into EuSQL.e Feel free to modify it to conform to EuSQL standards:
--/topic Utilities --/func eusql_field_types( sequence db, sequence table ) --/info --Returns a sequence of field types for a table. global function eusql_field_types( sequence db, sequence table ) object ok sequence result ok = select_current( db, "TABLEDEF" ) if atom(ok) then result = ok else -- now get the record from the table_def whose name is 'table' ok = db_find_key( upper( table ) ) if ok > 0 then result = db_record_data(ok) result = result[2][$] else result = ok end if end if return result end function
5. Re: Matt: EuSQL Question About Returning Field Types
- Posted by Matt Lewis <matthewwalkerlewis at ?mail?com> Sep 22, 2007
- 489 views
c.k.lester wrote: > > flat_field_names uses get_record_struct(), but get_record_struct > does not return the field types... only the field names and an empty sequence. > > I think I'll just cheat and grab the data from the table_info table. I've added your code to the library (just committed to svn). > What are you using for wxEDB these days? I'm having a heck of a time getting > it on my home PC. I have it at work and it works fine. :( I basically use the head of the repository of the various projects: wxedb eusql wxEuphoria ooeu matheval A little while ago I started reworking/overhauling it, mainly the forms stuff, which I don't think anyone but me used (it hasn't really worked since before the "wx" got added to EDB). Basically, it's waiting on wxIDE to be rewritten. My plan is to reuse the code editor and gui editor components. I suppose I should release a working version with all of the required files. I'll put it on my TODO list... Matt
6. Re: Matt: EuSQL Question About Returning Field Types
- Posted by c.k.lester <euphoric at c?lester?com> Sep 22, 2007
- 482 views
Matt Lewis wrote: > c.k.lester wrote: > > What are you using for wxEDB these days? I'm having a heck of a time getting > > it on my home PC. I have it at work and it works fine. :( > I basically use the head of the repository of the various projects: I forget that 0.10.0 is bleeding edge. :) I just downloaded wxeu.dll back into my system folder and now wxEDB works.