sqldata/sqldb.cpp
// Get DEFAULT if it is a literal (MySQL i.e. requires full column specification in ALTER TABLE)
Get DEFAULT if it is a literal (MySQL i.e. requires full column specification in ALTER TABLE)
Get DEFAULT if it is a literal ( MySQL i . e . requires full column specification in ALTER TABLE )
int	SqlDb::GetDefaultClause(const char *s_table, char *column, std::string &default_clause)
{
	if(s_table == NULL || column == NULL)
		return -1;
	if(target_type != SQLDATA_MYSQL)
		return 0;
	std::string def_clause;
	if(_metaSqlDb != NULL)
		_metaSqlDb->_source_ca.db_api->GetColumnDefault(s_table, column, def_clause);
	if(def_clause.empty() == false)
	{
		const char *d = def_clause.c_str();
		if(*d == '\'' || (*d >= '0' && *d <= '9') || !_stricmp(d, "CURRENT_TIMESTAMP"))
			default_clause = def_clause;
		else 
		if(!_stricmp(d, "CURRENT TIMESTAMP"))
			default_clause = "CURRENT_TIMESTAMP";
	}
	return 0;
}
int SqlDb :: GetDefaultClause ( const char * s_table , char * column , std :: string & default_clause ) { if ( s_table == NULL || column == NULL ) return -1 ; if ( target_type != SQLDATA_MYSQL ) return 0 ; std :: string def_clause ; if ( _metaSqlDb != NULL ) _metaSqlDb -> _source_ca . db_api -> GetColumnDefault ( s_table , column , def_clause ) ; if ( def_clause . empty ( ) == false ) { const char * d = def_clause . c_str ( ) ; if ( * d == ' \' ' || ( * d >= ' ' && * d <= ' ' ) || ! _stricmp ( d , " " ) ) default_clause = def_clause ; else if ( ! _stricmp ( d , " " ) ) default_clause = " " ; } return 0 ; }
Get DEFAULT if it is a literal (MySQL i.e.
Get DEFAULT if it is a literal ( MySQL i . e .
// MySQL allows only string literals, numbers and some functions