Period in a Column name
Posted: Fri Jun 22, 2012 4:36 pm
Still working on this project involving an ODBC connector, and now that I am able to connect to the database I have run into another issue.
One of the crtical columns that I need to query on has a period in it's name - "parent.change". Obviously I can't just use this raw, since periods in sql indicate schema. I still tried it though, and it returns nothing, even though I know there are matching records.
I have tried putting the column name in double quotes, in square brackets, and using the "_" wildcard in place of the period with no luck. The first two give no results, while the third (_) returns the first record in the database regardless of the value in my query.
Has anyone run into a problem like this befopre, and if so, how did you manage to solve it? It kind of amazes me that HP (the vendor of the software I am trying to work with) would use periods in the "out of the box" column names since it's obviously going to be a problem if anyone tries to use the ODBC connector.
One of the crtical columns that I need to query on has a period in it's name - "parent.change". Obviously I can't just use this raw, since periods in sql indicate schema. I still tried it though, and it returns nothing, even though I know there are matching records.
I have tried putting the column name in double quotes, in square brackets, and using the "_" wildcard in place of the period with no luck. The first two give no results, while the third (_) returns the first record in the database regardless of the value in my query.
Has anyone run into a problem like this befopre, and if so, how did you manage to solve it? It kind of amazes me that HP (the vendor of the software I am trying to work with) would use periods in the "out of the box" column names since it's obviously going to be a problem if anyone tries to use the ODBC connector.