CloneSet341


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
16220.960statement_sequence[6]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
116253
E:/TSE/Projects-CloneDR/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/ContentsTab.java
215313
E:/TSE/Projects-CloneDR/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/ContentsTab.java
Next
Last
Clone Instance
1
Line Count
16
Source Line
253
Source File
E:/TSE/Projects-CloneDR/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/ContentsTab.java

// Note. Some DBMSs such as Oracle do not allow:
// "select *, rowid from table"
// You cannot have any column name in the columns clause
// if you have * in there. Aliasing the table name seems to
// be the best way to get around the problem.
final StringBuffer buf = new StringBuffer();
buf.append("select tbl.*").append(pseudoColumn).append(" from ").append(ti.getQualifiedName()).append(" tbl");
String clause = _sqlFilterClauses.get(WhereClausePanel.getClauseIdentifier(), ti.getQualifiedName());
if ((clause != null) && (clause.length() > 0)) {
  buf.append(" where ").append(clause);
}
clause = _sqlFilterClauses.get(OrderByClausePanel.getClauseIdentifier(), ti.getQualifiedName());
if ((clause != null) && (clause.length() > 0)) {
  buf.append(" order by ").append(clause);
}


First
Previous
Clone Instance
2
Line Count
15
Source Line
313
Source File
E:/TSE/Projects-CloneDR/sql12/app/src/net/sourceforge/squirrel_sql/client/session/mainpanel/objecttree/tabs/table/ContentsTab.java

// Some tables have pseudo column primary keys and others
// do not.  JDBC on some DBMSs does not handle pseudo
// columns 'correctly'.  Also, getTables returns 'views' as
// well as tables, so the thing we are looking at might not
// be a table. (JDBC does not give a simple way to
// determine what we are looking at since the type of
// object is described in a DBMS-specific encoding.)  For
// these reasons, rather than testing for all these
// conditions, we just try using the pseudo column info to
// get the table data, and if that fails, we try to get the
// table data without using the pseudo column.
// TODO: Should we change the mode from editable to
// non-editable?
final StringBuffer buf = new StringBuffer();
buf.append("select *").append(" from ").append(ti.getQualifiedName()).append(" tbl");
String clause = _sqlFilterClauses.get(WhereClausePanel.getClauseIdentifier(), ti.getQualifiedName());
if ((clause != null) && (clause.length() > 0)) {
  buf.append(" where ").append(clause);
}
clause = _sqlFilterClauses.get(OrderByClausePanel.getClauseIdentifier(), ti.getQualifiedName());
if ((clause != null) && (clause.length() > 0)) {
  buf.append(" order by ").append(clause);
}


Clone AbstractionParameter Count: 2Parameter Bindings

// Note. Some DBMSs such as Oracle do not allow:
// "select *, rowid from table"
// You cannot have any column name in the columns clause
// if you have * in there. Aliasing the table name seems to
// be the best way to get around the problem.
// Some tables have pseudo column primary keys and others
// do not.  JDBC on some DBMSs does not handle pseudo
// columns 'correctly'.  Also, getTables returns 'views' as
// well as tables, so the thing we are looking at might not
// be a table. (JDBC does not give a simple way to
// determine what we are looking at since the type of
// object is described in a DBMS-specific encoding.)  For
// these reasons, rather than testing for all these
// conditions, we just try using the pseudo column info to
// get the table data, and if that fails, we try to get the
// table data without using the pseudo column.
// TODO: Should we change the mode from editable to
// non-editable?
final StringBuffer buf = new StringBuffer();
 [[#variable1af920e0]].append( [[#variable1af865e0]]).append(" from ").append(ti.getQualifiedName()).append(" tbl");
String clause = _sqlFilterClauses.get(WhereClausePanel.getClauseIdentifier(), ti.getQualifiedName());
if ((clause != null) && (clause.length() > 0)) {
  buf.append(" where ").append(clause);
}
clause = _sqlFilterClauses.get(OrderByClausePanel.getClauseIdentifier(), ti.getQualifiedName());
if ((clause != null) && (clause.length() > 0)) {
  buf.append(" order by ").append(clause);
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#1af920e0]]
buf.append("select tbl.*") 
12[[#1af920e0]]
buf 
21[[#1af865e0]]
pseudoColumn 
22[[#1af865e0]]
"select *"