Re: Eusql question

new topic     » goto parent     » topic index » view thread      » older message » newer message

sixs wrote:
> 
> Hi,
> I am  accessing the Eusql database in a wxEuphoria program and want to 
> display the data that I am putting into a line of data into a listbox.  
> I am reading several records so I am using the FOR loop to access the  
> records and then another loop to access the fields. I can display the 
> data if it is described as text, but I cannot display the data when it 
> is a number.  I am trying to use the command
> fn = (sql[1][x1][x2])
>     ft= get_field_datatype ( thisdb, thistbl,fn)
> If I get ft I would use this to
> for x1 = 1 to listlen do
>     for x2 = 1 to 13 do
>         trace(1)
>         fn = (sql[1][x1][x2])
>         ft= get_field_datatype ( thisdb, thistbl,fn)
>         if ft = "9" then
>             line = line &        sprintf("%d",sql[2][x1][x2])&", "
>         else
>             line = line &(sql[2][x1][x2])&", "
>         end if
>     end for
>     add_item(Combo8, line)
> end for

What type of data is in the field?  Rather than hardcoding "9", you 
should use the constants that EuSQL provides:

EUSQL_EU_ATOM
EUSQL_EU_INTEGER
EUSQL_EU_OBJECT
EUSQL_EU_SEQUENCE
EUSQL_EU_TEXT
EUSQL_EU_BINARY
EUSQL_AUTONUMBER

Matt Lewis

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu