List:MySQL++« Previous MessageNext Message »
From:Королев Илья Date:October 17 2006 1:25pm
Subject:Re: Problems with timestamp
View as plain text  
В сообщении от 17 октября 2006 16:04 Warren Young написал(a):
> Королев Илья wrote:
> > Why we can't just drop away static names[] ( and table)?
>
> How would SSQLS build queries without a table of the field names?

like this:

template <class Manip> std::ostream& operator << (std::ostream& s,
const 
DB_AdvBase_field_list<Manip>& obj) {
  s << obj.manip << "user_id" << obj.delem;
  s << obj.manip << "position" << obj.delem;
  s << obj.manip << "ts" << obj.delem;
  s << obj.manip << "pads";
  return s;
}

IMHO in such way we don't need names[] at all.

>
> > The only advantage IMHO is that we can change names[](table) on the
> > fly.
>
> Every single table in my own use of MySQL++ has a different name than
> the corresponding SSQLS.  I am unwilling to give up that feature.

Explain please. 

Does one SSQLS correspond one table?

sql_create_4(
                DB_ClickStatRequest, 1, 0,
                OID,                    id,
                OID,                    click_id,
                OID,                    program_id,
                mysqlpp::sql_timestamp, ts
           );

and after use it with table "TableName"?
So, you change a static variable table?
DB_ClickStatRequest::table() = "TableName";
DB_ClickStatRequest obj;
Q << "SELECT " << obj.field_list() << " FROM " << obj.table();

In such case IMHO it's possible to declare "TableName" in other way.
#define TABLE_NAME "TableName"
Q << "SELECT " << obj.field_list() << " FROM " << TABLE_NAME;

Or I misunderstand again? :)
Thread
Problems with timestampКоролев Илья16 Oct
  • Re: Problems with timestampWarren Young17 Oct
    • Re: Problems with timestampКоролев Илья17 Oct
      • Re: Problems with timestampWarren Young17 Oct
        • Re: Problems with timestampКоролев Илья17 Oct
          • Re: Problems with timestampWarren Young17 Oct
            • Re: Problems with timestampКоролев Илья17 Oct
              • Re: Problems with timestampWarren Young17 Oct
                • Re: Problems with timestampКоролев Илья17 Oct
                  • Re: Problems with timestampWarren Young18 Oct
                    • Re: Problems with timestampКоролев Илья18 Oct
                      • Re: Problems with timestampWarren Young18 Oct
                        • Re: Problems with timestampКоролев Илья24 Oct
                          • Re: Problems with timestampWarren Young24 Oct
                            • Re: Problems with timestampКоролев Илья25 Oct
                              • Re: Problems with timestampWarren Young25 Oct
                                • Re: Problems with timestampКоролев Илья20 Nov
                                  • Re: Problems with timestampWarren Young20 Nov