示例#1
0
文件: tag.cpp 项目: jaju/hypar2
    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;
}
示例#2
0
wxString Column::getDropSqlStatement() const
{
    Table* t = getTable();
    if (t == 0)
        return wxEmptyString;
    return "ALTER TABLE " + t->getQuotedName() + " DROP " + getQuotedName();
}
示例#3
0
wxString Function::getDropSqlStatement() const
{
    StatementBuilder sb;
    sb << kwDROP << ' ' << kwEXTERNAL << ' ' << kwFUNCTION << ' '
        << getQuotedName() << ';';
    return sb;
}
示例#4
0
//-----------------------------------------------------------------------------
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;
}
示例#5
0
wxString Exception::getAlterSql()
{
    wxString message = getMessage();
    message.Replace("'", "''");

    StatementBuilder sb;
    sb << kwALTER << ' ' << kwEXCEPTION << ' ' << getQuotedName() << " '"
        << message << "';";
    return sb;
}
示例#6
0
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";
}
示例#7
0
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;
}
示例#8
0
//-----------------------------------------------------------------------------
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();
}
示例#9
0
wxString MetadataItem::getDropSqlStatement() const
{
    return "DROP " + getTypeName() + " " + getQuotedName() + ";";
}