1 22 23 package org.xquark.extractor.mysql.sql; 24 25 import org.xquark.extractor.common.Debug; 26 import org.xquark.extractor.sql.Context; 27 import org.xquark.extractor.sql.SqlExpression; 28 import org.xquark.extractor.sql.SqlFunction; 29 30 public class SfRowidToChar extends SqlFunction { 31 private static final String RCSRevision = "$Revision: 1.4 $"; 32 private static final String RCSName = "$Name: $"; 33 34 35 public SfRowidToChar() { 36 } 37 38 public SfRowidToChar(SqlExpression expr) { 39 super(); 40 setArgument(0, expr); 41 } 42 43 44 public String toSql (Context context) 45 { 46 StringBuffer retVal = new StringBuffer (); 48 49 SqlExpression expr = getArgument(0); 50 51 Debug.assertTrue(expr instanceof SqlAttributeExpression, "expr instanceof SqlAttributeExpression"); 52 String attrName = ((SqlAttributeExpression)expr).getAttribute(); 53 Debug.assertTrue (attrName.equalsIgnoreCase("rowid"),"attrName.equalsIgnoreCase('rowid')"); 54 55 retVal.append("ROWIDTOCHAR("); 56 retVal.append(expr.toSql(context)); 57 retVal.append(")"); 58 59 return retVal.toString(); 61 } 62 63 } 64 | Popular Tags |