Hi all,
I previously had a question regarding PERL interfacing with a CSV datasource via the DBI/DBD-CSV modules.
Since then I've been knocking some code together and am very pleased with the results, but now I've been stumped with another problem: some of the field names in the datasource have spaces in them like "Marine or Freshwater"
So far this hasn't been a problem, referencing such fields like $row->{'Marine or Freshwater'} returns the correct value, but I'd like to be able to structure the queries to search based on values in these fields.
For example, I have the following code in my script:
my($query) = "SELECT * FROM $table_name"; which works well.
I'd like to change the select statement to something like:
SELECT * FROM $table_name WHERE Marine or Freshwater = 'Freshwater'
But this produces a parsing error from the DBD module.
Unfortunately, I have no control over the databsource design - so changing field names is not an option...
Any ideas?
I previously had a question regarding PERL interfacing with a CSV datasource via the DBI/DBD-CSV modules.
Since then I've been knocking some code together and am very pleased with the results, but now I've been stumped with another problem: some of the field names in the datasource have spaces in them like "Marine or Freshwater"
So far this hasn't been a problem, referencing such fields like $row->{'Marine or Freshwater'} returns the correct value, but I'd like to be able to structure the queries to search based on values in these fields.
For example, I have the following code in my script:
my($query) = "SELECT * FROM $table_name"; which works well.
I'd like to change the select statement to something like:
SELECT * FROM $table_name WHERE Marine or Freshwater = 'Freshwater'
But this produces a parsing error from the DBD module.
Unfortunately, I have no control over the databsource design - so changing field names is not an option...
Any ideas?