Re: [Cppcms-users] cppdb::result::get problem
Brought to you by:
artyom-beilis
From: Lee E. <lee...@gm...> - 2012-04-30 06:48:17
|
Here is my uneducated guess: you want to be able to get to the columnA (assuming it is a unique column) as both: "st.columnA" and "columnA" in order to do that you need to maintain the "st" table name for each colunm, and you need to parse the column name instead of just compare it. or alternatively you need to have several names for the same column. on the face of it it looks like the type of programming done in management environments and not in C++ - since just supporting those two names will mean slowing down access time to the columns. it gets worse - in order to keep that table name - the CppDB needs to actually parse the columns and table parts of the select statements instead of just passing it along to the db. again more work for a very limited gain. as a general rule - i try to avoid select * in my code. i prefer to list the columns one by one either in the SP or in the query and if you do that - you can give the columns unique names lee On Mon, Apr 30, 2012 at 3:20 AM, <ele...@ex...> wrote: > Hello, > > Supposing I have a SELECT * FROM sometable st LEFT OUTER JOIN othertable > ot ON (st.ot_id=ot.id) ... > > Then looping through the results using result::next() > > Why can't I access the results this way? > > r.get<string>("st.columnA") ? > > Imagine you want to get all the columns from both tables and some have > duplicate column names such as - id or name > > Petr > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > -- -- lee Lee Elenbaas lee...@gm... |