From: gustavo halperin on 17 Nov 2006 16:03 Hello I'm using PostgreSQL with wxDb classes. But I don't know how to define the columns in the method wxDbTable::SetColDefs. In PostgreSQL I define the table in the next form: CREATE TABLE sal_emp ( name text, schedule text[] ); .. so any idea how to define the variable schedule ??? Thank you in advance, Gustavo -- ||\ // \ | \\ // | I'm thinking. \ \\ l\\l_ // | _ _ | \\/ `/ `.| | /~\\ \ //~\ | Y | | || Y | | \\ \ // | | \| | |\ / | [ || || ] \ | o|o | > / ] Y || || Y [ \___\_--_ /_/__/ | \_|l,------.l|_/ | /.-\(____) /--.\ | >' `< | `--(______)----' \ (/~`--____--'~\) / U// U / \ `-_>-__________-<_-' / \ / /| /(_#(__)#_)\ ( .) / / ] \___/__\___/ `.`' / [ /__`--'__\ |`-' | /\(__,>-~~ __) | |__ /\//\\( `--~~ ) _l |--:. '\/ <^\ /^> | ` ( < \\ _\ >-__-< /_ ,-\ ,-~~->. \ `:.___,/ (___\ /___) (____/ (____) `---' --------------------------------------------------------------------- To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
From: Thomas Zehbe on 20 Nov 2006 03:59 Hi, I believe that there is no native SQL_C_type to support arrays. A quick look in the convert.c of the psqlodbc driver doesn't give any hints that arrays are supported by odbc. Maybe you can can use a long enough wxChar schedule[2048] and define a SetColDefs (idx++, wxT("schedule"), DB_DATA_TYPE_VARCHAR, schedule, SQL_C_WXCHAR, sizeof(schedule),FALSE, TRUE); to retrieve and insert in text format. Of course you would have to scan the results yourself. Another way would be just a way around the problem. Build a second table instead an array. Regards, Thomas Am Freitag, 17. November 2006 22:03 schrieb gustavo halperin: > Hello > > I'm using PostgreSQL with wxDb classes. But I don't know how to define > the columns in the method wxDbTable::SetColDefs. In PostgreSQL I define > the table in the next form: > > CREATE TABLE sal_emp ( > name text, > schedule text[] > ); > > > .. so any idea how to define the variable schedule ??? > > Thank you in advance, > Gustavo -- Dipl.-Ing. Thomas Zehbe INGENION GmbH Kuhweide 6 31552 Apelern Fon: 05043 / 40 57 90 4 Fax: 05043 / 40 57 90 7 --------------------------------------------------------------------- To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
From: gustavo halperin on 20 Nov 2006 15:05 thank you, it is the solution. Then the string is the complete array. I mean if your array have 3 names, then you get an string equal to "{name1,name2,name3}". After well we need to parser each sub-string. Thank you again. Gustavo Thomas Zehbe wrote: > Hi, > > I believe that there is no native SQL_C_type to support arrays. A quick look > in the convert.c of the psqlodbc driver doesn't give any hints that arrays > are supported by odbc. Maybe you can can use a long enough wxChar > schedule[2048] and define a > SetColDefs (idx++, wxT("schedule"), DB_DATA_TYPE_VARCHAR, schedule, > SQL_C_WXCHAR, sizeof(schedule),FALSE, TRUE); > to retrieve and insert in text format. Of course you would have to scan the > results yourself. > > Another way would be just a way around the problem. Build a second table > instead an array. > > Regards, > > Thomas > > > Am Freitag, 17. November 2006 22:03 schrieb gustavo halperin: > >> Hello >> >> I'm using PostgreSQL with wxDb classes. But I don't know how to define >> the columns in the method wxDbTable::SetColDefs. In PostgreSQL I define >> the table in the next form: >> >> CREATE TABLE sal_emp ( >> name text, >> schedule text[] >> ); >> >> >> .. so any idea how to define the variable schedule ??? >> >> Thank you in advance, >> Gustavo >> > > -- ||\ // \ | \\ // | I'm thinking. \ \\ l\\l_ // | _ _ | \\/ `/ `.| | /~\\ \ //~\ | Y | | || Y | | \\ \ // | | \| | |\ / | [ || || ] \ | o|o | > / ] Y || || Y [ \___\_--_ /_/__/ | \_|l,------.l|_/ | /.-\(____) /--.\ | >' `< | `--(______)----' \ (/~`--____--'~\) / U// U / \ `-_>-__________-<_-' / \ / /| /(_#(__)#_)\ ( .) / / ] \___/__\___/ `.`' / [ /__`--'__\ |`-' | /\(__,>-~~ __) | |__ /\//\\( `--~~ ) _l |--:. '\/ <^\ /^> | ` ( < \\ _\ >-__-< /_ ,-\ ,-~~->. \ `:.___,/ (___\ /___) (____/ (____) `---' --------------------------------------------------------------------- To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
|
Pages: 1 Prev: wxsheet and wxMSW2.8.0 rc incompatible Next: wxRichTextCtrl printing problem |