int Tag::parseAttributes (_char *&pTagAttrString) { int retval = -1; _char *pName, *pValue; int propCount = 0; while (1) { retval = getQuotedName (pTagAttrString, &pName, true); if (retval < 0) { break; } else if (1 == retval) { continue; } if (getQuotedValue (pTagAttrString, &pValue, true) < 0) { break; } std::pair<_char *, _char *> p (pName, pValue); m_attrList.push_back (p); propCount++; } return propCount; }
wxString Column::getDropSqlStatement() const { Table* t = getTable(); if (t == 0) return wxEmptyString; return "ALTER TABLE " + t->getQuotedName() + " DROP " + getQuotedName(); }
wxString Function::getDropSqlStatement() const { StatementBuilder sb; sb << kwDROP << ' ' << kwEXTERNAL << ' ' << kwFUNCTION << ' ' << getQuotedName() << ';'; return sb; }
//----------------------------------------------------------------------------- QString Exception::getAlterSql() { QString message = getMessage(); message.replace(QString::fromLatin1("'"), QString::fromLatin1("''")); StatementBuilder sb; sb << kwALTER << ' ' << kwEXCEPTION << ' ' << getQuotedName() << QString::fromLatin1(" '") << message << QString::fromLatin1("';"); return sb; }
wxString Exception::getAlterSql() { wxString message = getMessage(); message.Replace("'", "''"); StatementBuilder sb; sb << kwALTER << ' ' << kwEXCEPTION << ' ' << getQuotedName() << " '" << message << "';"; return sb; }
wxString Domain::getAlterSqlTemplate() const { return "ALTER DOMAIN " + getQuotedName() + "\n" " SET DEFAULT { literal | NULL | USER }\n" " | DROP DEFAULT\n" " | ADD [CONSTRAINT] CHECK (condition)\n" " | DROP CONSTRAINT\n" " | new_name\n" " | TYPE new_datatype;\n"; }
wxString Function::getCreateSql() { ensurePropertiesLoaded(); StatementBuilder sb; sb << kwDECLARE << ' ' << kwEXTERNAL << ' ' << kwFUNCTION << ' ' << getQuotedName() << StatementBuilder::NewLine << paramListM << StatementBuilder::NewLine << kwRETURNS << ' ' << retstrM << StatementBuilder::NewLine << kwENTRY_POINT << " '" << entryPointM << '\'' << StatementBuilder::NewLine << kwMODULE_NAME << " '" << libraryNameM << "\';" << StatementBuilder::NewLine; return sb; }
//----------------------------------------------------------------------------- void Generator::loadProperties() { setPropertiesLoaded(false); DatabasePtr db = getDatabase(); MetadataLoader* loader = db->getMetadataLoader(); MetadataLoaderTransaction tr(loader); // IMPORTANT: for all other loading where the name of the db object is // Set() into a parameter getName_() is used, but for dynamically // building the SQL statement getQuotedName() must be used! std::string sqlName(wx2std(getQuotedName(), db->getCharsetConverter())); // do not use cached statements, because this can not be reused IBPP::Statement st1 = loader->createStatement( "select gen_id(" + sqlName + ", 0) from rdb$database"); st1->Execute(); st1->Fetch(); st1->Get(1, &valueM); setPropertiesLoaded(true); notifyObservers(); }
wxString MetadataItem::getDropSqlStatement() const { return "DROP " + getTypeName() + " " + getQuotedName() + ";"; }