Re: DBD::Sybase question

2006-04-26 Thread michael . peppler
Hi,

Yes, I know about that script - but you should still be careful when you 
use a binary built with a 12.5.1 client installation against a 15.0 
run-time. It would probably be better to rebuild.

Michael





Extranet
[EMAIL PROTECTED] - 25/04/2006 17:13
 

To: Michael PEPPLER
cc: dbi-users, mthaker, sybperl-l
Subject:Re: DBD::Sybase question






Many thanks for the reply and the information Michael - it's been very
useful.

It may interest you to know that we've successfully been able to run our
regression tests (which use DBD::Sybase 1.00) without changing anything
EXCEPT following the Sybase SDK 15 documentation and running
$SYBASE/OCS-15_0/scripts/lnsyblibs create - which creates soft-links
under $SYBASE/OCS-15_0/lib for backward-compatability (as you quite 
rightly
pointed out that Sybase have changed their lib names by adding a 'syb'
suffix to each one - eg. libct.so is now libsybct.so - the soft-links 
allow
a preservation reference of 'libct.so').

By the way, please note that there seems to be a bug in
$SYBASE/OCS-15_0/scripts/lnsyblibs as follows:

BUG in red:

createlinks()
{
ls libsyb*.s[o|l] |\
awk '{
print ln -s  $1  lib substr($1, 7, length($1) - 6)
}' | sh
}

FIX in blue:

createlinks()
{
ls libsyb*.s[ol] |\
awk '{
print ln -s  $1  lib substr($1, 7, length($1) - 6)
}' | sh
}

Once again, many thanks for your valuable feedback.

Regards,
Minesh




[EMAIL PROTECTED]
npparibas.com
To
25/04/2006 07:07  [EMAIL PROTECTED]
cc
dbi-users@perl.org,
[EMAIL PROTECTED]
Subject
Re: DBD::Sybase question










You can interact with an ASE 15 server with a 12.5.1 client with no
particular problems. There may be some issues with the more esoteric
OpenClient functionality, but as DBD::Sybase doesn't use this it shouldn't
be a problem.

So the short answer is that you can keep your current environment and add
the ASE 15 server to the interfaces file.

Moving forward however you should consider upgrading the client and
DBD::Sybase, so to answer your other questions:

- DBD::Sybase 1.00 will not build with OCS 15 due to changes in the 
library
names (and maybe other problems as well - I have never tried it).
- A DBD::Sybase binary should only be used at run-time with the same OCS
version that was used to build it (note: EBF changes are OK without a
rebuild)
- To have multiple DBD::Sybase binaries with a single perl installation 
you
need to set the PERL5_LIB env. variable or use the use lib directive in
your scripts to point to the directory that holds the DBD::Sybase binary
that you want to use. It is certainly feasible, but you obviously need to
set something up so that these settings are automatic (i.e. you don't want
to have to edit your scripts to set the correct environment :-)

That being said I only have a 15.0 installation here, and use it to
interface with all sorts of Sybase servers (including an antique 4.9.2
server!) and I have yet to see any problems.

Michael




Extranet
[EMAIL PROTECTED] - 24/04/2006 10:14

To:dbi-users, sybperl-l

cc:


Subject:DBD::Sybase question






Hi,

We are conducting a proof of concept to upgrade Sybase ASE 12.5.1 and
OpenClient 12.5.1 to Sybase ASE 15.0 and SDK 15.0 on Solaris 2.8. Our
current environment details are as follows:

Perl 5.005 (5.0 patchlevel 5 subversion 3)

Sybase OC 12.5.1
Sybase ASE 12.5.1

DBI 1.37

DBD::Sybase 1.00

We'd like to retain Sybase 12.5.1 and it's perl environment as described
above but create a new environment for Sybase 15.0.0 and have the 
following
questions (any feedback will be greatly appreciated):

- do we need an entirely separate perl, DBI and DBD installation for the
Sybase 15.0.0 side of things?

- do we need DBD::Sybase 1.07 for Sybase 15.0.0

- is there anyway we can use the same perl installation but point it to
either DBD::Sybase 1.00 or DBD::Sybase 1.07

Thanks  Regards,
Minesh Thaker

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
_

http://www.dstinternational.com

Notice: This e-mail and any attachments are intended only for the
individual
or company to which it is addressed and may contain information which is
privileged, confidential and prohibited from disclosure or unauthorized
use under applicable law.  If you are not the intended recipient of this
e-mail, you are hereby notified that any use, dissemination or copying of
this e-mail or the information contained in this e-mail is strictly
prohibited by the sender.

