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