39 sbSQLUpdateBuilder::GetTableName(nsAString& aTableName)
41 aTableName = mTableName;
45 sbSQLUpdateBuilder::SetTableName(
const nsAString& aTableName)
47 mTableName = aTableName;
52 sbSQLUpdateBuilder::AddAssignmentString(
const nsAString& aColumnName,
55 Assignment* a = mAssignments.AppendElement();
56 NS_ENSURE_TRUE(a, NS_ERROR_OUT_OF_MEMORY);
59 a->columnName = aColumnName;
66 sbSQLUpdateBuilder::AddAssignmentParameter(
const nsAString& aColumnName)
68 Assignment* a = mAssignments.AppendElement();
69 NS_ENSURE_TRUE(a, NS_ERROR_OUT_OF_MEMORY);
72 a->columnName = aColumnName;
81 mTableName.Truncate();
92 buff.AssignLiteral(
"update ");
94 buff.Append(mTableName);
96 buff.AppendLiteral(
" set ");
98 PRUint32 len = mAssignments.Length();
99 for (PRUint32
i = 0;
i < len;
i++) {
100 const Assignment& a = mAssignments[
i];
102 buff.Append(a.columnName);
103 buff.AppendLiteral(
" = ");
107 buff.AppendLiteral(
"null");
111 nsAutoString escapedValue(a.stringValue);
114 buff.AppendLiteral(
"'");
115 buff.Append(escapedValue);
116 buff.AppendLiteral(
"'");
120 buff.AppendInt(a.int32Value);
123 buff.AppendLiteral(
"?");
128 buff.AppendLiteral(
", ");
133 NS_ENSURE_SUCCESS(rv, rv);
135 _retval.Assign(buff);
NS_DECL_SBISQLUPDATEBUILDER NS_IMETHOD ToString(nsAString &_result)
NS_IMPL_ISUPPORTS_INHERITED1(sbSQLUpdateBuilder, sbSQLWhereBuilder, sbISQLUpdateBuilder) sbSQLUpdateBuilder
nsresult SB_EscapeSQL(nsAString &str)
nsresult AppendWhere(nsAString &aBuffer)
Interface for building UPDATE statements.
_getSelectedPageStyle s i