1 22 23 package org.xquark.extractor.sybase.sql; 24 25 import org.xquark.extractor.sql.Context; 26 import org.xquark.extractor.sql.SqlExpression; 27 28 public class SqlInsert extends org.xquark.extractor.sql.SqlExpression { 29 private static final String RCSRevision = "$Revision: 1.4 $"; 30 private static final String RCSName = "$Name: $"; 31 32 33 private org.xquark.extractor.sql.SqlTable _tableName; 34 protected SqlExpression _values; 35 36 public SqlInsert() { 37 super(); 38 } 39 40 public SqlInsert(org.xquark.extractor.sql.SqlTable tableName, SqlExpression values) { 41 super(); 42 setTableName(tableName); 43 setValues(values); 44 } 45 46 public org.xquark.extractor.sql.SqlTable getTableName() { 47 return _tableName; 48 } 49 50 public void setTableName(org.xquark.extractor.sql.SqlTable tableName) { 51 _tableName = tableName; 52 } 53 54 public SqlExpression getValues() { 55 return _values; 56 } 57 58 public void setValues(SqlExpression values) { 59 _values = values; 60 } 61 62 public String toSql(Context context) { 63 StringBuffer retVal = new StringBuffer (); 65 66 retVal.append("INSERT INTO "); 67 retVal.append(getTableName().toSql(context)); 68 69 72 retVal.append(" VALUES "); 73 retVal.append(getValues().toSql(context)); 74 75 return retVal.toString() ; 77 } 78 } 79 | Popular Tags |