wxString pgSequence::GetSql(ctlTree *browser) { if (sql.IsNull()) { UpdateValues(); sql = wxT("-- Sequence: ") + GetQuotedFullIdentifier() + wxT("\n\n") + wxT("-- DROP SEQUENCE ") + GetQuotedFullIdentifier() + wxT(";") + wxT("\n\nCREATE SEQUENCE ") + GetQuotedFullIdentifier() + wxT("\n INCREMENT ") + GetIncrement().ToString() + wxT("\n MINVALUE ") + GetMinValue().ToString() + wxT("\n MAXVALUE ") + GetMaxValue().ToString() + wxT("\n START ") + GetLastValue().ToString() + wxT("\n CACHE ") + GetCacheValue().ToString(); if (GetCycled()) sql += wxT("\n CYCLE"); sql += wxT(";\n") + GetOwnerSql(7, 3, wxT("TABLE ") + GetQuotedFullIdentifier()); if (!GetConnection()->BackendMinimumVersion(8, 2)) sql += GetGrant(wxT("arwdRxt"), wxT("TABLE ") + GetQuotedFullIdentifier()); else sql += GetGrant(wxT("rwU"), wxT("TABLE ") + GetQuotedFullIdentifier()); sql += GetCommentSql(); if (GetConnection()->BackendMinimumVersion(9, 1)) sql += GetSeqLabelsSql(); } return sql; }
void pgSequence::ShowTreeDetail(ctlTree *browser, frmMain *form, ctlListView *properties, ctlSQLBox *sqlPane) { UpdateValues(); if (properties) { CreateListColumns(properties); properties->AppendItem(_("Name"), GetName()); properties->AppendItem(_("OID"), GetOid()); properties->AppendItem(_("Owner"), GetOwner()); properties->AppendItem(_("ACL"), GetAcl()); properties->AppendItem(_("Current value"), GetLastValue()); properties->AppendItem(_("Next value"), GetNextValue()); properties->AppendItem(_("Minimum"), GetMinValue()); properties->AppendItem(_("Maximum"), GetMaxValue()); properties->AppendItem(_("Increment"), GetIncrement()); properties->AppendItem(_("Cache"), GetCacheValue()); properties->AppendYesNoItem(_("Cycled?"), GetCycled()); properties->AppendYesNoItem(_("Called?"), GetCalled()); properties->AppendYesNoItem(_("System sequence?"), GetSystemObject()); properties->AppendItem(_("Comment"), firstLineOnly(GetComment())); if (!GetLabels().IsEmpty()) { wxArrayString seclabels = GetProviderLabelArray(); if (seclabels.GetCount() > 0) { for (unsigned int index = 0 ; index < seclabels.GetCount() - 1 ; index += 2) { properties->AppendItem(seclabels.Item(index), seclabels.Item(index + 1)); } } } } }
void pgSequence::ShowTreeDetail(ctlTree *browser, frmMain *form, ctlListView *properties, ctlSQLBox *sqlPane) { UpdateValues(); if (properties) { CreateListColumns(properties); properties->AppendItem(_("Name"), GetName()); properties->AppendItem(_("OID"), GetOid()); properties->AppendItem(_("Owner"), GetOwner()); properties->AppendItem(_("ACL"), GetAcl()); properties->AppendItem(_("Current value"), GetLastValue()); properties->AppendItem(_("Minimum"), GetMinValue()); properties->AppendItem(_("Maximum"), GetMaxValue()); properties->AppendItem(_("Increment"), GetIncrement()); properties->AppendItem(_("Cache"), GetCacheValue()); properties->AppendItem(_("Cycled?"), GetCycled()); properties->AppendItem(_("Called?"), GetCalled()); properties->AppendItem(_("System sequence?"), GetSystemObject()); properties->AppendItem(_("Comment"), firstLineOnly(GetComment())); } }