perl.dbi.dev http://www.nntp.perl.org/group/perl.dbi.dev/ ... Copyright 1998-2008 perl.org Sat, 11 Oct 2008 14:55:42 +0000 ask@perl.org Re: Help sought with definition and implementation of ParamTypesattribute by Martin Evans H.Merijn Brand wrote:<br/>&gt; On Fri, 10 Oct 2008 16:19:20 +0100, Martin Evans<br/>&gt; &lt;martin.evans@easysoft.com&gt; wrote:<br/>&gt; <br/>&gt;&gt; Hi,<br/>&gt;&gt;<br/>&gt;&gt; The DBI specification for ParamTypes taken from the DBI pod says the <br/>&gt;&gt; following for ParamTypes:<br/>&gt;&gt;<br/>&gt;&gt; Returns a reference to a hash containing the type information currently <br/>&gt;&gt; bound to placeholders. The keys of the hash are the &rsquo;names&rsquo; of the <br/>&gt;&gt; placeholders: either integers starting at 1, or, for drivers that <br/>&gt;&gt; support named placeholders, the actual parameter name string. The hash <br/>&gt;&gt; values are hashrefs of type information in the same form as that <br/>&gt;&gt; provided to the various bind_param() methods (See &quot;bind_param&quot; for the <br/>&gt;&gt; format and values), plus anything else that was passed as the third <br/>&gt;&gt; argument to bind_param(). Returns undef if not supported by the driver.<br/>&gt;&gt;<br/>&gt;&gt; I&#39;m not sure why the values of the keys are hash references unless<br/>&gt; <br/>&gt; because if only the numeric values were supported, it would have been a<br/>&gt; list, not a hash, but when placeholder names come in sight, a list<br/>&gt; would not do<br/>&gt; <br/>&gt; $sth = $dbh-&gt;prepare (&quot;select * from xx where xs between ? and ? or xc = ?&quot;);<br/>&gt; $sth-&gt;execute (4, 7, &quot;0&quot;);<br/>&gt; <br/>&gt; ParamValues =&gt; { 1 =&gt; 4, 2 =&gt; 7, 3 =&gt; &quot;0&quot; },<br/>&gt; ParamTypes =&gt; { 1 =&gt; 5, 2 =&gt; 5, 3 =&gt; 1 },<br/>&gt; <br/>&gt; If param names are supported, that might look like<br/>&gt; <br/>&gt; ParamValues =&gt; { foo =&gt; 4, bar =&gt; 7, baz =&gt; &quot;0&quot; },<br/>&gt; ParamTypes =&gt; { foo =&gt; 5, bar =&gt; 5, baz =&gt; 1 },<br/><br/>but here the keys 1, 2, 3 or foo, bar and baz do not have hash <br/>references as values as per &quot;the hash values are hashrefs&quot; they have <br/>scalars as values. What I understood &quot;the hash values are hashrefs&quot; to <br/>mean was:<br/><br/>ParamTypes =&gt; {1 =&gt; {something =&gt; x, somethingelse =&gt; y},<br/> 2 =&gt; {something =&gt; x, somethingelse =&gt; y}}<br/><br/>and I was questioning what the &quot;something&quot; and &quot;somethingelse&quot; were <br/>since I am only aware of a &quot;type&quot;.<br/><br/><br/>&gt;&gt; multiple values are to be stored. If multiple values per key are stored <br/>&gt;&gt; what are they typically? I can only find one DBD which implements <br/>&gt;&gt; ParamTypes (DBD::Pg) and unless I am mistaken it sets the values of the <br/>&gt; <br/>&gt; I implemented it in DBD::Unify as of 0.75 in a bigger patch to<br/>&gt; implement as much as possible of the DBI defenition:<br/><br/>thanks for that pointer - I missed DBD::Unify<br/><br/>&gt; *** Release 0.75 - Tue 23 Sep 2008 &lt;h.m.brand@xs4all.nl&gt;<br/>&gt; <br/>&gt; - Three-level dbd_verbose and documentation<br/>&gt; - $ENV{DBD_TRACE} sets $dbh-&gt;{dbd_verbose} on/before connect<br/>&gt; - New tests for $h-&gt;trace (...) and $h-&gt;{dbd_verbose}<br/>&gt; - Added type_info_all (), get_info (), and parse_trace_flag ()<br/>&gt; - Note that identifiers are now quoted<br/>&gt; - Override quote_identifier () (UNIFY has no CATALOGS)<br/>&gt; - Accept 2-arg and 3-arg -&gt;do ()<br/>&gt; - Accept %attr to -&gt;prepare ()<br/>&gt; - Raised all verbose levels by 1. 1 and 2 are now DBI only<br/>&gt; - Removed 05-reauth.t<br/>&gt; - NULLABLE now always 2, as it doesn&#39;t work<br/>&gt; - Implemented CursorName sth attribute<br/>&gt; - Implemented ParamValues sth attribute<br/>&gt; - Implemented ParamTypes sth attribute<br/>&gt; - Implemented RowsInCache sth attribute (always 0)<br/>&gt; - Tested with Unify 6.3AB on HP-UX 10.20 with perl 5.8.8<br/>&gt; - Tested with Unify 8.2BC on HP-UX 11.00 with perl 5.8.8<br/>&gt; - Tested with Unify 8.3I on HP-UX 11.23 with perl 5.10.0<br/>&gt; - Tested with Unify 8.3K on AIX 5.2.0.0 with perl 5.8.8<br/>&gt; Tests will fail on older perls, as the test cases use scalarIO<br/>&gt; <br/>&gt;&gt; keys to a scalar value - the type of the parameter.<br/>&gt; <br/>&gt; in dbd_st_FETCH_aatrib ()<br/>&gt; <br/>&gt; if (kl == 10 &amp;&amp; strEQ (key, &quot;ParamTypes&quot;)) {<br/>&gt; HV *hv = newHV ();<br/>&gt; retsv = newRV (sv_2mortal ((SV *)hv));<br/>&gt; while (--p &gt;= 0) {<br/>&gt; char key[8];<br/>&gt; sprintf (key, &quot;%d&quot;, p + 1);<br/>&gt; hv_store (hv, key, strlen (key), newSViv (imp_sth-&gt;prm[p].ftp), 0);<br/>&gt; }<br/>&gt; }<br/><br/>So you seem to have implemented it like DBD::Pg but that does not seem <br/>to agree with how ParamTypes is documented.<br/><br/><br/><br/>&gt;&gt; Reason I&#39;m asking is it is on my to do list for DBD::ODBC.<br/>&gt; <br/>&gt; The test case in t/20-uni-basic.t now looks like<br/>&gt; <br/>&gt; ok ($sth = $dbh-&gt;prepare (&quot;select * from xx where xs between ? and ? or xc = ?&quot;), &quot;sel prepare&quot;);<br/>&gt; ok ($sth-&gt;execute (4, 7, &quot;0&quot;), &quot;execute&quot;);<br/>&gt; ok (1, &quot;-- Check the internals&quot;);<br/>&gt; { my %attr = ( # $sth attributes as documented in DBI-1.607<br/>&gt; NAME =&gt; [qw( xs xl xc xf xr xa xh xT xd xe )],<br/>&gt; NAME_lc =&gt; [qw( xs xl xc xf xr xa xh xt xd xe )],<br/>&gt; NAME_uc =&gt; [qw( XS XL XC XF XR XA XH XT XD XE )],<br/>&gt; NAME_hash =&gt; {qw( xs 0 xl 1 xc 2 xf 3 xr 4 xa 5 xh 6 xT 7 xd 8 xe 9 )},<br/>&gt; NAME_lc_hash =&gt; {qw( xs 0 xl 1 xc 2 xf 3 xr 4 xa 5 xh 6 xt 7 xd 8 xe 9 )},<br/>&gt; NAME_uc_hash =&gt; {qw( XS 0 XL 1 XC 2 XF 3 XR 4 XA 5 XH 6 XT 7 XD 8 XE 9 )},<br/>&gt; uni_types =&gt; [ 5, 2, 1, 8, 7, -4, -6, -7, -3, -11],<br/>&gt; TYPE =&gt; [ 5, 2, 1, 8, 7, 6, 7, 10, 9, 11],<br/>&gt; PRECISION =&gt; [ 4, 9, 5, 64, 32, 9, 15, 0, 0, 0],<br/>&gt; SCALE =&gt; [ 0, 0, 0, 0, 0, 2, 2, 0, 0, 0],<br/>&gt; # NULLABLE =&gt; [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], # Does not work in Unify (yet)<br/>&gt; NULLABLE =&gt; [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],<br/>&gt; CursorName =&gt; &quot;c_sql_00_000001&quot;,<br/>&gt; NUM_OF_FIELDS =&gt; 10,<br/>&gt; NUM_OF_PARAMS =&gt; 3,<br/>&gt; Database =&gt; $dbh,<br/>&gt; ParamValues =&gt; { 1 =&gt; 4, 2 =&gt; 7, 3 =&gt; &quot;0&quot; },<br/>&gt; ParamTypes =&gt; { 1 =&gt; 5, 2 =&gt; 5, 3 =&gt; 1 },<br/>&gt; ParamArrays =&gt; undef, # NYI<br/>&gt; RowsInCache =&gt; 0,<br/>&gt; );<br/>&gt; foreach my $attr (sort keys %attr) {<br/>&gt; #printf STDERR &quot;\n%-20s %s\n&quot;, $attr, &quot;@{$sth-&gt;{$attr}}&quot;;<br/>&gt; my $av = exists $sth-&gt;{$attr} ? $sth-&gt;{$attr} : undef;<br/>&gt; is_deeply ($av, $attr{$attr}, &quot;attr $attr&quot;);<br/>&gt; }<br/>&gt; }<br/>&gt; <br/>&gt; <br/><br/>Martin<br/>-- <br/>Martin J. Evans<br/>Easysoft Limited<br/>http://www.easysoft.com<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/10/msg5502.html Fri, 10 Oct 2008 09:06:03 +0000 Re: Help sought with definition and implementation of ParamTypesattribute by H.Merijn Brand On Fri, 10 Oct 2008 16:19:20 +0100, Martin Evans<br/>&lt;martin.evans@easysoft.com&gt; wrote:<br/><br/>&gt; Hi,<br/>&gt; <br/>&gt; The DBI specification for ParamTypes taken from the DBI pod says the <br/>&gt; following for ParamTypes:<br/>&gt; <br/>&gt; Returns a reference to a hash containing the type information currently <br/>&gt; bound to placeholders. The keys of the hash are the &rsquo;names&rsquo; of the <br/>&gt; placeholders: either integers starting at 1, or, for drivers that <br/>&gt; support named placeholders, the actual parameter name string. The hash <br/>&gt; values are hashrefs of type information in the same form as that <br/>&gt; provided to the various bind_param() methods (See &quot;bind_param&quot; for the <br/>&gt; format and values), plus anything else that was passed as the third <br/>&gt; argument to bind_param(). Returns undef if not supported by the driver.<br/>&gt; <br/>&gt; I&#39;m not sure why the values of the keys are hash references unless<br/><br/>because if only the numeric values were supported, it would have been a<br/>list, not a hash, but when placeholder names come in sight, a list<br/>would not do<br/><br/>$sth = $dbh-&gt;prepare (&quot;select * from xx where xs between ? and ? or xc = ?&quot;);<br/>$sth-&gt;execute (4, 7, &quot;0&quot;);<br/><br/> ParamValues =&gt; { 1 =&gt; 4, 2 =&gt; 7, 3 =&gt; &quot;0&quot; },<br/> ParamTypes =&gt; { 1 =&gt; 5, 2 =&gt; 5, 3 =&gt; 1 },<br/><br/>If param names are supported, that might look like<br/><br/> ParamValues =&gt; { foo =&gt; 4, bar =&gt; 7, baz =&gt; &quot;0&quot; },<br/> ParamTypes =&gt; { foo =&gt; 5, bar =&gt; 5, baz =&gt; 1 },<br/><br/>&gt; multiple values are to be stored. If multiple values per key are stored <br/>&gt; what are they typically? I can only find one DBD which implements <br/>&gt; ParamTypes (DBD::Pg) and unless I am mistaken it sets the values of the <br/><br/>I implemented it in DBD::Unify as of 0.75 in a bigger patch to<br/>implement as much as possible of the DBI defenition:<br/><br/>*** Release 0.75 - Tue 23 Sep 2008 &lt;h.m.brand@xs4all.nl&gt;<br/><br/> - Three-level dbd_verbose and documentation<br/> - $ENV{DBD_TRACE} sets $dbh-&gt;{dbd_verbose} on/before connect<br/> - New tests for $h-&gt;trace (...) and $h-&gt;{dbd_verbose}<br/> - Added type_info_all (), get_info (), and parse_trace_flag ()<br/> - Note that identifiers are now quoted<br/> - Override quote_identifier () (UNIFY has no CATALOGS)<br/> - Accept 2-arg and 3-arg -&gt;do ()<br/> - Accept %attr to -&gt;prepare ()<br/> - Raised all verbose levels by 1. 1 and 2 are now DBI only<br/> - Removed 05-reauth.t<br/> - NULLABLE now always 2, as it doesn&#39;t work<br/> - Implemented CursorName sth attribute<br/> - Implemented ParamValues sth attribute<br/> - Implemented ParamTypes sth attribute<br/> - Implemented RowsInCache sth attribute (always 0)<br/> - Tested with Unify 6.3AB on HP-UX 10.20 with perl 5.8.8<br/> - Tested with Unify 8.2BC on HP-UX 11.00 with perl 5.8.8<br/> - Tested with Unify 8.3I on HP-UX 11.23 with perl 5.10.0<br/> - Tested with Unify 8.3K on AIX 5.2.0.0 with perl 5.8.8<br/> Tests will fail on older perls, as the test cases use scalarIO<br/><br/>&gt; keys to a scalar value - the type of the parameter.<br/><br/>in dbd_st_FETCH_aatrib ()<br/><br/> if (kl == 10 &amp;&amp; strEQ (key, &quot;ParamTypes&quot;)) {<br/> HV *hv = newHV ();<br/> retsv = newRV (sv_2mortal ((SV *)hv));<br/> while (--p &gt;= 0) {<br/> char key[8];<br/> sprintf (key, &quot;%d&quot;, p + 1);<br/> hv_store (hv, key, strlen (key), newSViv (imp_sth-&gt;prm[p].ftp), 0);<br/> }<br/> }<br/><br/>&gt; Reason I&#39;m asking is it is on my to do list for DBD::ODBC.<br/><br/>The test case in t/20-uni-basic.t now looks like<br/><br/>ok ($sth = $dbh-&gt;prepare (&quot;select * from xx where xs between ? and ? or xc = ?&quot;), &quot;sel prepare&quot;);<br/>ok ($sth-&gt;execute (4, 7, &quot;0&quot;), &quot;execute&quot;);<br/>ok (1, &quot;-- Check the internals&quot;);<br/>{ my %attr = ( # $sth attributes as documented in DBI-1.607<br/> NAME =&gt; [qw( xs xl xc xf xr xa xh xT xd xe )],<br/> NAME_lc =&gt; [qw( xs xl xc xf xr xa xh xt xd xe )],<br/> NAME_uc =&gt; [qw( XS XL XC XF XR XA XH XT XD XE )],<br/> NAME_hash =&gt; {qw( xs 0 xl 1 xc 2 xf 3 xr 4 xa 5 xh 6 xT 7 xd 8 xe 9 )},<br/> NAME_lc_hash =&gt; {qw( xs 0 xl 1 xc 2 xf 3 xr 4 xa 5 xh 6 xt 7 xd 8 xe 9 )},<br/> NAME_uc_hash =&gt; {qw( XS 0 XL 1 XC 2 XF 3 XR 4 XA 5 XH 6 XT 7 XD 8 XE 9 )},<br/> uni_types =&gt; [ 5, 2, 1, 8, 7, -4, -6, -7, -3, -11],<br/> TYPE =&gt; [ 5, 2, 1, 8, 7, 6, 7, 10, 9, 11],<br/> PRECISION =&gt; [ 4, 9, 5, 64, 32, 9, 15, 0, 0, 0],<br/> SCALE =&gt; [ 0, 0, 0, 0, 0, 2, 2, 0, 0, 0],<br/># NULLABLE =&gt; [ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1], # Does not work in Unify (yet)<br/> NULLABLE =&gt; [ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2],<br/> CursorName =&gt; &quot;c_sql_00_000001&quot;,<br/> NUM_OF_FIELDS =&gt; 10,<br/> NUM_OF_PARAMS =&gt; 3,<br/> Database =&gt; $dbh,<br/> ParamValues =&gt; { 1 =&gt; 4, 2 =&gt; 7, 3 =&gt; &quot;0&quot; },<br/> ParamTypes =&gt; { 1 =&gt; 5, 2 =&gt; 5, 3 =&gt; 1 },<br/> ParamArrays =&gt; undef, # NYI<br/> RowsInCache =&gt; 0,<br/> );<br/> foreach my $attr (sort keys %attr) {<br/> #printf STDERR &quot;\n%-20s %s\n&quot;, $attr, &quot;@{$sth-&gt;{$attr}}&quot;;<br/> my $av = exists $sth-&gt;{$attr} ? $sth-&gt;{$attr} : undef;<br/> is_deeply ($av, $attr{$attr}, &quot;attr $attr&quot;);<br/> }<br/> }<br/><br/><br/>-- <br/>H.Merijn Brand Amsterdam Perl Mongers http://amsterdam.pm.org/<br/>using &amp; porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,<br/>11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.<br/>http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/<br/>http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/10/msg5501.html Fri, 10 Oct 2008 08:49:37 +0000 Help sought with definition and implementation of ParamTypes attribute by Martin Evans Hi,<br/><br/>The DBI specification for ParamTypes taken from the DBI pod says the <br/>following for ParamTypes:<br/><br/>Returns a reference to a hash containing the type information currently <br/>bound to placeholders. The keys of the hash are the &rsquo;names&rsquo; of the <br/>placeholders: either integers starting at 1, or, for drivers that <br/>support named placeholders, the actual parameter name string. The hash <br/>values are hashrefs of type information in the same form as that <br/>provided to the various bind_param() methods (See &quot;bind_param&quot; for the <br/>format and values), plus anything else that was passed as the third <br/>argument to bind_param(). Returns undef if not supported by the driver.<br/><br/>I&#39;m not sure why the values of the keys are hash references unless <br/>multiple values are to be stored. If multiple values per key are stored <br/>what are they typically? I can only find one DBD which implements <br/>ParamTypes (DBD::Pg) and unless I am mistaken it sets the values of the <br/>keys to a scalar value - the type of the parameter.<br/><br/>Reason I&#39;m asking is it is on my to do list for DBD::ODBC.<br/><br/>Martin<br/>-- <br/>Martin J. Evans<br/>Easysoft Limited<br/>http://www.easysoft.com<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/10/msg5500.html Fri, 10 Oct 2008 08:20:17 +0000 RE: Bug in DBD::Oracle handling LOB columns and synonyms? by mirko.kraft Hi John,<br/>the issue pops up again and I see there is a new Bug Id #38267 for the<br/>same issue. Since I saw no reply to that last bug entry, I browsed<br/>through 1.22 oci8.c code and found the following snippet in function<br/>init_lob_refetch:<br/><br/>...<br/>OCIAttrGet_log_stat(parmhp, OCI_DTYPE_PARAM,<br/> &amp;syn_schema, &amp;syn_schema_len, OCI_ATTR_SCHEMA_NAME,<br/>errhp, status);<br/>OCIAttrGet_log_stat(parmhp, OCI_DTYPE_PARAM,<br/> &amp;syn_name, &amp;syn_name_len, OCI_ATTR_OBJ_NAME, errhp,<br/>status);<br/>...<br/>strcpy(new_tablename,syn_schema);<br/>...<br/><br/>Second OCIAttrGet is obsolete. OCI_ATTR_OBJ_NAME is not defined for<br/>synonym description and should be removed.<br/><br/>The strcpy will fail to produce correct results under certain<br/>circumstances, because for OCI_ATTR_SCHEMA_NAME Oracle doesn&#39;t guarantee<br/>a &#39;\0&#39; terminated string (see<br/>http://download.oracle.com/docs/cd/B14117_01/appdev.101/b10779/oci06des.<br/>htm#446652). So this should actually be<br/><br/>strncpy(new_tablename,syn_schema,syn_schema_len);<br/><br/>And I still have a problem with<br/><br/>char new_tablename[100];<br/><br/>being defined in the if-block, because the memory is referenced outside,<br/>and due to current implementation may be overwritten. I still think this<br/>chunk of memory has to be allocated on function block level. Just my<br/>0.02$ ;-)<br/><br/>Having made all this changes, I&#39;m now no longer experiencing any<br/>problems with any kind of LOBs.<br/><br/>Thanks for looking into this,<br/><br/> Mirko<br/><br/><br/><br/>-----Original Message-----<br/>From: Kraft, Mirko <br/>Sent: Mittwoch, 21. Mai 2008 12:26<br/>To: &#39;scoles@pythian.com&#39;<br/>Cc: dbi-dev@perl.org; &#39;bug-DBD-Oracle@rt.cpan.org&#39;<br/>Subject: RE: Bug in DBD::Oracle handling LOB columns and synonyms?<br/><br/>Hi John,<br/>the Web interface doesn&#39;t work for me, so I cc this to bug-DBD-Oracle<br/>[at] rt.cpan.org which should also be ok.<br/><br/>I attached a diff -c on oci8.c from 1.21 which I think fixes the issue<br/>(not tested currently, however):<br/><br/>*** oci8.c.ori Wed May 21 12:09:48 2008<br/>--- oci8.c Wed May 21 12:16:08 2008<br/>***************<br/>*** 2811,2816 ****<br/>--- 2811,2819 ----<br/> lob_refetch_t *lr = NULL;<br/> STRLEN tablename_len;<br/> char *tablename;<br/>+ #ifdef OCI_ATTR_OBJ_NAME /* not in 8.0.x */<br/>+ char new_tablename[100];<br/>+ #endif /* OCI_ATTR_OBJ_NAME */<br/> <br/> switch (imp_sth-&gt;stmt_type) {<br/> case OCI_STMT_UPDATE:<br/>***************<br/>*** 2834,2850 ****<br/> OCIDescribeAny_log_stat(imp_sth-&gt;svchp, errhp, tablename,<br/>strlen(tablename),<br/> (ub1)OCI_OTYPE_NAME, (ub1)1, (ub1)OCI_PTYPE_SYN, dschp,<br/>status);<br/> if (status == OCI_SUCCESS) { /* There is a synonym, get the schema<br/>*/<br/>- char new_tablename[100];<br/> char *syn_schema=NULL, *syn_name=NULL;<br/> OCIAttrGet_log_stat(dschp, OCI_HTYPE_DESCRIBE,<br/> &amp;parmhp, 0, OCI_ATTR_PARAM, errhp,<br/>status);<br/> OCIAttrGet_log_stat(parmhp, OCI_DTYPE_PARAM,<br/>! &amp;syn_schema, 0, OCI_ATTR_SCHEMA_NAME, errhp,<br/>status);<br/> OCIAttrGet_log_stat(parmhp, OCI_DTYPE_PARAM,<br/>! &amp;syn_name, 0, OCI_ATTR_OBJ_NAME, errhp,<br/>status);<br/>! strcpy(new_tablename, syn_schema);<br/>! strcat(new_tablename, &quot;.&quot;);<br/>! strcat(new_tablename, syn_name);<br/> tablename=new_tablename;<br/> if (DBIS-&gt;debug &gt;= 3)<br/> PerlIO_printf(DBILOGFP, &quot; lob refetch synonym, schema=%s,<br/>name=%s, new tablename=%s\n&quot;, syn_schema, syn_name, tablename);<br/>--- 2837,2853 ----<br/> OCIDescribeAny_log_stat(imp_sth-&gt;svchp, errhp, tablename,<br/>strlen(tablename),<br/> (ub1)OCI_OTYPE_NAME, (ub1)1, (ub1)OCI_PTYPE_SYN, dschp,<br/>status);<br/> if (status == OCI_SUCCESS) { /* There is a synonym, get the schema<br/>*/<br/> char *syn_schema=NULL, *syn_name=NULL;<br/>+ ub4 syn_schema_len = 0, syn_name_len = 0;<br/> OCIAttrGet_log_stat(dschp, OCI_HTYPE_DESCRIBE,<br/> &amp;parmhp, 0, OCI_ATTR_PARAM, errhp,<br/>status);<br/> OCIAttrGet_log_stat(parmhp, OCI_DTYPE_PARAM,<br/>! &amp;syn_schema, &amp;syn_schema_len,<br/>OCI_ATTR_SCHEMA_NAME, errhp, status);<br/> OCIAttrGet_log_stat(parmhp, OCI_DTYPE_PARAM,<br/>! &amp;syn_name, &amp;syn_name_len, OCI_ATTR_OBJ_NAME,<br/>errhp, status);<br/>! strncpy(new_tablename, syn_schema, syn_schema_len);<br/>! strcat (new_tablename, &quot;.&quot;);<br/>! strncat(new_tablename, syn_name, syn_name_len);<br/> tablename=new_tablename;<br/> if (DBIS-&gt;debug &gt;= 3)<br/> PerlIO_printf(DBILOGFP, &quot; lob refetch synonym, schema=%s,<br/>name=%s, new tablename=%s\n&quot;, syn_schema, syn_name, tablename);<br/><br/>Thanks for looking into the issue,<br/><br/> Mirko<br/><br/><br/><br/>-----Original Message-----<br/>From: scoles@pythian.com [mailto:scoles@pythian.com] <br/>Sent: Dienstag, 20. Mai 2008 23:03<br/>To: Kraft, Mirko<br/>Cc: dbi-dev@perl.org<br/>Subject: Re: Bug in DBD::Oracle handling LOB columns and synonyms?<br/><br/>Ok I will have a look at it and you are right the code does not look<br/>quite<br/>right.<br/><br/>Do you think you can raise a ticket for this at<br/>http://rt.cpan.org/Public/Dist/Display.html?Status=Active&amp;Name=DBD-Oracl<br/>e<br/><br/>that way I can track it better.<br/><br/>You do not happen to know what the orginal starting line number was in<br/>oci8?<br/><br/>cheers John SColes<br/><br/><br/>&gt; Hi *,<br/>&gt; I&#39;m using DBD::Oracle (code checked onCPAN and verified in version<br/>1.21)<br/>&gt; and encountered a problem (DB is Oracle 10gR2) related to LOBs and<br/>&gt; synonyms:<br/>&gt;<br/>&gt; Table TTHUMBNAIL (DOCUMENT_ID NUMBER(12), THUMBNAIL BLOB NOT NULL) is<br/>&gt; owned by user DMSSGADM. User DMSSGDP has a synonym TTHUMBNAIL on the<br/>table<br/>&gt; and all necessary rights granted.<br/>&gt;<br/>&gt; When executing the following code<br/>&gt;<br/>&gt; $sthInsertTTHUMBNAIL = prepareStatement($dbh,<br/>&gt; &#39;INSERT &#39; .<br/>&gt; &#39;INTO tthumbnail &#39; .<br/>&gt; &#39; (document_id, &#39; .<br/>&gt; &#39; thumbnail) &#39; .<br/>&gt; &#39;VALUES<br/>(document_id_seq.CURRVAL,<br/>&gt; &#39; .<br/>&gt; &#39; ?)&#39;);<br/>&gt; $sthInsertTTHUMBNAIL-&gt;bind_param(1, $thumbnail, { ora_type =&gt; ORA_BLOB<br/>});<br/>&gt; $sthInsertTTHUMBNAIL-&gt;execute();<br/>&gt;<br/>&gt; I get the following error:<br/>&gt;<br/>&gt; ORA-04043: object DMSSGADMTTHUMBNAIL.TTHUMBNAIL does not exist (DBD<br/>&gt; SUCCESS: OCIDescribeAny(view)/LOB refetch)<br/>&gt;<br/>&gt; Currently I tracked down the error to the following place in oci8.c,<br/>but<br/>&gt; since I got no compiler here, I can&#39;t verify further:<br/>&gt;<br/>&gt; 01 #ifdef OCI_ATTR_OBJ_NAME /* not in 8.0.x */<br/>&gt; 02 OCIDescribeAny_log_stat(imp_sth-&gt;svchp, errhp, tablename,<br/>&gt; strlen(tablename),<br/>&gt; 03 (ub1)OCI_OTYPE_NAME, (ub1)1, (ub1)OCI_PTYPE_SYN, dschp,<br/>status);<br/>&gt; 04 if (status == OCI_SUCCESS) { /* There is a synonym, get the<br/>schema<br/>&gt; */<br/>&gt; 05 char new_tablename[100];<br/>&gt; 06 char *syn_schema=NULL, *syn_name=NULL;<br/>&gt; 07 OCIAttrGet_log_stat(dschp, OCI_HTYPE_DESCRIBE,<br/>&gt; 08 &amp;parmhp, 0, OCI_ATTR_PARAM, errhp,<br/>status);<br/>&gt; 09 OCIAttrGet_log_stat(parmhp, OCI_DTYPE_PARAM,<br/>&gt; 10 &amp;syn_schema, 0, OCI_ATTR_SCHEMA_NAME, errhp,<br/>status);<br/>&gt; 11 OCIAttrGet_log_stat(parmhp, OCI_DTYPE_PARAM,<br/>&gt; 12 &amp;syn_name, 0, OCI_ATTR_OBJ_NAME, errhp,<br/>status);<br/>&gt; 13 strcpy(new_tablename, syn_schema);<br/>&gt; 14 strcat(new_tablename, &quot;.&quot;);<br/>&gt; 15 strcat(new_tablename, syn_name);<br/>&gt; 16 tablenameew_tablename;<br/>&gt; 17 if (DBIS-&gt;debug &gt;= 3)<br/>&gt; 18 PerlIO_printf(DBILOGFP, &quot; lob refetch synonym, schema=%s,<br/>&gt; name=%s, new tablename=%s\n&quot;, syn_schema, syn_name, tablename);<br/>&gt; 19 }<br/>&gt; 20 #endif /* OCI_ATTR_OBJ_NAME */<br/>&gt;<br/>&gt; First, lines 05 &amp; 16 constitute a very bad situation, since the<br/>pointer<br/>&gt; refers to a stack variable that is freed when the block is closed :-(<br/>So<br/>&gt; this buffer should be declared outside the block, anyway...<br/>&gt;<br/>&gt; And from what I know about OCIAttrGet, if you retrieve a text<br/>attribute,<br/>&gt; you have to pass a pointer to receive the length of the string, as it<br/>is<br/>&gt; not &#39;\0&#39; terminated! After that you would call something like<br/>&gt;<br/>&gt; strncpy(new_tablename, syn_schema, syn_schema_length);<br/>&gt; strcpy (new_tablename, &quot;.&quot;);<br/>&gt; strncpy(new_tablename, syn_name, syn_name_length);<br/>&gt;<br/>&gt; I&#39;m looking forward to hearing from you about the issue, since I&#39;m<br/>really<br/>&gt; stuck on the topic.<br/>&gt;<br/>&gt; Sincerely,<br/>&gt;<br/>&gt; Mirko Kraft<br/>&gt;<br/>&gt; UBS AG<br/>&gt; Global Wealth Management &amp; Business Banking<br/>&gt; Information Technology<br/>&gt; eRMS - electronic Records Management Solutions<br/>&gt; Viaduktstr. 31-35, PO Box 4473, CH-4051 Basel<br/>&gt; Tel. +41-61-288 53 72<br/>&gt; Fax +41-61-288 71 91<br/>&gt; www.ubs.com<br/>&gt;<br/>&gt; Based on previous e-mail correspondence with you and/or an agreement<br/>&gt; reached with you, UBS considers itself authorized to contact you via<br/>&gt; unsecured e-mail.<br/>&gt; Warning:<br/>&gt; (a) E-mails can involve SUBSTANTIAL RISKS, e.g. lack of<br/>confidentiality,<br/>&gt; potential manipulation of contents and/or sender&#39;s address, incorrect<br/>&gt; recipient (misdirection), viruses etc. UBS assumes no responsibility<br/>for<br/>&gt; any loss or damage resulting from the use of e-mails. UBS recommends<br/>in<br/>&gt; particular that you do NOT SEND ANY SENSITIVE INFORMATION, that you do<br/>not<br/>&gt; include details of the previous message in any reply, and that you<br/>enter<br/>&gt; e-mail address(es) manually every time you write an e-mail.<br/>&gt; (b) As a matter of principle, UBS does NOT accept any ORDERS,<br/>revocations<br/>&gt; of orders or authorizations, blocking of credit cards, etc., sent by<br/>&gt; e-mail. Should such an e-mail nevertheless be received, UBS is not<br/>obliged<br/>&gt; to act on or respond to the e-mail.<br/>&gt; Please notify UBS immediately if you received this e-mail by mistake<br/>or if<br/>&gt; you do not wish to receive any further e-mail correspondence. If you<br/>have<br/>&gt; received this e-mail by mistake, please completely delete it (and any<br/>&gt; attachments) and do not forward it or inform any other person of its<br/>&gt; contents.<br/>&gt;<br/>&gt;<br/>&gt;<br/><br/><br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/10/msg5499.html Thu, 02 Oct 2008 01:33:50 +0000 Re: Volunteers sought to help with or take over Oracle::OCI by Tim Bunce <br/>On Sat, Sep 20, 2008 at 02:55:33PM -0400, Jeff Macdonald wrote:<br/>&gt; On Mon, Jul 21, 2008 at 3:51 PM, Tim Bunce &lt;Tim.Bunce@pobox.com&gt; wrote:<br/>&gt; &gt;&gt; On Mon, Jul 21, 2008 at 5:23 PM, John Scoles &lt;scoles@pythian.com&gt; wrote:<br/>&gt; &gt;&gt;<br/>&gt; &gt;&gt; &gt; I suppose I could take it over as I am doing DBD::Oracle as well.<br/>&gt; &gt;<br/>&gt; &gt; Meanwhile, I&#39;ll move the code to a public repository.<br/>&gt; <br/>&gt; Any progress with this? Where is the public repository?<br/><br/>I can&#39;t find my local copy any more. I&#39;m sure the version on CPAN<br/>is complete (http://search.cpan.org/~timb/Oracle-OCI-0.06/)<br/>so feel free to host it anywhere you like (github, google code, etc).<br/><br/>Tim.<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5498.html Mon, 22 Sep 2008 04:39:14 +0000 Re: enhancement: DBD::Oracle and OCI_ATTR_STMT_TYPE by John Scoles Well would not be hard to do as we already have<br/><br/>char *<br/>oci_stmt_type_name(int stmt_type)<br/>{<br/>dTHX;<br/>SV *sv;<br/>switch (stmt_type) {<br/>case OCI_STMT_SELECT: return &quot;SELECT&quot;;<br/>case OCI_STMT_UPDATE: return &quot;UPDATE&quot;;<br/>case OCI_STMT_DELETE: return &quot;DELETE&quot;;<br/>case OCI_STMT_INSERT: return &quot;INSERT&quot;;<br/>case OCI_STMT_CREATE: return &quot;CREATE&quot;;<br/>case OCI_STMT_DROP: return &quot;DROP&quot;;<br/>case OCI_STMT_ALTER: return &quot;ALTER&quot;;<br/>case OCI_STMT_BEGIN: return &quot;BEGIN&quot;;<br/>case OCI_STMT_DECLARE: return &quot;DECLARE&quot;;<br/>}<br/>sv = sv_2mortal(newSVpv(&quot;&quot;,0));<br/>sv_grow(sv, 50);<br/>sprintf(SvPVX(sv),&quot;(STMT TYPE %d)&quot;, stmt_type);<br/>return SvPVX(sv);<br/>}<br/><br/>function internally in OCI8.c, I guess I could add it to the XS and get <br/>it into Perl. just need a name for it though. dbd_stmt_type_name? or in <br/>this case ora_stmt_type_name??<br/><br/><br/><br/>Norbert Debes wrote:<br/>&gt; Hi,<br/>&gt;<br/>&gt; I&#39;m an enthusiastic user of Perl DBI and DBD::Oracle. Thanks to Tim <br/>&gt; Bunce and all the others who help maintain it!<br/>&gt;<br/>&gt; I wrote a sort of SQL*Plus replacement called DBB which runs arbitrary <br/>&gt; SQL statements and prints SELECT output with automatic column sizing <br/>&gt; (readable instantly without any COLUMN x FORMAT), because I&#39;m always <br/>&gt; annoyed that SQL*Plus can&#39;t format it&#39;s output in a readable way. It <br/>&gt; would be cool to have OCI_ATTR_STMT_TYPE available from DBD::Oracle. <br/>&gt; Then I could provide feedback such as &quot;ALTER Statement executed&quot;. <br/>&gt; Currently there seems to be now way to find out what type of statement <br/>&gt; was executed (i.e. ALTER, DELETE, INSERT).<br/>&gt;<br/>&gt; DBB is included with my book &quot;Secret ORACLE&quot; which also has an intro <br/>&gt; to DBI and DBD::Oracle: http://www.oradbpro.com/publications.html<br/>&gt;<br/>&gt; Here&#39;s a quote from OCI doc:<br/>&gt; Table 4&ndash;1 OCI_ATTR_STMT_TYPE Values and Statement Types<br/>&gt; Attribute Value Statement Type<br/>&gt; OCI_STMT_SELECT SELECT statement<br/>&gt; OCI_STMT_UPDATE UPDATE statement<br/>&gt; OCI_STMT_DELETE DELETE statement<br/>&gt; OCI_STMT_INSERT INSERT statement<br/>&gt; OCI_STMT_CREATE CREATE statement<br/>&gt; OCI_STMT_DROP DROP statement<br/>&gt; OCI_STMT_ALTER ALTER statement<br/>&gt; OCI_STMT_BEGIN BEGIN... (PL/SQL)<br/>&gt; OCI_STMT_DECLARE DECLARE... (PL/SQL)<br/>&gt; -- <br/>&gt; Kind regards<br/>&gt;<br/>&gt; Norbert Debes<br/>&gt;<br/>&gt; ORADBPRO Consulting Services &lt;http://www.oradbpro.com&gt;<br/>&gt; http://www.oradbpro.com<br/>&gt; GSM: +49 177 6895186<br/>&gt; Fax: +49 1212 536735037<br/>&gt; SMTP: norbert.debes@oradbpro.com &lt;mailto:norbert.debes@oradbpro.com&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5497.html Mon, 22 Sep 2008 03:58:21 +0000 enhancement: DBD::Oracle and OCI_ATTR_STMT_TYPE by Norbert Debes <br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5496.html Sun, 21 Sep 2008 10:21:58 +0000 Re: Volunteers sought to help with or take over Oracle::OCI by Jeff Macdonald On Mon, Jul 21, 2008 at 3:51 PM, Tim Bunce &lt;Tim.Bunce@pobox.com&gt; wrote:<br/>&gt;&gt; On Mon, Jul 21, 2008 at 5:23 PM, John Scoles &lt;scoles@pythian.com&gt; wrote:<br/>&gt;&gt;<br/>&gt;&gt; &gt; I suppose I could take it over as I am doing DBD::Oracle as well.<br/>&gt;<br/>&gt; Meanwhile, I&#39;ll move the code to a public repository.<br/><br/>Any progress with this? Where is the public repository?<br/><br/><br/>-- <br/>Jeff Macdonald<br/>Ayer, MA<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5495.html Sat, 20 Sep 2008 11:55:41 +0000 Re: DBD::File missing f_ext by H.Merijn Brand On Thu, 18 Sep 2008 10:59:52 -0700, Jeff Zucker &lt;jeff@vpservices.com&gt;<br/>wrote:<br/><br/>&gt; H.Merijn Brand wrote:<br/>&gt; &gt; Attached patch implements the following:<br/>&gt; &gt;<br/>&gt; &gt; f_dir =&gt; &quot;/data/csv/foo&quot;,<br/>&gt; &gt; f_ext =&gt; &quot;.csv&quot;,<br/>&gt; &gt; f_ext =&gt; &quot;.csv/i&quot;, # Case ignore on extension, use given on write<br/>&gt; &gt; f_ext =&gt; &quot;.csv/r&quot;, # Extension is required, ignore other files in<br/>&gt; &gt; f_ext =&gt; &quot;.csv/ri&quot;, # f_dir. Options can be combined<br/>&gt;<br/>&gt; I find that overly complicated, doesn&#39;t solve much, and could be done <br/>&gt; easily with a single loop statement in Perl. The case stuff I would <br/><br/>The reason I did the /r is that in my case I actually had &quot;aard&quot; and<br/>&quot;aard.csv&quot; and only the latter contained database data<br/><br/>I implemeted /i, because it wasn&#39;t too hard to imagine people sending<br/>in zip files with AARD.CSV, and I don&#39;t want my script to care.<br/><br/>&gt; find particularly confusing since f_dir and file names (not table names) <br/>&gt; will need to remain case sensitive on *nix regardless of what you do <br/>&gt; with the sensitivity of the extension - SQL table names must remain <br/>&gt; insensitive in all cases so this method of treating a filename as a<br/><br/>That is a good reason to drop the /i support, and make /i default<br/><br/>&gt; tablename would make the entire situation quite confusing. The reason I <br/>&gt; say it doesn&#39;t solve much is that it only really works if you have a <br/>&gt; single CSV format (e.g. if you have files that use a semi-colon eol<br/><br/>semi-colon eol&#39;s will be the odd-one-out<br/><br/>&gt; you&#39;ll need to specify them with $dbh-&gt;{csv_tables} attribute anyway. <br/>&gt; Also it doesn&#39;t solve the issue of finding a list of tables - a fuller <br/>&gt; patch would connect the specifiying of f_dir and f_ext with the <br/>&gt; $dbh-&gt;tables () method. I guess my main approach is that filenames and <br/>&gt; tablenames are two different things and that this patch obscures that <br/><br/>Entirely my POV, which is why I use $h-&gt;{f_map} internally to map table<br/>names to file names<br/><br/>&gt; whereas most users will be better off by realizing that they are better <br/>&gt; off making an explicit association between file names and table names <br/><br/>Ahhhhrg, no. I have data directories with 400 csv files. You don&#39;t<br/>think I would like to specify all of those. f_dir=dta;f_ext=.csv really<br/>made my life very easy there<br/><br/>&gt; with $dbh-&gt;{csv_tables}-&gt;{file}. So, let me think about this patch, I&#39;m <br/>&gt; not ready to decide today. I will definitely apply your previous <br/>&gt; patches from rt, thanks for those.<br/><br/>\o/<br/><br/>The reasoning to push this is that we have customers who can easily<br/>dump their data like this, but getting their data in a database format<br/>they use themselves takes ages. Different version of Oracle or OS make<br/>life hard. And analyzing some data from CSV files for a one-shot action<br/>is much much faster that trying to recreate a complete database with<br/>those values. (OK, Postgress goes rather fast, but Oracle is a PITA)<br/><br/>&gt; TIM or others - what do you think?<br/>&gt; <br/>&gt; Also, thanks for your offer to take over DBD:CSV. I may sometime take <br/>&gt; you up on that but am not ready yet, I&#39;d prefer to keep it as long as I <br/>&gt; have DBD::File, DBD::AnyData, and SQL::Statement since they are all so <br/>&gt; intimately related. Is there a way we can be co-maintainers? Can I <br/>&gt; give you PAUSE uploading rights so that you could directly upload <br/>&gt; patches we both agree are good changes?<br/>&gt; <br/>&gt; Thanks for your improvements to the module.<br/><br/>-- <br/>H.Merijn Brand Amsterdam Perl Mongers http://amsterdam.pm.org/<br/>using &amp; porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,<br/>11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.<br/>http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/<br/>http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5494.html Thu, 18 Sep 2008 12:12:30 +0000 Re: DBD::File missing f_ext by Jeff Zucker H.Merijn Brand wrote:<br/>&gt; Attached patch implements the following:<br/>&gt;<br/>&gt; f_dir =&gt; &quot;/data/csv/foo&quot;,<br/>&gt; f_ext =&gt; &quot;.csv&quot;,<br/>&gt; f_ext =&gt; &quot;.csv/i&quot;, # Case ignore on extension, use given on write<br/>&gt; f_ext =&gt; &quot;.csv/r&quot;, # Extension is required, ignore other files in<br/>&gt; f_ext =&gt; &quot;.csv/ri&quot;, # f_dir. Options can be combined<br/>&gt;<br/>&gt; <br/>I find that overly complicated, doesn&#39;t solve much, and could be done <br/>easily with a single loop statement in Perl. The case stuff I would <br/>find particularly confusing since f_dir and file names (not table names) <br/>will need to remain case sensitive on *nix regardless of what you do <br/>with the sensitivity of the extension - SQL table names must remain <br/>insensitive in all cases so this method of treating a filename as a <br/>tablename would make the entire situation quite confusing. The reason I <br/>say it doesn&#39;t solve much is that it only really works if you have a <br/>single CSV format (e.g. if you have files that use a semi-colon eol <br/>you&#39;ll need to specify them with $dbh-&gt;{csv_tables} attribute anyway. <br/>Also it doesn&#39;t solve the issue of finding a list of tables - a fuller <br/>patch would connect the specifiying of f_dir and f_ext with the <br/>$dbh-&gt;tables() method. I guess my main approach is that filenames and <br/>tablenames are two different things and that this patch obscures that <br/>whereas most users will be better off by realizing that they are better <br/>off making an explicit association between file names and table names <br/>with $dbh-&gt;{csv_tables}-&gt;{file}. So, let me think about this patch, I&#39;m <br/>not ready to decide today. I will definitely apply your previous <br/>patches from rt, thanks for those.<br/><br/>TIM or others - what do you think?<br/><br/>Also, thanks for your offer to take over DBD:CSV. I may sometime take <br/>you up on that but am not ready yet, I&#39;d prefer to keep it as long as I <br/>have DBD::File, DBD::AnyData, and SQL::Statement since they are all so <br/>intimately related. Is there a way we can be co-maintainers? Can I <br/>give you PAUSE uploading rights so that you could directly upload <br/>patches we both agree are good changes?<br/><br/>Thanks for your improvements to the module.<br/><br/>-- <br/>Jeff<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5493.html Thu, 18 Sep 2008 11:00:00 +0000 Re: DBD::File missing f_ext by H.Merijn Brand On Tue, 16 Sep 2008 18:48:08 +0200, &quot;H.Merijn Brand&quot;<br/>&lt;h.m.brand@xs4all.nl&gt; wrote:<br/><br/>&gt; I have a big directory with a CSV dump of a directory.<br/><br/>Updates versions of DBD/File.pm and DBD/CSV.pm will be available while<br/>I dig through their restrictions as<br/><br/> http://www.xs4all.nl/~hmbrand/DBD::File.pm<br/> http://www.xs4all.nl/~hmbrand/DBD::CSV.pm<br/><br/>That also contains a fix for<br/><br/> print $sth-&gt;{TYPE}[0] // &quot;&quot;, &quot;\n&quot;;<br/> print $sth-&gt;{PRECISION}[0] // 10, &quot;\n&quot;;<br/><br/>-- <br/>H.Merijn Brand Amsterdam Perl Mongers http://amsterdam.pm.org/<br/>using &amp; porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,<br/>11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.<br/>http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/<br/>http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5492.html Thu, 18 Sep 2008 09:05:41 +0000 Re: DBD::File missing f_ext by H.Merijn Brand On Tue, 16 Sep 2008 18:48:08 +0200, &quot;H.Merijn Brand&quot;<br/>&lt;h.m.brand@xs4all.nl&gt; wrote:<br/><br/>&gt; Suggested implementation attached.<br/>&gt; TODO includes tests and file creation (which I didn&#39;t write yet)<br/><br/>Much more robust version here:<br/><br/> http://www.xs4all.nl/~hmbrand/File.pm<br/><br/><br/>-- <br/>H.Merijn Brand Amsterdam Perl Mongers http://amsterdam.pm.org/<br/>using &amp; porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,<br/>11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.<br/>http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/<br/>http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5491.html Tue, 16 Sep 2008 12:55:36 +0000 Re: DBD::File missing f_ext by H.Merijn Brand On Tue, 16 Sep 2008 18:48:08 +0200, &quot;H.Merijn Brand&quot;<br/>&lt;h.m.brand@xs4all.nl&gt; wrote:<br/><br/>&gt; Attached patch implements the following:<br/><br/>1. Patch still has a debug statement in it<br/>2. I&#39;ve tried hard to keep the original layout, but I might have failed<br/> there<br/><br/>-- <br/>H.Merijn Brand Amsterdam Perl Mongers http://amsterdam.pm.org/<br/>using &amp; porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,<br/>11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.<br/>http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/<br/>http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5490.html Tue, 16 Sep 2008 10:06:10 +0000 DBD::File missing f_ext by H.Merijn Brand I have a big directory with a CSV dump of a directory.<br/><br/>The folder has a lot of table dumps in CSV format (amongst a lot of<br/>other database related files) and all those files have a lovely<br/>recognizable extension: .csv<br/><br/>So I found it stupid from DBD::CSV to have a table.csv file and then<br/>forcing me to select from it using &quot;table.csv&quot; instead of &quot;table&quot;.<br/><br/>Having written some perl code in the past, how hard could it be to look<br/>for &quot;open&quot; and &quot;opendir&quot; and make it use &quot;table.csv&quot; if it exists, and<br/>if not, fall back to the default &quot;table&quot;.<br/><br/>Wrong. DBD::CSV is just a subclass of DBD::File, which does not support<br/>this. Dumb dumber dumbest.<br/><br/>I&#39;m sure Jeff wouldn&#39;t mind me taking over DBD::CSV if that were easy<br/>to fix, but it is not, so the changes in DBD::CSV are futile compared<br/>to the changes needed in DBD::File.<br/><br/>Attached patch implements the following:<br/><br/> f_dir =&gt; &quot;/data/csv/foo&quot;,<br/> f_ext =&gt; &quot;.csv&quot;,<br/> f_ext =&gt; &quot;.csv/i&quot;, # Case ignore on extension, use given on write<br/> f_ext =&gt; &quot;.csv/r&quot;, # Extension is required, ignore other files in<br/> f_ext =&gt; &quot;.csv/ri&quot;, # f_dir. Options can be combined<br/><br/>Suggested implementation attached.<br/>TODO includes tests and file creation (which I didn&#39;t write yet)<br/><br/> f_ext<br/> This attribute is used for setting the file extension where (CSV)<br/> files are opened. There are several possibilities.<br/><br/> DBI:CSV:f_dir=data;f_ext=.csv<br/><br/> In this case, DBD::File will open only &quot;table.csv&quot; if both<br/> &quot;table.csv&quot; and &quot;table&quot; exist in the datadir. The table will still<br/> be named &quot;table&quot;. If your datadir has files with extensions, and<br/> you do not pass this attribute, your table is named &quot;table.csv&quot;,<br/> which is probably not what you wanted.<br/><br/> DBI:CSV:f_dir=data;f_ext=.csv/i<br/><br/> Same as above, but file name matching is done case&#x2010;insensitive.<br/><br/> DBI:CSV:f_dir=data;f_ext=.csv/r<br/><br/> In this case the extension is required, and all filenames that do<br/> not match are ignored.<br/><br/> DBI:CSV:f_dir=data;f_ext=.csv/ri<br/><br/> Same as above, but file name matching is done case&#x2010;insensitive.<br/><br/><br/>I have tested that with DBD::CSV and<br/>$ENV{DBI_DSN} = &quot;DBI:CSV:f_dir=dta;f_ext=.csv&quot;<br/><br/><br/><br/>-- <br/>H.Merijn Brand Amsterdam Perl Mongers http://amsterdam.pm.org/<br/>using &amp; porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,<br/>11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.<br/>http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/<br/>http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/<br/><br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5489.html Tue, 16 Sep 2008 09:48:20 +0000 ANNOUNCE: IBM DB2 Database Driver for Perl DBI Version 1.2 released by Open Source Application Development IBM DB2 Database Driver for Perl DBI Version 1.2 has been uploaded on <br/>CPAN.<br/><br/>DBI is an open standard application programming interface (API) that <br/>provides database access for client applications written in Perl. DBI <br/>defines a set of functions, variables, and conventions that provide a <br/>platform-independent database interface.<br/>The DBD::DB2 driver works with DBI and a DB2 client to access databases.<br/><br/>**New In Release<br/>- Support for Trusted Context to create Trusted Connections.<br/>- Also please see the Changelog and README for Installation Caveats.<br/><br/>Download Link<br/>http://www.cpan.org/modules/by-category/07_Database_Interfaces/DBD/DBD-DB2-1.2.tar.gz<br/><br/>Installation Instructions<br/>http://www-306.ibm.com/software/data/db2/perl/<br/><br/>Support Email Addresses<br/><br/>* This release is supported by Open Source Application Development Team<br/>* You may also report your bugs via the CPAN resolution tracking system:<br/> http://rt.cpan.org/ by searching for module DBD-DB2<br/>* Such bug reports can be sent by email to bug-DBD-DB2@rt.cpan.org;<br/> they also get sent to opendev@us.ibm.com, etc.<br/><br/>Download DB2 Express-C for free, go to: <br/>http://www-01.ibm.com/software/data/db2/express/download.html?S_CMP=ECDDWW01&amp;S_TACT=ACDB201<br/><br/>Getting started with DB2 Express-C: <br/>http://www.ibm.com/developerworks/wikis/display/DB2/FREE+Book-+Getting+Started+with+DB2+Express-C<br/><br/><br/>Thanks,<br/>Tarun Pasrija<br/>IBM OpenSource Application Development Team<br/>India Software Labs, Bangalore (India)<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5488.html Mon, 15 Sep 2008 18:39:03 +0000 Perl/mod_perl/DBI: To thread, or not to thread by Patrick Galbraith Hi all,<br/><br/>I&#39;m currently working on... of all things, a book on book about web app <br/>programming with perl/apache/mysql, and I&#39;m trying to explain what <br/>Ubuntu packages to use for installation (and I&#39;m sure other Linux <br/>variants same applies)<br/><br/>Ubuntu gives you:<br/><br/>apache2-mpm-prefork<br/>apache2-prefork-dev<br/>apache2-mpm-worker<br/>apache2-threaded-dev <br/><br/>I&#39;ve used both prefork and worker (as of late, due to concerns with <br/>forking), both of which seem to work fine. Though, the DBI documentation <br/>warns of caveats of using threaded, especially if the client is not <br/>thread safe (I always compile mysql with a thread-safe client, and <br/>DBD::mysql against that thread safe client).<br/><br/>So... I&#39;m trying to decide if I should explain<br/><br/>1. There are issues with using threads - what all are they?<br/>2. What they should use- prefork or worker?<br/>3. What is the consensus?<br/>4. Is there a document available giving the pros and cons?<br/>5. What is the official state of Perl with regards to threading?<br/><br/>As an author, I&#39;m thinking I don&#39;t want to give advice, only inform.<br/><br/>Thanks for you inputs, advice, suggestions, etc.<br/><br/>-- <br/><br/>Satyam Eva Jayate - Truth Alone Triumphs<br/>Mundaka Upanishad<br/><br/><br/><br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5487.html Thu, 11 Sep 2008 18:07:18 +0000 Re: Considering an SQLite-specific CPAN Module by Tom Browder On Tue, Sep 9, 2008 at 9:15 PM, Darren Duncan &lt;darren@darrenduncan.net&gt; wrote:<br/>&gt; Another distribution, DBD::SQLite::Amalgamation is a quasi-fork of<br/>&gt; DBD::SQLite and is up to date with the almost latest SQLite sources; it also<br/>&gt; adds a few more features over the last DBD::SQLite which hasn&#39;t seen a<br/>&gt; release in over a year. You may want to consider submitting your changes to<br/>&gt; include in DBD::SQLite::Amalgamation if appropriate. -- Darren Duncan<br/><br/>Thanks, Darren.<br/><br/>Actually, I read the DBI module docs a little more closely and I think<br/>I see that most, if not all, of things I was thinking about are there!<br/><br/>-Tom<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5486.html Wed, 10 Sep 2008 02:46:14 +0000 Re: Considering an SQLite-specific CPAN Module by Darren Duncan Another distribution, DBD::SQLite::Amalgamation is a quasi-fork of <br/>DBD::SQLite and is up to date with the almost latest SQLite sources; it <br/>also adds a few more features over the last DBD::SQLite which hasn&#39;t seen a <br/>release in over a year. You may want to consider submitting your changes <br/>to include in DBD::SQLite::Amalgamation if appropriate. -- Darren Duncan<br/><br/>Tom Browder wrote:<br/>&gt; After looking at various modules for using SQLite, I&#39;ve not found<br/>&gt; exactly what I&#39;m looking for. I want a pm that is higher level than<br/>&gt; what I see in DBS::SQLite.<br/>&gt; <br/>&gt; I would like to see functions similar to what is available in<br/>&gt; Win32::DBIODBC or Win32::ODBC:<br/>&gt; <br/>&gt; TableList # list of tables in the db<br/>&gt; FieldNames<br/>&gt; ColAttributes<br/>&gt; <br/>&gt; etc.<br/>&gt; <br/>&gt; I have cobbled together a pm for my use but it might be useful to<br/>&gt; others and I would appreciate any opinions from this audience.<br/>&gt; <br/>&gt; Any comments are appreciated.<br/>&gt; <br/>&gt; -Tom<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5485.html Tue, 09 Sep 2008 19:16:06 +0000 Considering an SQLite-specific CPAN Module by Tom Browder After looking at various modules for using SQLite, I&#39;ve not found<br/>exactly what I&#39;m looking for. I want a pm that is higher level than<br/>what I see in DBS::SQLite.<br/><br/>I would like to see functions similar to what is available in<br/>Win32::DBIODBC or Win32::ODBC:<br/><br/> TableList # list of tables in the db<br/> FieldNames<br/> ColAttributes<br/><br/> etc.<br/><br/>I have cobbled together a pm for my use but it might be useful to<br/>others and I would appreciate any opinions from this audience.<br/><br/>Any comments are appreciated.<br/><br/>-Tom<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5484.html Tue, 09 Sep 2008 18:01:02 +0000 Re: (Fwd) noitify author of DBD::Oracle by John Scoles You can ignore it for now. It has nothing to do with the functionality <br/>of DBD::Oracle it is a CPAN file that I was mistakenly put into the <br/>manifest.<br/>cheers<br/>John Scoles<br/><br/>Tim Bunce wrote:<br/>&gt; ----- Forwarded message from Chuck Pareto &lt;cpareto@h5.com&gt; -----<br/>&gt;<br/>&gt; Subject: noitify author of DBD::Oracle<br/>&gt; Date: Wed, 27 Aug 2008 17:25:38 -0700<br/>&gt; From: Chuck Pareto &lt;cpareto@h5.com&gt;<br/>&gt; Priority: normal<br/>&gt; To: Tim.Bunce@pobox.com<br/>&gt; X-Pobox-Antispam: broadband/ returned deny<br/>&gt;<br/>&gt; Hi,<br/>&gt;<br/>&gt; After trying to run make with Strawberry Perl on DBD::Oracle, I received a message that says please<br/>&gt; contact author. The message is below. It says &quot;Warning: the following files are missing in your kit:<br/>&gt;<br/>&gt; META.yml&quot;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; Can you give any advice?<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; cpan&gt; make DBD::Oracle<br/>&gt;<br/>&gt; Database was generated on Wed, 27 Aug 2008 23:06:15 GMT<br/>&gt;<br/>&gt; Running make for module &#39;DBD::Oracle&#39;<br/>&gt;<br/>&gt; Running make for P/PY/PYTHIAN/DBD-Oracle-1.22.tar.gz<br/>&gt;<br/>&gt; Checksum for C:\strawberry\cpan\sources\authors\id\P\PY\PYTHIAN\DBD-Oracle-1.22.<br/>&gt;<br/>&gt; tar.gz ok<br/>&gt;<br/>&gt; Scanning cache C:\strawberry\cpan\build for sizes<br/>&gt;<br/>&gt; ............................................................................DONE<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; CPAN.pm: Going to build P/PY/PYTHIAN/DBD-Oracle-1.22.tar.gz<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; Using DBI 1.607 (for perl 5.010000 on MSWin32-x86-multi-thread) installed in C:/<br/>&gt;<br/>&gt; strawberry/perl/site/lib/auto/DBI/<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; Configuring DBD::Oracle for perl 5.010000 on MSWin32 (MSWin32-x86-multi-thread)<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; Remember to actually *READ* the README file! Especially if you have any problems<br/>&gt;<br/>&gt; .<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; Installing on a MSWin32, Ver#5.1<br/>&gt;<br/>&gt; Using Oracle in C:/oracle/product/10.2.0/client_2<br/>&gt;<br/>&gt; DEFINE _SQLPLUS_RELEASE = &quot;1002000100&quot; (CHAR)<br/>&gt;<br/>&gt; Oracle version 10.2.0.1 (10.2)<br/>&gt;<br/>&gt; Found oci directory<br/>&gt;<br/>&gt; Using OCI directory &#39;oci&#39;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; Checking for functioning wait.ph<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; System: perl5.010000<br/>&gt;<br/>&gt; Compiler: gcc -s -O2 -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEX<br/>&gt;<br/>&gt; T -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX<br/>&gt;<br/>&gt; Linker: not found<br/>&gt;<br/>&gt; Sysliblist:<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; Checking if your kit is complete...<br/>&gt;<br/>&gt; Warning: the following files are missing in your kit:<br/>&gt;<br/>&gt; META.yml<br/>&gt;<br/>&gt; Please inform the author.<br/>&gt;<br/>&gt; LD_RUN_PATH=C:/oracle/product/10.2.0/client_2/lib:C:/oracle/product/10.2.0/clien<br/>&gt;<br/>&gt; t_2/rdbms/lib<br/>&gt;<br/>&gt; Using DBD::Oracle 1.22.<br/>&gt;<br/>&gt; Using DBD::Oracle 1.22.<br/>&gt;<br/>&gt; Using DBI 1.607 (for perl 5.010000 on MSWin32-x86-multi-thread) installed in C:/<br/>&gt;<br/>&gt; strawberry/perl/site/lib/auto/DBI/<br/>&gt;<br/>&gt; Writing Makefile for DBD::Oracle<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; *** If you have problems...<br/>&gt;<br/>&gt; read all the log printed above, and the README and README.help.txt files.<br/>&gt;<br/>&gt; (Of course, you have read README by now anyway, haven&#39;t you?)<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; cp Oracle.pm blib\lib\DBD\Oracle.pm<br/>&gt;<br/>&gt; cp oraperl.ph blib\lib/oraperl.ph<br/>&gt;<br/>&gt; cp dbdimp.h blib\arch\auto\DBD\Oracle/dbdimp.h<br/>&gt;<br/>&gt; cp ocitrace.h blib\arch\auto\DBD\Oracle/ocitrace.h<br/>&gt;<br/>&gt; cp Oraperl.pm blib\lib/Oraperl.pm<br/>&gt;<br/>&gt; cp Oracle.h blib\arch\auto\DBD\Oracle/Oracle.h<br/>&gt;<br/>&gt; cp lib/DBD/Oracle/GetInfo.pm blib\lib\DBD\Oracle\GetInfo.pm<br/>&gt;<br/>&gt; cp mk.pm blib\arch\auto\DBD\Oracle/mk.pm<br/>&gt;<br/>&gt; C:\strawberry\perl\bin\perl.exe -p -e &quot;s/~DRIVER~/Oracle/g&quot; C:\strawberry\perl\s<br/>&gt;<br/>&gt; ite\lib\auto\DBI\Driver.xst &gt; Oracle.xsi<br/>&gt;<br/>&gt; C:\strawberry\perl\bin\perl.exe C:\strawberry\perl\lib\ExtUtils\xsubpp -typemap<br/>&gt;<br/>&gt; C:\strawberry\perl\lib\ExtUtils\typemap -typemap typemap Oracle.xs &gt; Oracle.xs<br/>&gt;<br/>&gt; c &amp;&amp; C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e mv Oracle.xsc Oracle<br/>&gt;<br/>&gt; .c<br/>&gt;<br/>&gt; gcc -c -IC:\strawberry\c\include -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL_<br/>&gt;<br/>&gt; IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX<br/>&gt;<br/>&gt; -s -O2 -DVERSION=\&quot;1.22\&quot; -DXS_VERSION=\&quot;1.22\&quot; &quot;-IC:\strawberry\perl\lib<br/>&gt;<br/>&gt; \CORE&quot; -Wall -Wno-comment -DUTF8_SUPPORT -DNEW_OCI_INIT -DORA_OCI_VERSION=\&quot;10.<br/>&gt;<br/>&gt; 2.0.1\&quot; Oracle.c<br/>&gt;<br/>&gt; In file included from Oracle.xs:1:<br/>&gt;<br/>&gt; Oracle.h:37:17: oci.h: No such file or directory<br/>&gt;<br/>&gt; Oracle.h:38:22: oratypes.h: No such file or directory<br/>&gt;<br/>&gt; Oracle.h:39:20: ocidfn.h: No such file or directory<br/>&gt;<br/>&gt; Oracle.h:40:18: orid.h: No such file or directory<br/>&gt;<br/>&gt; Oracle.h:41:17: ori.h: No such file or directory<br/>&gt;<br/>&gt; Oracle.h:51:54: DBIXS.h: No such file or directory<br/>&gt;<br/>&gt; In file included from Oracle.h:53,<br/>&gt;<br/>&gt; from Oracle.xs:1:<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; --------------------------------------------------------------------------------------------------------<br/>&gt;<br/>&gt; --------------------------------------------------------------------------------------------------------<br/>&gt;<br/>&gt;<br/>&gt;<br/>&gt; ATTENTION: DO NOT read, copy or disseminate this communication unless you are the intended addressee.<br/>&gt; This message and any file(s) or attachment(s) transmitted with it are confidential, intended only for<br/>&gt; the named recipient, and may contain information that is a trade secret, proprietary, protected by the<br/>&gt; attorney work product doctrine, subject to the attorney-client privilege, or is otherwise protected<br/>&gt; against unauthorized use or disclosure. This message and any file(s) or attachment(s) transmitted with<br/>&gt; it are transmitted based on a reasonable expectation of privacy consistent with ABA Formal Opinion No.<br/>&gt; 99-413. If you have received this communication in error, please e-mail the sender and notify the sender<br/>&gt; immediately that you have received the communication in error. Thank you.<br/>&gt;<br/>&gt; ----- End forwarded message -----<br/>&gt; <br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5483.html Fri, 05 Sep 2008 10:04:51 +0000 Re: ANNOUNCE: DBD::Oracle 1.22 Release Candidate 3 by H.Merijn Brand On Thu, 04 Sep 2008 11:01:17 -0400, John Scoles &lt;scoles@pythian.com&gt;<br/>wrote:<br/>&gt; H.Merijn Brand wrote:<br/>&gt; &gt; On Wed, 30 Jul 2008 18:00:52 -0400, John Scoles &lt;scoles@pythian.com&gt;<br/>&gt; &gt; wrote:<br/>&gt; &gt; <br/>&gt; &gt;&gt; Ok hot off the press RC3<br/>&gt; &gt;&gt;<br/>&gt; &gt;&gt; A few more minor fixed but a last minute patch for ora_lob_chunk_size <br/>&gt; &gt;&gt; function<br/>&gt; &gt;&gt;<br/>&gt; &gt;&gt; It can be found in the usual spot<br/>&gt; &gt;&gt;<br/>&gt; &gt;&gt; http://svn.perl.org/modules/dbd-oracle/trunk/DBD-Oracle-1.22-RC3.tar<br/>&gt; &gt;<br/>&gt; &gt; &lt;rant&gt;What really pisses me off in Oracle 10 (beside all the normal<br/>&gt; &gt; Oracle hate) is the new (mis)feature of a Recyle Bin. WTF, a database<br/>&gt; &gt; is not a windows system!&lt;/rant&gt;<br/>&gt; &gt;<br/>&gt; &gt; That said, I think it would be neat if DBD::Oracle would clean up the<br/>&gt; &gt; recycle bin after it has done it&#39;s testing.<br/>&gt; &gt;<br/>&gt; &lt;RERANT&gt;Unfortunately this is way to far on the Oracle DBA side to be <br/>&gt; part of DBD::Oracle, One has to do the Purge command while logged in as <br/>&gt; a user with &#39;SYSTEM&#39; privs or greater. It would also Purge ie (empty, <br/>&gt; delete, erase kill) the entire Recycle Bin something that may tick off <br/>&gt; you friendly neighborhood DBA.<br/><br/>I would so much love to be able to type<br/><br/>SQL &gt; PURGE ORACLE CASCADING CONSTRAINTS INCLUDING HISTORY;<br/><br/>and see it actually work.<br/><br/>&gt; As well this is a (mis)feature can be turned off or on so one would have <br/>&gt; to test for that then test to see if the user has purge etc.<br/>&gt; <br/>&gt; Not something I think one should introduce in DBD::Oracle. I think it <br/>&gt; would result in a loss of confidence in DBI and DBD as we would start <br/>&gt; doing SYSTEM type work on table space right from the start.<br/><br/>OK, a friendly warning then?<br/><br/>(/me just typed &quot;ALTER DATABASE FLASHBACK OFF;&quot; and added<br/> recyclebin = OFF to the .ora startup file)<br/><br/>&gt; cheers<br/>&gt; John Scoles<br/>&gt;<br/>&gt; &gt;&gt; Cheers and thanks for all the help guys<br/><br/>-- <br/>H.Merijn Brand Amsterdam Perl Mongers http://amsterdam.pm.org/<br/>using &amp; porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,<br/>11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.<br/>http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/<br/>http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5482.html Thu, 04 Sep 2008 08:10:17 +0000 Re: ANNOUNCE: DBD::Oracle 1.22 Release Candidate 3 by John Scoles <br/><br/>H.Merijn Brand wrote:<br/>&gt; On Wed, 30 Jul 2008 18:00:52 -0400, John Scoles &lt;scoles@pythian.com&gt;<br/>&gt; wrote:<br/>&gt;<br/>&gt; <br/>&gt;&gt; Ok hot off the press RC3<br/>&gt;&gt;<br/>&gt;&gt; A few more minor fixed but a last minute patch for ora_lob_chunk_size <br/>&gt;&gt; function<br/>&gt;&gt;<br/>&gt;&gt; It can be found in the usual spot<br/>&gt;&gt;<br/>&gt;&gt; http://svn.perl.org/modules/dbd-oracle/trunk/DBD-Oracle-1.22-RC3.tar<br/>&gt;&gt; <br/>&gt;<br/>&gt; &lt;rant&gt;What really pisses me off in Oracle 10 (beside all the normal<br/>&gt; Oracle hate) is the new (mis)feature of a Recyle Bin. WTF, a database<br/>&gt; is not a windows system!&lt;/rant&gt;<br/>&gt;<br/>&gt; That said, I think it would be neat if DBD::Oracle would clean up the<br/>&gt; recycle bin after it has done it&#39;s testing.<br/>&gt;<br/>&gt; <br/>&lt;RERANT&gt;Unfortunately this is way to far on the Oracle DBA side to be <br/>part of DBD::Oracle, One has to do the Purge command while logged in as <br/>a user with &#39;SYSTEM&#39; privs or greater. It would also Purge ie (empty, <br/>delete, erase kill) the entire Recycle Bin something that may tick off <br/>you friendly neighborhood DBA.<br/><br/>As well this is a (mis)feature can be turned off or on so one would have <br/>to test for that then test to see if the user has purge etc.<br/><br/>Not something I think one should introduce in DBD::Oracle. I think it <br/>would result in a loss of confidence in DBI and DBD as we would start <br/>doing SYSTEM type work on table space right from the start.<br/><br/>cheers<br/>John Scoles<br/>&gt;&gt; Cheers and thanks for all the help guys<br/>&gt;&gt; <br/>&gt;<br/>&gt; <br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5481.html Thu, 04 Sep 2008 07:58:09 +0000 Re: ANNOUNCE: DBD::Oracle 1.22 Release Candidate 3 by H.Merijn Brand On Wed, 30 Jul 2008 18:00:52 -0400, John Scoles &lt;scoles@pythian.com&gt;<br/>wrote:<br/><br/>&gt; Ok hot off the press RC3<br/>&gt; <br/>&gt; A few more minor fixed but a last minute patch for ora_lob_chunk_size <br/>&gt; function<br/>&gt; <br/>&gt; It can be found in the usual spot<br/>&gt; <br/>&gt; http://svn.perl.org/modules/dbd-oracle/trunk/DBD-Oracle-1.22-RC3.tar<br/><br/>&lt;rant&gt;What really pisses me off in Oracle 10 (beside all the normal<br/>Oracle hate) is the new (mis)feature of a Recyle Bin. WTF, a database<br/>is not a windows system!&lt;/rant&gt;<br/><br/>That said, I think it would be neat if DBD::Oracle would clean up the<br/>recycle bin after it has done it&#39;s testing.<br/><br/>&gt; Cheers and thanks for all the help guys<br/><br/>-- <br/>H.Merijn Brand Amsterdam Perl Mongers http://amsterdam.pm.org/<br/>using &amp; porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,<br/>11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.<br/>http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/<br/>http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5480.html Thu, 04 Sep 2008 07:29:09 +0000 Re: Taking trace () to the next level ... by John Scoles <br/><br/>H.Merijn Brand wrote:<br/>&gt; On Tue, 02 Sep 2008 19:03:26 +0100, &quot;Martin J. Evans&quot;<br/>&gt; &lt;martin.evans@easysoft.com&gt; wrote:<br/>&gt;<br/>&gt; <br/>&gt;&gt; H.Merijn Brand wrote:<br/>&gt;&gt; <br/>&gt;&gt;&gt; On Tue, 2 Sep 2008 11:15:20 +0100, Tim Bunce &lt;Tim.Bunce@pobox.com&gt;<br/>&gt;&gt;&gt; wrote:<br/>&gt;&gt;&gt;<br/>&gt;&gt;&gt; <br/>&gt;&gt;&gt;&gt; On Mon, Sep 01, 2008 at 05:01:40PM -0700, Jonathan Leffler wrote:<br/>&gt;&gt;&gt;&gt; <br/>&gt;&gt;&gt;&gt;&gt; On Mon, Sep 1, 2008 at 3:30 PM, Tim Bunce &lt;Tim.Bunce@pobox.com&gt;<br/>&gt;&gt;&gt;&gt;&gt; wrote:<br/>&gt;&gt;&gt;&gt;&gt;<br/>&gt;&gt;&gt;&gt;&gt; <br/>&gt;&gt;&gt;&gt;&gt;&gt; On Mon, Sep 01, 2008 at 01:31:57PM +0200, H.Merijn Brand wrote:<br/>&gt;&gt;&gt;&gt;&gt;&gt;<br/>&gt;&gt;&gt;&gt;&gt;&gt;<br/>&gt;&gt;&gt;&gt;&gt;&gt;<br/>&gt;&gt;&gt;&gt;&gt;&gt;<br/>&gt;&gt;&gt;&gt;&gt;&gt; <br/>&gt;&gt;&gt;&gt;&gt;&gt;&gt; On Sun, 31 Aug 2008 23:56:43 +0100, Tim Bunce<br/>&gt;&gt;&gt;&gt;&gt;&gt;&gt; &lt;Tim.Bunce@pobox.com&gt; wrote:<br/>&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br/>&gt;&gt;&gt;&gt;&gt;&gt;&gt; <br/>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Having said all that, I can see some value in having a<br/>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; separate driver trace level. I suggest a few of the &quot;middle<br/>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; 16 bits&quot; are given over to<br/>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; <br/>&gt;&gt;&gt;&gt;&gt;&gt;&gt; IMHO 4 bits will do (0..15). If that is correct, I&#39;ll also<br/>&gt;&gt;&gt;&gt;&gt;&gt;&gt; change the levels to leave the basic levels 1 and 2 alone.<br/>&gt;&gt;&gt;&gt;&gt;&gt;&gt; <br/>&gt;&gt;&gt;&gt;&gt;&gt; Actually I&#39;d rather squeeze the levels concept down to 0..7 for<br/>&gt;&gt;&gt;&gt;&gt;&gt; both DBI and DBD levels in order to make two more flag bits<br/>&gt;&gt;&gt;&gt;&gt;&gt; available and to encourage greater use of flags.<br/>&gt;&gt;&gt;&gt;&gt;&gt; <br/>&gt;&gt;&gt;&gt;&gt; FWIW, DBD::Informix uses trace levels from about 3 to 9 (leaving<br/>&gt;&gt;&gt;&gt;&gt; 1 and 2 for DBI output only).<br/>&gt;&gt;&gt;&gt;&gt;<br/>&gt;&gt;&gt;&gt;&gt; Whether that matters is another issue, but 4 bits would be<br/>&gt;&gt;&gt;&gt;&gt; preferred (though three is not the end of the world). Unless you<br/>&gt;&gt;&gt;&gt;&gt; have a use for those 2 bits at the back of your mind...<br/>&gt;&gt;&gt;&gt;&gt; <br/>&gt;&gt;&gt;&gt; Although it looks like the trace level range is being reduced, it&#39;s<br/>&gt;&gt;&gt;&gt; effectively being increased. It&#39;s just that instead of a single<br/>&gt;&gt;&gt;&gt; range you&#39;d now have two.<br/>&gt;&gt;&gt;&gt;<br/>&gt;&gt;&gt;&gt; The current highest levels of driver internals tracing would then<br/>&gt;&gt;&gt;&gt; be controlled via the DBD trace level. Something like this:<br/>&gt;&gt;&gt;&gt;<br/>&gt;&gt;&gt;&gt; $h-&gt;trace(&quot;2,-6&quot;); # DBI trace level 2, DBD trace level 6<br/>&gt;&gt;&gt;&gt;<br/>&gt;&gt;&gt;&gt; That gives you more control because you can enable higher levels of<br/>&gt;&gt;&gt;&gt; DBD tracing without being swamped by higher levels of DBI tracing.<br/>&gt;&gt;&gt;&gt;<br/>&gt;&gt;&gt;&gt;<br/>&gt;&gt;&gt;&gt;<br/>&gt;&gt;&gt;&gt; <br/>&gt;&gt;&gt; Sounds ok<br/>&gt;&gt;&gt;<br/>&gt;&gt;&gt; <br/>&gt;&gt;&gt;&gt; You could/should also define some trace flags for specific topics<br/>&gt;&gt;&gt;&gt; to give finer control. Something like this:<br/>&gt;&gt;&gt;&gt;<br/>&gt;&gt;&gt;&gt; $h-&gt;trace(&quot;2,-4,ix_charset&quot;);<br/>&gt;&gt;&gt;&gt; <br/>&gt;&gt;&gt; We will need some extra macro&#39;s to get the dbd level and the flags<br/>&gt;&gt;&gt; Any suggestions?<br/>&gt;&gt;&gt;<br/>&gt;&gt;&gt; <br/>&gt;&gt; I like what I&#39;m reading in this thread. As others have said I would find <br/>&gt;&gt; it beneficial to be able to trace DBD::ODBC without getting DBI tracing. <br/>&gt;&gt; In an attempt to get DBD::ODBC tracing without DBI tracing I moved some <br/>&gt;&gt; tracing to trace flags. Unfortunately, this had a rather unfortunate <br/>&gt;&gt; side effect. I created an odbcconnection trace flag and put all my <br/>&gt;&gt; connection tracing under that. The problem is the only way to set the <br/>&gt;&gt; flag before connecting :-( is:<br/>&gt;&gt; <br/>&gt;<br/>&gt; That is why I also support $ENV{DBD_TRACE}, in analogy with<br/>&gt; $ENV{DBI_TRACE}.<br/>&gt; <br/>&gt; <br/>I would have to agree with $ENV{DBD_TRACE} It would be very useful for <br/>me while debugging connections as well.<br/>&gt;&gt; use DBD::ODBC;<br/>&gt;&gt; DBI-&gt;trace(DBD::ODBC-&gt;parse_trace_flags(&#39;odbcconnection|odbcunicode&#39;);<br/>&gt;&gt;<br/>&gt;&gt; The current trace macros allow tracing if a flag is set, tracing if a <br/>&gt;&gt; flag is set and the trace level is at least N, and tracing if the level <br/>&gt;&gt; is at least N but NOT tracing if a flag is set OR the level is at least <br/>&gt;&gt; N. I&#39;d find the latter greatly beneficial for the above reason.<br/>&gt;&gt; <br/>&gt;<br/>&gt; <br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5479.html Wed, 03 Sep 2008 04:05:54 +0000 Re: Taking trace () to the next level ... by H.Merijn Brand On Tue, 02 Sep 2008 19:03:26 +0100, &quot;Martin J. Evans&quot;<br/>&lt;martin.evans@easysoft.com&gt; wrote:<br/><br/>&gt; H.Merijn Brand wrote:<br/>&gt; &gt; On Tue, 2 Sep 2008 11:15:20 +0100, Tim Bunce &lt;Tim.Bunce@pobox.com&gt;<br/>&gt; &gt; wrote:<br/>&gt; &gt;<br/>&gt; &gt; &gt; On Mon, Sep 01, 2008 at 05:01:40PM -0700, Jonathan Leffler wrote:<br/>&gt; &gt; &gt;&gt; On Mon, Sep 1, 2008 at 3:30 PM, Tim Bunce &lt;Tim.Bunce@pobox.com&gt;<br/>&gt; &gt; &gt;&gt; wrote:<br/>&gt; &gt; &gt;&gt;<br/>&gt; &gt; &gt;&gt;&gt; On Mon, Sep 01, 2008 at 01:31:57PM +0200, H.Merijn Brand wrote:<br/>&gt; &gt; &gt;&gt;&gt;<br/>&gt; &gt; &gt;&gt;&gt;<br/>&gt; &gt; &gt;&gt;&gt;<br/>&gt; &gt; &gt;&gt;&gt;<br/>&gt; &gt; &gt;&gt;&gt;&gt; On Sun, 31 Aug 2008 23:56:43 +0100, Tim Bunce<br/>&gt; &gt; &gt;&gt;&gt;&gt; &lt;Tim.Bunce@pobox.com&gt; wrote:<br/>&gt; &gt; &gt;&gt;&gt;&gt;<br/>&gt; &gt; &gt;&gt;&gt;&gt;&gt; Having said all that, I can see some value in having a<br/>&gt; &gt; &gt;&gt;&gt;&gt;&gt; separate driver trace level. I suggest a few of the &quot;middle<br/>&gt; &gt; &gt;&gt;&gt;&gt;&gt; 16 bits&quot; are given over to<br/>&gt; &gt; &gt;&gt;&gt;&gt; IMHO 4 bits will do (0..15). If that is correct, I&#39;ll also<br/>&gt; &gt; &gt;&gt;&gt;&gt; change the levels to leave the basic levels 1 and 2 alone.<br/>&gt; &gt; &gt;&gt;&gt; Actually I&#39;d rather squeeze the levels concept down to 0..7 for<br/>&gt; &gt; &gt;&gt;&gt; both DBI and DBD levels in order to make two more flag bits<br/>&gt; &gt; &gt;&gt;&gt; available and to encourage greater use of flags.<br/>&gt; &gt; &gt;&gt; FWIW, DBD::Informix uses trace levels from about 3 to 9 (leaving<br/>&gt; &gt; &gt;&gt; 1 and 2 for DBI output only).<br/>&gt; &gt; &gt;&gt;<br/>&gt; &gt; &gt;&gt; Whether that matters is another issue, but 4 bits would be<br/>&gt; &gt; &gt;&gt; preferred (though three is not the end of the world). Unless you<br/>&gt; &gt; &gt;&gt; have a use for those 2 bits at the back of your mind...<br/>&gt; &gt; &gt; Although it looks like the trace level range is being reduced, it&#39;s<br/>&gt; &gt; &gt; effectively being increased. It&#39;s just that instead of a single<br/>&gt; &gt; &gt; range you&#39;d now have two.<br/>&gt; &gt; &gt;<br/>&gt; &gt; &gt; The current highest levels of driver internals tracing would then<br/>&gt; &gt; &gt; be controlled via the DBD trace level. Something like this:<br/>&gt; &gt; &gt;<br/>&gt; &gt; &gt; $h-&gt;trace(&quot;2,-6&quot;); # DBI trace level 2, DBD trace level 6<br/>&gt; &gt; &gt;<br/>&gt; &gt; &gt; That gives you more control because you can enable higher levels of<br/>&gt; &gt; &gt; DBD tracing without being swamped by higher levels of DBI tracing.<br/>&gt; &gt; &gt;<br/>&gt; &gt; &gt;<br/>&gt; &gt; &gt;<br/>&gt; &gt;<br/>&gt; &gt; Sounds ok<br/>&gt; &gt;<br/>&gt; &gt; &gt; You could/should also define some trace flags for specific topics<br/>&gt; &gt; &gt; to give finer control. Something like this:<br/>&gt; &gt; &gt;<br/>&gt; &gt; &gt; $h-&gt;trace(&quot;2,-4,ix_charset&quot;);<br/>&gt; &gt;<br/>&gt; &gt; We will need some extra macro&#39;s to get the dbd level and the flags<br/>&gt; &gt; Any suggestions?<br/>&gt; &gt;<br/>&gt; <br/>&gt; I like what I&#39;m reading in this thread. As others have said I would find <br/>&gt; it beneficial to be able to trace DBD::ODBC without getting DBI tracing. <br/>&gt; In an attempt to get DBD::ODBC tracing without DBI tracing I moved some <br/>&gt; tracing to trace flags. Unfortunately, this had a rather unfortunate <br/>&gt; side effect. I created an odbcconnection trace flag and put all my <br/>&gt; connection tracing under that. The problem is the only way to set the <br/>&gt; flag before connecting :-( is:<br/><br/>That is why I also support $ENV{DBD_TRACE}, in analogy with<br/>$ENV{DBI_TRACE}.<br/> <br/>&gt; use DBD::ODBC;<br/>&gt; DBI-&gt;trace(DBD::ODBC-&gt;parse_trace_flags(&#39;odbcconnection|odbcunicode&#39;);<br/>&gt;<br/>&gt; The current trace macros allow tracing if a flag is set, tracing if a <br/>&gt; flag is set and the trace level is at least N, and tracing if the level <br/>&gt; is at least N but NOT tracing if a flag is set OR the level is at least <br/>&gt; N. I&#39;d find the latter greatly beneficial for the above reason.<br/><br/>-- <br/>H.Merijn Brand Amsterdam Perl Mongers http://amsterdam.pm.org/<br/>using &amp; porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,<br/>11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.<br/>http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/<br/>http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5478.html Tue, 02 Sep 2008 15:13:29 +0000 Re: Taking trace () to the next level ... by Martin J. Evans H.Merijn Brand wrote:<br/>&gt; On Tue, 2 Sep 2008 11:15:20 +0100, Tim Bunce &lt;Tim.Bunce@pobox.com&gt;<br/>&gt; wrote:<br/>&gt;<br/>&gt; &gt; On Mon, Sep 01, 2008 at 05:01:40PM -0700, Jonathan Leffler wrote:<br/>&gt; &gt;&gt; On Mon, Sep 1, 2008 at 3:30 PM, Tim Bunce &lt;Tim.Bunce@pobox.com&gt;<br/>&gt; &gt;&gt; wrote:<br/>&gt; &gt;&gt;<br/>&gt; &gt;&gt;&gt; On Mon, Sep 01, 2008 at 01:31:57PM +0200, H.Merijn Brand wrote:<br/>&gt; &gt;&gt;&gt;<br/>&gt; &gt;&gt;&gt;<br/>&gt; &gt;&gt;&gt;<br/>&gt; &gt;&gt;&gt;<br/>&gt; &gt;&gt;&gt;&gt; On Sun, 31 Aug 2008 23:56:43 +0100, Tim Bunce<br/>&gt; &gt;&gt;&gt;&gt; &lt;Tim.Bunce@pobox.com&gt; wrote:<br/>&gt; &gt;&gt;&gt;&gt;<br/>&gt; &gt;&gt;&gt;&gt;&gt; Having said all that, I can see some value in having a<br/>&gt; &gt;&gt;&gt;&gt;&gt; separate driver trace level. I suggest a few of the &quot;middle<br/>&gt; &gt;&gt;&gt;&gt;&gt; 16 bits&quot; are given over to<br/>&gt; &gt;&gt;&gt;&gt; IMHO 4 bits will do (0..15). If that is correct, I&#39;ll also<br/>&gt; &gt;&gt;&gt;&gt; change the levels to leave the basic levels 1 and 2 alone.<br/>&gt; &gt;&gt;&gt; Actually I&#39;d rather squeeze the levels concept down to 0..7 for<br/>&gt; &gt;&gt;&gt; both DBI and DBD levels in order to make two more flag bits<br/>&gt; &gt;&gt;&gt; available and to encourage greater use of flags.<br/>&gt; &gt;&gt; FWIW, DBD::Informix uses trace levels from about 3 to 9 (leaving<br/>&gt; &gt;&gt; 1 and 2 for DBI output only).<br/>&gt; &gt;&gt;<br/>&gt; &gt;&gt; Whether that matters is another issue, but 4 bits would be<br/>&gt; &gt;&gt; preferred (though three is not the end of the world). Unless you<br/>&gt; &gt;&gt; have a use for those 2 bits at the back of your mind...<br/>&gt; &gt; Although it looks like the trace level range is being reduced, it&#39;s<br/>&gt; &gt; effectively being increased. It&#39;s just that instead of a single<br/>&gt; &gt; range you&#39;d now have two.<br/>&gt; &gt;<br/>&gt; &gt; The current highest levels of driver internals tracing would then<br/>&gt; &gt; be controlled via the DBD trace level. Something like this:<br/>&gt; &gt;<br/>&gt; &gt; $h-&gt;trace(&quot;2,-6&quot;); # DBI trace level 2, DBD trace level 6<br/>&gt; &gt;<br/>&gt; &gt; That gives you more control because you can enable higher levels of<br/>&gt; &gt; DBD tracing without being swamped by higher levels of DBI tracing.<br/>&gt; &gt;<br/>&gt; &gt;<br/>&gt; &gt;<br/>&gt;<br/>&gt; Sounds ok<br/>&gt;<br/>&gt; &gt; You could/should also define some trace flags for specific topics<br/>&gt; &gt; to give finer control. Something like this:<br/>&gt; &gt;<br/>&gt; &gt; $h-&gt;trace(&quot;2,-4,ix_charset&quot;);<br/>&gt;<br/>&gt; We will need some extra macro&#39;s to get the dbd level and the flags<br/>&gt; Any suggestions?<br/>&gt;<br/><br/>I like what I&#39;m reading in this thread. As others have said I would find <br/>it beneficial to be able to trace DBD::ODBC without getting DBI tracing. <br/>In an attempt to get DBD::ODBC tracing without DBI tracing I moved some <br/>tracing to trace flags. Unfortunately, this had a rather unfortunate <br/>side effect. I created an odbcconnection trace flag and put all my <br/>connection tracing under that. The problem is the only way to set the <br/>flag before connecting :-( is:<br/><br/>use DBD::ODBC;<br/>DBI-&gt;trace(DBD::ODBC-&gt;parse_trace_flags(&#39;odbcconnection|odbcunicode&#39;);<br/><br/>The current trace macros allow tracing if a flag is set, tracing if a <br/>flag is set and the trace level is at least N, and tracing if the level <br/>is at least N but NOT tracing if a flag is set OR the level is at least <br/>N. I&#39;d find the latter greatly beneficial for the above reason.<br/><br/>Martin<br/><br/><br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5477.html Tue, 02 Sep 2008 11:03:55 +0000 Re: the return of tables () by H.Merijn Brand On Tue, 2 Sep 2008 11:01:37 +0100, Tim Bunce &lt;Tim.Bunce@pobox.com&gt;<br/>wrote:<br/><br/>&gt; &gt; &gt; I wasn&#39;t very clear (and was actually partly misleading). Sorry.<br/>&gt; &gt; &gt; <br/>&gt; &gt; &gt; What I meant was that the TABLE_CAT and/or TABLE_SCHEM columns in the<br/>&gt; &gt; &gt; data returned by your table_info () method are probably empty strings but<br/>&gt; &gt; &gt; should be undefs.<br/>&gt; &gt; &gt; <br/>&gt; &gt; &gt; What does<br/>&gt; &gt; &gt; Data::Dumper::Dumper($dbh-&gt;table_info(...)-&gt;fetchall_arrayref)<br/>&gt; &gt; &gt; show for an example table?<br/>&gt; &gt; <br/>&gt; &gt; $ perl -Iblib/{lib,arch} -MPROCURA::DBD -MData::Dumper<br/>&gt; &gt; -wle&#39;$dbh=DBDlogon;print Dumper $dbh-&gt;table_info(undef,&quot;PROLEP&quot;,&quot;parm&quot;)-&gt;fetchall_arrayref&#39; $VAR1 = [<br/>&gt; &gt; [<br/>&gt; &gt; &#39;&#39;,<br/>&gt; &gt; &#39;PROLEP&#39;,<br/>&gt; &gt; &#39;parm&#39;,<br/>&gt; &gt; &#39;T&#39;,<br/>&gt; &gt; &#39;W&#39;<br/>&gt; &gt; ]<br/>&gt; &gt; ];<br/>&gt; &gt; <br/>&gt; &gt; Correct, as that is the result of<br/>&gt; &gt; <br/>&gt; &gt; sub table_info<br/>&gt; &gt; {<br/>&gt; <br/>&gt; &gt; my $sth = $dbh-&gt;prepare (<br/>&gt; &gt; &quot;select &#39;&#39;, OWNR, TABLE_NAME, TABLE_TYPE, RDWRITE &quot;.<br/>&gt; &gt; &quot;from SYS.ACCESSIBLE_TABLES &quot;.<br/>&gt; &gt; $where);<br/>&gt; <br/>&gt; &gt; select NULL, OWNR, ...<br/>&gt; &gt; <br/>&gt; &gt; is not allowed. I don&#39;t see an easy way out<br/>&gt; &gt; <br/>&gt; &gt; sql&gt; select NULL, OWNR, TABLE_NAME<br/>&gt; &gt; sql&gt; from SYS.ACCESSIBLE_TABLES<br/>&gt; &gt; sql&gt; where TABLE_NAME like &#39;parm&#39;;<br/>&gt; &gt; NULL is not allowed in a constant list (-10518).<br/>&gt; <br/>&gt; Perhaps you could use some expression that happens to yield a NULL.<br/>&gt; Or you could implement a custom quote_identifier() method.<br/><br/>This worked:<br/>--8&lt;---<br/>sub quote_identifier<br/>{<br/> my ($dbh, @arg) = map { defined $_ &amp;&amp; $_ ne &quot;&quot; ? $_ : undef } @_;<br/> return $dbh-&gt;SUPER::quote_identifier (@arg);<br/> } # quote_identifier<br/>--&gt;8---<br/><br/>-- <br/>H.Merijn Brand Amsterdam Perl Mongers http://amsterdam.pm.org/<br/>using &amp; porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,<br/>11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.<br/>http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/<br/>http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5476.html Tue, 02 Sep 2008 07:28:16 +0000 Re: Taking trace () to the next level ... by H.Merijn Brand On Tue, 2 Sep 2008 11:15:20 +0100, Tim Bunce &lt;Tim.Bunce@pobox.com&gt;<br/>wrote:<br/><br/>&gt; On Mon, Sep 01, 2008 at 05:01:40PM -0700, Jonathan Leffler wrote:<br/>&gt; &gt; On Mon, Sep 1, 2008 at 3:30 PM, Tim Bunce &lt;Tim.Bunce@pobox.com&gt; wrote:<br/>&gt; &gt; <br/>&gt; &gt; &gt; On Mon, Sep 01, 2008 at 01:31:57PM +0200, H.Merijn Brand wrote:<br/>&gt; &gt; &gt; &gt; On Sun, 31 Aug 2008 23:56:43 +0100, Tim Bunce &lt;Tim.Bunce@pobox.com&gt;<br/>&gt; &gt; &gt; &gt; wrote:<br/>&gt; &gt; &gt; &gt;<br/>&gt; &gt; &gt; &gt; &gt; Having said all that, I can see some value in having a separate driver<br/>&gt; &gt; &gt; &gt; &gt; trace level. I suggest a few of the &quot;middle 16 bits&quot; are given over to<br/>&gt; &gt; &gt; &gt;<br/>&gt; &gt; &gt; &gt; IMHO 4 bits will do (0..15). If that is correct, I&#39;ll also change the<br/>&gt; &gt; &gt; &gt; levels to leave the basic levels 1 and 2 alone.<br/>&gt; &gt; &gt;<br/>&gt; &gt; &gt; Actually I&#39;d rather squeeze the levels concept down to 0..7 for both DBI<br/>&gt; &gt; &gt; and DBD levels in order to make two more flag bits available and to<br/>&gt; &gt; &gt; encourage greater use of flags.<br/>&gt; &gt; <br/>&gt; &gt; FWIW, DBD::Informix uses trace levels from about 3 to 9 (leaving 1 and 2 for<br/>&gt; &gt; DBI output only).<br/>&gt; &gt; <br/>&gt; &gt; Whether that matters is another issue, but 4 bits would be preferred (though<br/>&gt; &gt; three is not the end of the world). Unless you have a use for those 2 bits<br/>&gt; &gt; at the back of your mind...<br/>&gt; <br/>&gt; Although it looks like the trace level range is being reduced, it&#39;s<br/>&gt; effectively being increased. It&#39;s just that instead of a single range<br/>&gt; you&#39;d now have two.<br/>&gt; <br/>&gt; The current highest levels of driver internals tracing would then<br/>&gt; be controlled via the DBD trace level. Something like this:<br/>&gt; <br/>&gt; $h-&gt;trace(&quot;2,-6&quot;); # DBI trace level 2, DBD trace level 6<br/>&gt; <br/>&gt; That gives you more control because you can enable higher levels of DBD<br/>&gt; tracing without being swamped by higher levels of DBI tracing.<br/><br/>Sounds ok<br/><br/>&gt; You could/should also define some trace flags for specific topics to<br/>&gt; give finer control. Something like this:<br/>&gt;<br/>&gt; $h-&gt;trace(&quot;2,-4,ix_charset&quot;);<br/><br/>We will need some extra macro&#39;s to get the dbd level and the flags<br/>Any suggestions?<br/><br/>-- <br/>H.Merijn Brand Amsterdam Perl Mongers http://amsterdam.pm.org/<br/>using &amp; porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,<br/>11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.<br/>http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/<br/>http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5475.html Tue, 02 Sep 2008 05:22:51 +0000 Re: Taking trace () to the next level ... by John Scoles Well let me weigh in here with my 2cents worth as I am back from my <br/>semi-vacation as well.<br/><br/>First let me say that the DBD_Verbose has been a great help to me and I <br/>have at least two bug in the works were the user has used ORA_Verbose to <br/>give me an exact picture of what is going wrong with the code (OIC) <br/>which will save me a great deal of debugging time.<br/><br/>That aside when I implemented it I simply stuck to the old KISS <br/>principle and stuck a DBD_verbse condition with each DBI_DEBUG it. <br/>Simple crude and effective.<br/><br/>Looking at the thread the ideas seems to be<br/><br/>1) two ranges of debugging (DBI and DBD)<br/>2) Flags that that can turn debugging off or on for a specific action<br/> -debug_select<br/> -debug_commit<br/> -debug_connect<br/> -debug_oracle<br/> <br/>???<br/><br/>cheers<br/>John Scoles<br/><br/><br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5474.html Tue, 02 Sep 2008 04:36:43 +0000 Re: the return of tables () by H.Merijn Brand On Tue, 2 Sep 2008 11:01:37 +0100, Tim Bunce &lt;Tim.Bunce@pobox.com&gt;<br/>wrote:<br/><br/>&gt; On Tue, Sep 02, 2008 at 12:39:41AM +0200, H.Merijn Brand wrote:<br/>&gt; &gt; On Mon, 1 Sep 2008 22:59:24 +0100, Tim Bunce &lt;Tim.Bunce@pobox.com&gt;<br/>&gt; &gt; wrote:<br/>&gt; &gt; <br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; As get_info (29) now returns a TRUE value, the &#39;tables ()&#39; method is<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; using a different strategy to build the list it returns:<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; <br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; sub tables<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; {<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; my ($dbh, @args) = @_;<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; my $sth = $dbh-&gt;table_info (@args[0..4]) or return;<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; my $tables = $sth-&gt;fetchall_arrayref or return;<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; my @tables;<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &raquo; if ($dbh-&gt;get_info (29)) { # SQL_IDENTIFIER_QUOTE_CHAR<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &raquo; @tables = map { $dbh-&gt;quote_identifier (@{$_}[0,1,2]) } @$tables;<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; &raquo; }<br/>&gt; &gt; &gt; <br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; Unify has no support for CATALOG&#39;s, so the values in info are not<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; defined, but still used in the map, causing all my tables no showing up<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; with and empty &quot;&quot;. in front of it, which is illegal to the database :(<br/>&gt; <br/>&gt; &gt; &gt; I wasn&#39;t very clear (and was actually partly misleading). Sorry.<br/>&gt; &gt; &gt; <br/>&gt; &gt; &gt; What I meant was that the TABLE_CAT and/or TABLE_SCHEM columns in the<br/>&gt; &gt; &gt; data returned by your table_info () method are probably empty strings but<br/>&gt; &gt; &gt; should be undefs.<br/>&gt; &gt; &gt; <br/>&gt; &gt; &gt; What does<br/>&gt; &gt; &gt; Data::Dumper::Dumper($dbh-&gt;table_info(...)-&gt;fetchall_arrayref)<br/>&gt; &gt; &gt; show for an example table?<br/>&gt; &gt; <br/>&gt; &gt; $ perl -Iblib/{lib,arch} -MPROCURA::DBD -MData::Dumper<br/>&gt; &gt; -wle&#39;$dbh=DBDlogon;print Dumper $dbh-&gt;table_info(undef,&quot;PROLEP&quot;,&quot;parm&quot;)-&gt;fetchall_arrayref&#39; $VAR1 = [<br/>&gt; &gt; [<br/>&gt; &gt; &#39;&#39;,<br/>&gt; &gt; &#39;PROLEP&#39;,<br/>&gt; &gt; &#39;parm&#39;,<br/>&gt; &gt; &#39;T&#39;,<br/>&gt; &gt; &#39;W&#39;<br/>&gt; &gt; ]<br/>&gt; &gt; ];<br/>&gt; &gt; <br/>&gt; &gt; Correct, as that is the result of<br/>&gt; &gt; <br/>&gt; &gt; sub table_info<br/>&gt; &gt; {<br/>&gt; <br/>&gt; &gt; my $sth = $dbh-&gt;prepare (<br/>&gt; &gt; &quot;select &#39;&#39;, OWNR, TABLE_NAME, TABLE_TYPE, RDWRITE &quot;.<br/>&gt; &gt; &quot;from SYS.ACCESSIBLE_TABLES &quot;.<br/>&gt; &gt; $where);<br/>&gt; <br/>&gt; &gt; select NULL, OWNR, ...<br/>&gt; &gt; <br/>&gt; &gt; is not allowed. I don&#39;t see an easy way out<br/>&gt; &gt; <br/>&gt; &gt; sql&gt; select NULL, OWNR, TABLE_NAME<br/>&gt; &gt; sql&gt; from SYS.ACCESSIBLE_TABLES<br/>&gt; &gt; sql&gt; where TABLE_NAME like &#39;parm&#39;;<br/>&gt; &gt; NULL is not allowed in a constant list (-10518).<br/>&gt; <br/>&gt; Perhaps you could use some expression that happens to yield a NULL.<br/><br/>I tried, I cannot without creating a new table, and that feels like<br/>shooting a mouse with an elefant;<br/><br/>&gt; Or you could implement a custom quote_identifier () method.<br/><br/>I could, but that would feel very unsafe<br/><br/>-- <br/>H.Merijn Brand Amsterdam Perl Mongers http://amsterdam.pm.org/<br/>using &amp; porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,<br/>11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.<br/>http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/<br/>http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5473.html Tue, 02 Sep 2008 04:07:19 +0000 Re: Taking trace () to the next level ... by Tim Bunce On Mon, Sep 01, 2008 at 05:01:40PM -0700, Jonathan Leffler wrote:<br/>&gt; On Mon, Sep 1, 2008 at 3:30 PM, Tim Bunce &lt;Tim.Bunce@pobox.com&gt; wrote:<br/>&gt; <br/>&gt; &gt; On Mon, Sep 01, 2008 at 01:31:57PM +0200, H.Merijn Brand wrote:<br/>&gt; &gt; &gt; On Sun, 31 Aug 2008 23:56:43 +0100, Tim Bunce &lt;Tim.Bunce@pobox.com&gt;<br/>&gt; &gt; &gt; wrote:<br/>&gt; &gt; &gt;<br/>&gt; &gt; &gt; &gt; Having said all that, I can see some value in having a separate driver<br/>&gt; &gt; &gt; &gt; trace level. I suggest a few of the &quot;middle 16 bits&quot; are given over to<br/>&gt; &gt; &gt;<br/>&gt; &gt; &gt; IMHO 4 bits will do (0..15). If that is correct, I&#39;ll also change the<br/>&gt; &gt; &gt; levels to leave the basic levels 1 and 2 alone.<br/>&gt; &gt;<br/>&gt; &gt; Actually I&#39;d rather squeeze the levels concept down to 0..7 for both DBI<br/>&gt; &gt; and DBD levels in order to make two more flag bits available and to<br/>&gt; &gt; encourage greater use of flags.<br/>&gt; <br/>&gt; FWIW, DBD::Informix uses trace levels from about 3 to 9 (leaving 1 and 2 for<br/>&gt; DBI output only).<br/>&gt; <br/>&gt; Whether that matters is another issue, but 4 bits would be preferred (though<br/>&gt; three is not the end of the world). Unless you have a use for those 2 bits<br/>&gt; at the back of your mind...<br/><br/>Although it looks like the trace level range is being reduced, it&#39;s<br/>effectively being increased. It&#39;s just that instead of a single range<br/>you&#39;d now have two.<br/><br/>The current highest levels of driver internals tracing would then<br/>be controlled via the DBD trace level. Something like this:<br/><br/> $h-&gt;trace(&quot;2,-6&quot;); # DBI trace level 2, DBD trace level 6<br/><br/>That gives you more control because you can enable higher levels of DBD<br/>tracing without being swamped by higher levels of DBI tracing.<br/><br/>You could/should also define some trace flags for specific topics to<br/>give finer control. Something like this:<br/><br/> $h-&gt;trace(&quot;2,-4,ix_charset&quot;);<br/><br/>Tim.<br/> http://www.nntp.perl.org/group/perl.dbi.dev/2008/09/msg5472.html Tue, 02 Sep 2008 03:15:34 +0000 Re: the return of tables () by Tim Bunce On Tue, Sep 02, 2008 at 12:39:41AM +0200, H.Merijn Brand wrote:<br/>&gt; On Mon, 1 Sep 2008 22:59:24 +0100, Tim Bunce &lt;Tim.Bunce@pobox.com&gt;<br/>&gt; wrote:<br/>&gt; <br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; As get_info (29) now returns a TRUE value, the &#39;tables ()&#39; method is<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; using a different strategy to build the list it returns:<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; <br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; sub tables<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; {<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; my ($dbh, @args) = @_;<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; my $sth = $dbh-&gt;table_info (@args[0..4]) or return;<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; my $tables = $sth-&gt;fetchall_arrayref or return;<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; my @tables;<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &raquo; if ($dbh-&gt;get_info (29)) { # SQL_IDENTIFIER_QUOTE_CHAR<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &raquo; @tables = map { $dbh-&gt;quote_identifier (@{$_}[0,1,2]) } @$tables;<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &raquo; }<br/>&gt; &gt; <br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Unify has no support for CATALOG&#39;s, so the values in info are not<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; defined, but still used in the map, causing all my tables no showing up<br/>&gt; &gt; &gt; &gt; &gt; &gt; &gt; with and empty &quot;&quot;. in front of it, which is illegal to the database :(<br/><br/>&gt; &gt; I wasn&#39;t very clear (and was actually partly misleading). Sorry.<br/>&gt; &gt; <br/>&gt; &gt; What I meant was that the TABLE_CAT and/or TABLE_SCHEM columns in the<br/>&gt; &gt; data returned by your table_info () method are probably empty strings but<br/>&gt; &gt; should be undefs.<br/>&gt; &gt; <br/>&gt; &gt; What does<br/>&gt; &gt; Data::Dumper::Dumper($dbh-&gt;table_info(...)-&gt;fetchall_arrayref)<br/>&gt; &gt; show for an example table?<br/>&gt; <br/>&gt; $ perl -Iblib/{lib,arch} -MPR