Whilst we run anti-virus software on all internet e-mails we are not 
liable
for any loss or damage.  The recipient is advised to run their own
anti-virus
software.

If you have received this transmission in error, please return the 
material
received to the sender and delete all copies from your system. Thank you.




This message and any attachments (the message) is
intended solely for the addressees and is confidential.
If you receive this message in error, please delete it and
immediately notify the sender. Any use not in accord 

Oracle functions through DBI?

2006-04-26 Thread Riccardo Bonuccelli
Hello,

I was wondering (and found nothing bout that on the web), can I use DBI to
execute some oracle DB functions?
Here's my case: I have a (oracle) function that returns a new free ROW ID
randomly and I have to manage that RI from a perl script. Can I use DBI to
submit the request to oracle? for me it would be much more simple and
efficient than the same old way!!

thanks
Riccardo


MySql function

2006-04-26 Thread Akpome Akpoguma
Hi Everyone,
   
  i did the following
   
  $dbh-prepare(UPDATE contentTable SET filename = '$dbfile date_modefied = 
'CURRENT_DATE()' time_modefied = 'CURRENT_TIME() WHERE ext = '$ext' )
   
  and the value of the current date and current time were not updated on the 
table. It seems perl interpolated the function CURRENT_DATE() and 
CURRENT_TIME() .everything else is ok
   
  can someone help with a way out.
   
   
  Rgds

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

RE: MySql function

2006-04-26 Thread Ronald J Kimball

Akpome Akpoguma [mailto:[EMAIL PROTECTED] wrote:
 
 Hi Everyone,
 
   i did the following
 
   $dbh-prepare(UPDATE contentTable SET filename = '$dbfile date_modefied
 = 'CURRENT_DATE()' time_modefied = 'CURRENT_TIME() WHERE ext = '$ext' )
 
   and the value of the current date and current time were not updated on
 the table. It seems perl interpolated the function CURRENT_DATE() and
 CURRENT_TIME() .everything else is ok

Why did you put single quotes around the MySql function calls?  That tells
MySql that these are strings, not function calls.

Also, you should be using placeholders for the variables.  Try this:

$dbh-prepare('UPDATE contentTable SET filename = ?, date_modified =
CURRENT_DATE(), time_modified = CURRENT_TIME() WHERE ext = ?');

$dbh-execute($dbfile, $ext);


Ronald




Re: Oracle functions through DBI?

2006-04-26 Thread John Scoles
Yes one can quite simply at least for a Stored procedure as for a function
you may have to wrap it in some SQL first.

 my $db=;
 my $db = DBI-connect();
 my $desc = 'Comments from user ';
 my $desc_out =;

 my $sql=begin insert_comment(:p_id ,:p_desc,:p_desc_out); end;;

 my $c=$db-prepare($sql) or die err 1 is  $DBI::errstr\n;

 $c-bind_param(:p_id,param('id')) or die err 2 is  $DBI::errstr\n;

 $c-bind_param_inout(:p_desc,\$desc,{ ora_type = ORA_CLOB }) or die err
3 is  $DBI::errstr\n;

 $c-bind_param_inout(:p_desc_out,\$desc_out,{ ora_type = ORA_CLOB }) or
die err 3 is  $DBI::errstr\n;

 $c-execute() or die err 4 is  $DBI::errstr\n;

 my $page_data = $c - fetchall_arrayref();

 $c-finish();


 print  @$page_data;
print BRBR;
print $desc_out;

where my insert_comment stored Procedure starts like

CREATE procedure insert_comment(in_ID in NUMBER, in_log in out clob, out_log
in out clob )





- Original Message - 
From: Riccardo Bonuccelli [EMAIL PROTECTED]
To: dbi-users@perl.org
Sent: Wednesday, April 26, 2006 10:46 AM
Subject: Oracle functions through DBI?


Hello,

I was wondering (and found nothing bout that on the web), can I use DBI to
execute some oracle DB functions?
Here's my case: I have a (oracle) function that returns a new free ROW ID
randomly and I have to manage that RI from a perl script. Can I use DBI to
submit the request to oracle? for me it would be much more simple and
efficient than the same old way!!

thanks
Riccardo



Re: Oracle functions through DBI?

2006-04-26 Thread Alexander Foken
You want to read 
http://search.cpan.org/~pythian/DBD-Oracle-1.17/Oracle.pm#PL/SQL_Examples


Alexander

Riccardo Bonuccelli wrote:


Hello,

I was wondering (and found nothing bout that on the web), can I use DBI to
execute some oracle DB functions?
Here's my case: I have a (oracle) function that returns a new free ROW ID
randomly and I have to manage that RI from a perl script. Can I use DBI to
submit the request to oracle? for me it would be much more simple and
efficient than the same old way!!

thanks
Riccardo

 



--
Alexander Foken
mailto:[EMAIL PROTECTED]  http://www.foken.de/alexander/



RE: Oracle functions through DBI?

2006-04-26 Thread Reidy, Ron
http://search.cpan.org/~pythian/DBD-Oracle-1.17/Oracle.pm#Other_Data_Typ
es

-Original Message-
From: Riccardo Bonuccelli [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 26, 2006 8:46 AM
To: dbi-users@perl.org
Subject: Oracle functions through DBI?

Hello,

I was wondering (and found nothing bout that on the web), can I use DBI
to
execute some oracle DB functions?
Here's my case: I have a (oracle) function that returns a new free ROW
ID
randomly and I have to manage that RI from a perl script. Can I use DBI
to
submit the request to oracle? for me it would be much more simple and
efficient than the same old way!!

thanks
Riccardo

This electronic message transmission is a PRIVATE communication which contains
information which may be confidential or privileged. The information is 
intended 
to be for the use of the individual or entity named above. If you are not the 
intended recipient, please be aware that any disclosure, copying, distribution 
or use of the contents of this information is prohibited. Please notify the
sender  of the delivery error by replying to this message, or notify us by
telephone (877-633-2436, ext. 0), and then delete it from your system.



Re: how to set a DEFAULT value !!

2006-04-26 Thread David Nicol
On 4/24/06, Greg Sabino Mullane [EMAIL PROTECTED] wrote:

 I've proposed adding something simlilar to DBI itself, but I don't recall 
 getting
 any feedback on it. Presumably once in place DBIx::Class will someday support 
 it.

DBI is complex enough, and AIUI the DBI philosophy opposes adding features
to the core that will cause implementation headaches for driver authors.

The standard perl idiom for default values is

   %hash = (key1 = 'defaultvalue1', key2 = 'defaultval2',  @_ );

Combining that with something like the insert_hash example from perldoc DBI
should give you a tidy function that inserts default values.

--
David L Nicol
Document what you do, then do what you documented


Re: last insert id

2006-04-26 Thread Daniel Kasak

Ron Savage wrote:

On Sun, 16 Apr 2006 22:15:22 +1000, Daniel Kasak wrote:

Hi Daniel

DBI: V 1.47
DBD::mysql: V 3.002
  


There are critical bugs in the $dbh-column_info() method in 
DBD::mysql-3.x that prevent us from upgrading :(

I've tried a line identical to your:


$id = $self - dbh() - last_insert_id(undef, undef, $table_name, undef);
and I didn't get anything useful from it. Ah well. 'select @@IDENTITY' 
works well for me, and appears to be the most compatible way of doing 
things.


Is last_insert_id() supposed to work in versions prior to 3.x? I know 
it's only a relatively recent addition. That means that the code below 
requires more checks on the version of DBD::mysql to see if 
last_insert_id() is supported ( and working ).

sub last_insert_id
{
my($self, $table_name) = @_;

my($id);

if ($self - db_vendor() =~ /(?:mysql|Pg)/)
{
$id = $self - dbh() - last_insert_id(undef, undef, 
$table_name, undef);
}
else # Oracle.
{
		my($sth) = $self - dbh() - prepare(select ${table_name}_id_seq.currval from 
dual);


$sth - execute();

$id = ${$sth - fetch()}[0];

$sth - finish();
}

return $id;

}   # End of last_insert_id.

  


Re: how to set a DEFAULT value !!

2006-04-26 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


 DBI is complex enough, and AIUI the DBI philosophy opposes adding features
 to the core that will cause implementation headaches for driver authors.

 The standard perl idiom for default values is

You misunderstand. The DEFAULT is on the database side, not the client, and
is represented by sending the literal string 'DEFAULT' to the backend,
similar to the way that null values are sent by the literal string 'NULL'.
The database then populates the column with whatever the default has been
set as, which may be a constant, or may be (in PostgreSQL's case) an arbitrarily
complex expression or call to a stored procedure.

- --
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200604262344
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8

-BEGIN PGP SIGNATURE-

iD8DBQFEUD4jvJuQZxSWSsgRAjUPAJ9X8mTMNT2cPZYCPHVFVuBr2ydccQCdFFma
BbE1KNnv1ofBwOkd8UhOFM8=
=j+L7
-END PGP SIGNATURE-




DBD::Oracle ppd

2006-04-26 Thread Jeffrey Seger
Any other repositories anyone knows of where I can download this?
ftp.esoftmatic.com and ppm.activestate.com have both been unreachable all
day. Google has been uncharacteristically unhelpful.

tia,

jeff



--
--
The darkest places in hell are reserved for those who maintain their
neutrality in times of moral crisis.
Dante Alighieri (1265 - 1321)

They who would give up an essential liberty for temporary security, deserve
neither liberty or security.
Benjamin Franklin

Our lives begin to end the day we become silent about things that matter.
Martin Luther King

Our government can't be bought.  The oil companies will never give it up at
any price.
My opinion
--


Re: how to set a DEFAULT value !!

2006-04-26 Thread Ron Savage
On Thu, 27 Apr 2006 03:45:22 -, Greg Sabino Mullane wrote:

Hi Greg

 You misunderstand. The DEFAULT is on the database side, not the

Just curious.

Which database server is this?

And, can you omit the name of the column you want defaulted, and does this
server then insert the default value?

--
Ron Savage
[EMAIL PROTECTED]
http://savage.net.au/index.html




Re: DBD::Oracle ppd

2006-04-26 Thread Ron Savage
On Wed, 26 Apr 2006 23:55:43 -0400, Jeffrey Seger wrote:

Hi Jeffrey

 Any other repositories anyone knows of where I can download this?

I tried a few sites, but can't see Oracle stuff.

As a last resort, try http://dada.perl.it/#ppm
and go round the PerlRing site by site :-(.
--
Ron Savage
[EMAIL PROTECTED]
http://savage.net.au/index.html




Re: DBD::Oracle ppd

2006-04-26 Thread Jeffrey Seger
  Any other repositories anyone knows of where I can download this?

 I tried a few sites, but can't see Oracle stuff.

 As a last resort, try http://dada.perl.it/#ppm
 and go round the PerlRing site by site :-(.


Thanks Ron.  I tried the search the ring tool on the perlring and no joy.
Maybe one or both of the regular sites will be back up tomorrow. *sigh*

jeff


--
--
The darkest places in hell are reserved for those who maintain their
neutrality in times of moral crisis.
Dante Alighieri (1265 - 1321)

They who would give up an essential liberty for temporary security, deserve
neither liberty or security.
Benjamin Franklin

Our lives begin to end the day we become silent about things that matter.
Martin Luther King

Our government can't be bought.  The oil companies will never give it up at
any price.
My opinion
--


Re: how to set a DEFAULT value !!

2006-04-26 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message


 Which database server is this?

This is definitely the behavior of MySQL, PostgreSQL, and Oracle,
and I'm pretty sure most others follow it as well.

 And, can you omit the name of the column you want defaulted, and does this
 server then insert the default value?

Yes. One way to think about this is to realize that *all* columns have
an automatic default of NULL, we are just changing it to something a
little more useful:

CREATE TABLE foo (
  a int,
  b int DEFAULT 22,
  c int DEFAULT stockprice('RHAT')
);

is completely identical to:

CREATE TABLE foo (
  a int DEFAULT NULL,
  b int DEFAULT 22,
  c int DEFAULT stockprice('RHAT')
);


-- A PostgreSQL example.
-- stockprice() is a pl/perl function that returns the real-time value
-- (in cents) of RedHat stock via a web service.

INSERT INTO foo(b) VALUES (14);

SELECT * FROM foo;

 a | b  |  c
---++--
   | 14 | 3025

-- We triggered the DEFAULT values of both a and c because we did
-- not specify them


INSERT INTO foo(a,b,c) VALUES (7,DEFAULT,47);

SELECT * FROM foo;

 a | b  |  c
---++--
   | 14 | 3025
 7 | 22 |   47

-- We told b to use its default value explicitly


INSERT INTO foo(a,b,c) VALUES (DEFAULT,DEFAULT,NULL);

SELECT * FROM foo;
 a | b  |  c
---++--
   | 14 | 3025
 7 | 22 |   47
   | 22 |


-- We told a and b to use their default values, and set c explicitly


It's late here, so hope that made sense. :)

--
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200604270030
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-

iD8DBQFEUEo0vJuQZxSWSsgRAmAYAKDcMYGCUfTkpsVBGvTDr+rD1sjf/gCdGvYI
lpjCTQT14ynvtN2LOV++rLs=
=ww4D
-END PGP SIGNATURE-




Re: how to set a DEFAULT value !!

2006-04-26 Thread Ron Savage
On Thu, 27 Apr 2006 04:37:20 -, Greg Sabino Mullane wrote:

Hi Greg

 It's late here, so hope that made sense. :)

Yep. It means just that much more I don't know...
--
Ron Savage
[EMAIL PROTECTED]
http://savage.net.au/index.html