Skip to content

Commit

Permalink
Obsolete method removed
Browse files Browse the repository at this point in the history
* Table::getProcedureTemplate() has been replaced by a code template,
  method was no longer used anywhere in the code
  • Loading branch information
Michael Hieke committed Nov 5, 2012
1 parent 91febfd commit d9f542a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 44 deletions.
43 changes: 0 additions & 43 deletions src/metadata/table.cpp
Expand Up @@ -104,49 +104,6 @@ void Table::loadChildren()
Relation::loadChildren();
}
//-----------------------------------------------------------------------------
wxString Table::getProcedureTemplate()
{
ensureChildrenLoaded();
wxString spname = wxT("SP_") + getName_();
Identifier id(spname);
wxString sql = wxT("SET TERM !! ;\nCREATE PROCEDURE ") + id.getQuoted() +
wxT("\nRETURNS (");
wxString collist, valist, parlist;

DatabasePtr db = getDatabase();
wxString dbcharset = db->getDatabaseCharset();
for (ColumnPtrs::iterator i = columnsM.begin();
i != columnsM.end(); ++i)
{
wxString datatype;
DomainPtr d = (*i)->getDomain();
if (!d)
datatype = (*i)->getDatatype();
else
{
datatype = d->getDatatypeAsString();
wxString charset(d->getCharset());
if (!charset.IsEmpty() && dbcharset != charset)
datatype += wxT(" CHARACTER SET ") + charset;
}

if (!collist.empty())
{
valist += wxT(", ");
collist += wxT(", ");
parlist += wxT(",");
}
parlist += wxT("\n\t") + (*i)->getQuotedName() + wxT(" ") + datatype;
collist += wxT("a.") + (*i)->getQuotedName();
valist += wxT(":") + (*i)->getQuotedName();
}
sql += parlist;
sql += wxT(")\nAS\nBEGIN\n\tFOR SELECT ") + collist + wxT("\n\t FROM ")
+ getQuotedName() + wxT(" a\n\t INTO ") + valist
+ wxT("\n\tDO\n\tBEGIN\n\t\tSUSPEND;\n\tEND\nEND!!\nSET TERM ; !!\n");
return sql;
}
//-----------------------------------------------------------------------------
//! reads checks info from database
void Table::loadCheckConstraints()
{
Expand Down
1 change: 0 additions & 1 deletion src/metadata/table.h
Expand Up @@ -80,7 +80,6 @@ class Table: public Relation
std::vector<UniqueConstraint> *getUniqueConstraints();
std::vector<Index> *getIndices();

wxString getProcedureTemplate();
virtual const wxString getTypeName() const;
virtual void acceptVisitor(MetadataItemVisitor* visitor);
};
Expand Down

0 comments on commit d9f542a

Please sign in to comment.