Subject | Re: decision help needed |
---|---|
Author | Roman Rokytskyy |
Post date | 2002-10-16T20:48:42Z |
> If I'm way off disregard!From the code perspective it is easier to write:
>
> It sounds like the String.equalsIgnoreCase() should be employed?
if (!colName.startsWith("\"") || !colName.endsWith("\""))
colName = colName.toUpperCase();
and use colName.equals(xsqlvars[i].sqlname) later.
> You are just talking about comparing the column names, right?Right. Consider following case:
SELECT col1, "col1", "Col1", "cOl1" from some_table;
in XSQLVAR[] cols you will have (using Java notation):
cols[0] == "COL1"
cols[1] == "col1"
cols[2] == "Col1"
cols[3] == "cOl1"
All of them are equal ignoring case... However, they are different.
So, we need some way to represent following calls
getString("COL1") -> getString("COL1") or getString("col1")
getString("col1") -> getString("\"col1\"");
getString("Col1") -> getString("\"Col1\"");
getString("cOl1") -> getString("\"cOl1\"");
Personally I would compare strings case-sensitive stripping double
quotes if any. However, this would break many applications...
Best regards,
Roman Rokytskyy