On Mon Mar 29 07:12:15 2010, REHSACK wrote:
Show quoted text> > > This isn't a bug - this works as intended. Other DBMS will
change
Show quoted text> the
> > > default case for column namen, too (Oracle to upper cased names,
> > > PostgreSQL to lower cased names).
> >
> > Note, that when you connect to mentioned DBMS you don't specify
> > tablefields explicitly as I do on my connect.
>
> You seem to miss some details in processing. Even if you do in an
Oracle
Show quoted text> DBMS:
> : CREATE TABLE foo (Id INT, baR VARCHAR(64));
> : INSERT INTO foo (1, 'Car');
> : INSERT INTO bar (2, 'Truck');
> : SELECT * from bar;
>
> in one SQL script or SBI session, the resulting column names are
upper
Show quoted text> cased. You cannot expect - even if most DBMS supporting multiple
> commands in one session, that the share information between several
> statements.
>
I'm not trying to share info between multiple SQL statements.
$dbh->{'csv_tables'}->{$tab} = {
'eol' => "\n", 'col_names' => [ qw( MyCol1 MyCol2 )],
'file' => $fname };
With this command I'm describing table structure in DBI object.
As I know there only two ways to do it: like I did with 'col_names'
parameter or as a first row in CSV file.
In the cases when "*" expansion is required DB driver should get this
info from current table description. Remember that user may
run "CREATE" and then change table with ALTER table command.
Show quoted text> > However when you do, e.g. using quoted Oracle field names, you'll
> > receive requested case in field names.
>
> When you use quoted field names in SQL::Statement / DBD::CSV, you'll
> receive requested case for those field names in that statement, too.
>
> > Thats why it seems reasonable to expect that program will respect
> > specified field names.
>
> So please be so kind and quote them!
>
I'll be fine for me to quote fields on the stage when I'm describing
table structure:
'col_names' => [ ""Col1"", ""Col2"",... ]
But as I understand, it won't work on "*" expansion too.
Show quoted text> > > To fix some internal issues with keeping mixed cases in
table/column
Show quoted text> > > names, all cases were converted to lower cased names since 1.22
(See
Show quoted text> > > changelog).
> >
> > Thats fine for internal stuff but not for outside interface. When
> > user explicitly specify what he wants to receive, program should
> > follow his orders and shouldn't make programmers life harder.
>
> You didn't specify exactly what you need. Please see t/17quoting.t
for
Show quoted text> some examples how to use quoting.
>
> > E.g. request like this allready follows this rule:
> > select MyCol1, MyCol2 from mytable
> > In resulting hash we have keys: MyCol1 MyCol2.
>
> Please quote in those cases:
> select "MyCol1", "MyCol2" from "mytable"
> This will work as expected.
>
This command already working as I expect, without any quoting
required. If I do:
...
select MyCol1, MyCol2 from mytable
...
$dbRec = $sth->fetchrow_hashref()
..
In %$dbRec I'll have keys: MyCol1, MyCol2.
In current version only "*" expansion works according "more suitable
for machine" way.