[23830] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 6033 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 29 21:31:40 2004

Date: Thu, 29 Jan 2004 18:26:04 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 29 Jan 2004     Volume: 10 Number: 6033

Today's topics:
    Re: perl journals <dwall@fastmail.fm>
    Re: perl journals <kkeller-usenet@wombat.san-francisco.ca.us>
    Re: perl journals <tadmc@augustmail.com>
    Re: perl journals (Randal L. Schwartz)
    Re: perl journals <uri@stemsystems.com>
    Re: perl journals <jwillmore@remove.adelphia.net>
    Re: perl journals <bart.lateur@pandora.be>
    Re: perl journals <matthew.garrish@sympatico.ca>
        Perl Module for phone modem <Mark.Fenbers@noaa.gov>
        Perl module to generate Excel XML <rkdba@sympatico.ca>
    Re: Perl module to generate Excel XML <skweek@no.spam>
    Re: Perl module to generate Excel XML (John McNamara)
    Re: Perl module to generate Excel XML (Ravi Krishna)
        perl modules <robin@csf.edu>
    Re: perl modules <gnari@simnet.is>
    Re: perl modules <uri@stemsystems.com>
    Re: perl modules <1usa@llenroc.ude>
    Re: perl modules <robin@csf.edu>
    Re: perl modules <robin@csf.edu>
    Re: perl modules <robin@csf.edu>
    Re: perl modules <HelgiBriem_1@hotmail.com>
    Re: perl modules <uri@stemsystems.com>
        Perl MySQL NEXT_INSERT_ID? <Eric@nowhere.com>
    Re: Perl MySQL NEXT_INSERT_ID? <nospam@bigpond.com>
    Re: Perl MySQL NEXT_INSERT_ID? <Eric@nowhere.com>
    Re: Perl MySQL NEXT_INSERT_ID? <ittyspam@yahoo.com>
    Re: Perl MySQL NEXT_INSERT_ID? <Eric@nowhere.com>
    Re: Perl MySQL NEXT_INSERT_ID? <andy@andyh.co.uk>
    Re: Perl MySQL NEXT_INSERT_ID? <pkent77tea@yahoo.com.tea>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 21 Jan 2004 14:32:03 -0000
From: "David K. Wall" <dwall@fastmail.fm>
Subject: Re: perl journals
Message-Id: <Xns947760FC624Fdkwwashere@216.168.3.30>

Randal L. Schwartz <merlyn@stonehenge.com> wrote:

>>>>>> "Damon" == Damon Davison <davison@uni-koeln_spamfilter_.de> writes:
> 
> Damon> The sheer amount of interesting reading there is breathtaking.
> Damon> And it's free.
> 
> Yup!  Thanks to arrangements with publishers.
> 
> And if you'd rather have the best of those in dead tree form,
> you can already preorder the book from Apress:
><http://www.apress.com/book/bookDisplay.html?bID=307>.

As a matter of fact, I would.  It's difficult and embarrassing to drag my 
computer into a toilet stall, and power outlets are usually not conveniently 
located.

-- 
David Wall


------------------------------

Date: Wed, 21 Jan 2004 08:41:07 -0800
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: perl journals
Message-Id: <33amub.fac.ln@goaway.wombat.san-francisco.ca.us>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

On 2004-01-21, David K. Wall <dwall@fastmail.fm> wrote:
>
> As a matter of fact, I would.  It's difficult and embarrassing to drag my 
> computer into a toilet stall, and power outlets are usually not conveniently 
> located.

You need a laptop with wireless and a good battery.  The sense of
embarassment will fade with time.  ;-)

- --keith

- -- 
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom

-----BEGIN xxx SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQFADqujhVcNCxZ5ID8RAmkCAJ4nnRFoVr7qvegZz/ZylZ20SX505ACgl4H4
qTtExCw+vGWljC+zw63FxDM=
=nK9I
-----END PGP SIGNATURE-----


------------------------------

Date: Wed, 21 Jan 2004 11:17:44 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: perl journals
Message-Id: <slrnc0td1o.7ab.tadmc@magna.augustmail.com>

Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> wrote:
> On 2004-01-21, David K. Wall <dwall@fastmail.fm> wrote:
>>
>> As a matter of fact, I would.  It's difficult and embarrassing to drag my 
>> computer into a toilet stall, and power outlets are usually not conveniently 
>> located.
> 
> You need a laptop with wireless and a good battery.


 ... and a slow processor.

The fast ones are hot enough to burn a bare lap top.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: Wed, 21 Jan 2004 17:53:51 GMT
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: perl journals
Message-Id: <f2cc3e55dc92fefd363963040d44e94a@news.teranews.com>

>>>>> "David" == David K Wall <dwall@fastmail.fm> writes:

David> As a matter of fact, I would.  It's difficult and embarrassing
David> to drag my computer into a toilet stall, and power outlets are
David> usually not conveniently located.

I'm not sure whether I should be pleased or disturbed that you're
wanting to read my writings in the stalls.

:-)

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


------------------------------

Date: Wed, 21 Jan 2004 18:19:28 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: perl journals
Message-Id: <x7r7xtcggg.fsf@mail.sysarch.com>

>>>>> "RLS" == Randal L Schwartz <merlyn@stonehenge.com> writes:

>>>>> "David" == David K Wall <dwall@fastmail.fm> writes:
  David> As a matter of fact, I would.  It's difficult and embarrassing
  David> to drag my computer into a toilet stall, and power outlets are
  David> usually not conveniently located.

  RLS> I'm not sure whether I should be pleased or disturbed that you're
  RLS> wanting to read my writings in the stalls.

  RLS> :-)

emergency toilet paper. :)

<ducking>

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


------------------------------

Date: Wed, 21 Jan 2004 20:47:54 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: perl journals
Message-Id: <pan.2004.01.21.20.47.52.861475@remove.adelphia.net>

On Wed, 21 Jan 2004 17:53:51 +0000, Randal L. Schwartz wrote:

>>>>>> "David" == David K Wall <dwall@fastmail.fm> writes:
> 
> David> As a matter of fact, I would.  It's difficult and embarrassing
> David> to drag my computer into a toilet stall, and power outlets are
> David> usually not conveniently located.
> 
> I'm not sure whether I should be pleased or disturbed that you're
> wanting to read my writings in the stalls.
> 
> :-)

Pleased .... men only read the best while sitting on the throne.

:-)

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
Go climb a gravity well! 




------------------------------

Date: Thu, 22 Jan 2004 08:05:06 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: perl journals
Message-Id: <5m0v00dh68cv2tp7mqhb31i5iacsd2o8cv@4ax.com>

Robin wrote:

[deep quote:]
>> > and join http://www.perlmonks.org 

>hehe... I decided to ask more moronic questions and not do that site...

Hey! Even though you don't check out the tutorials there, it's still one
of the best perl sites around. Many of the best known Perl People hang
around there (as well), such as Randal Schwartz ("merlyn"), Abigail
("Abigail-II"), Damian Conway ("TheDamian"), Dan Sugalski ("Elian"), and
even Larry Wall himself (no I won't tell his username here. It's a
public secret. :) ). Plus there's lots more interesting people you've
likely never even heard of. (Far from all have years of Perl under their
belt. That doesn't make them less interesting, only less of a guru.)

-- 
	Bart.


------------------------------

Date: Thu, 22 Jan 2004 07:41:23 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: perl journals
Message-Id: <SxPPb.15712$U77.1239137@news20.bellglobal.com>


"Bart Lateur" <bart.lateur@pandora.be> wrote in message
news:5m0v00dh68cv2tp7mqhb31i5iacsd2o8cv@4ax.com...
> Robin wrote:
>
> [deep quote:]
> >> > and join http://www.perlmonks.org
>
> >hehe... I decided to ask more moronic questions and not do that site...
>
> Hey! Even though you don't check out the tutorials there, it's still one
> of the best perl sites around.

I think s/he was referring to his/her "official" clpm web site...

Matt




------------------------------

Date: Thu, 29 Jan 2004 15:19:49 -0500
From: Mark J Fenbers <Mark.Fenbers@noaa.gov>
Subject: Perl Module for phone modem
Message-Id: <40196AE5.B7AA9DB8@noaa.gov>

I've been tasked with writing code to dial telemetry equipment through a phone
modem as a backup means to our existing method of acquiring data.  My plan is to
use Perl on a Linux box to do this, but the last time I did this sort of stuff
was years ago when Procomm+ was popular and network cables were not.

Is there a Perl Module available to make this coding task a bit easier for me??

Mark



------------------------------

Date: Thu, 22 Jan 2004 11:03:36 -0500
From: "Ravi Krishna" <rkdba@sympatico.ca>
Subject: Perl module to generate Excel XML
Message-Id: <buosch$k3vr3$1@ID-75254.news.uni-berlin.de>

Hi,

I need to generate XML reports in Perl which can be read by Excel.
I get the data from database using Perl DBI/DBD.

Excel has the capability to directly read a XML file and display it,
while preserving all fonts, colors etc.

Is there a module in CPAN (or elsewhere) where I can convert standard row/column
data into a Excel-XML. A sample of that type of XML is attached below.

TIA.

Ravi
===========================================

</ExcelWorkbook>
<Styles>
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Bottom"/>
<Borders/>
<Font/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
<Style ss:ID="s21">
<NumberFormat ss:Format="#,##0"/>
</Style>
<Style ss:ID="s22">
<Font x:Family="Swiss" ss:Italic="1"/>
</Style>
<Style ss:ID="s23">
<Font x:Family="Swiss" ss:Bold="1"/>
</Style>
<Style ss:ID="s24">
<Font x:Family="Swiss" ss:Bold="1"/>
<NumberFormat ss:Format="#,##0"/>
</Style>
</Styles>
<Worksheet ss:Name="bigbroweek">
<Table ss:ExpandedColumnCount="24" ss:ExpandedRowCount="22" x:FullColumns="1"
x:FullRows="1">
<Row ss:StyleID="s22">
<Cell><Data ss:Type="String">Client</Data></Cell>
<Cell><Data ss:Type="String">Searches</Data></Cell>
<Cell><Data ss:Type="String">GS Searches</Data></Cell>
<Cell><Data ss:Type="String">B2C Pnrs Booked</Data></Cell>
<Cell><Data ss:Type="String">B2C Psgrs Booked</Data></Cell>
<Cell><Data ss:Type="String">B2C Ticketed PNRs</Data></Cell>
<Cell><Data ss:Type="String">B2C Psgr Ticketed</Data></Cell>
<Cell><Data ss:Type="String">GS Pnrs Booked</Data></Cell>
<Cell><Data ss:Type="String">GS Pnrs Psgr</Data></Cell>
<Cell><Data ss:Type="String">GS Ticketed PNRs</Data></Cell>
<Cell><Data ss:Type="String">GS Psgrs ticketed</Data></Cell>
<Cell><Data ss:Type="String">GUI Booking</Data></Cell>
<Cell><Data ss:Type="String">Pub Booking</Data></Cell>
<Cell><Data ss:Type="String">Pub Booking value($)</Data></Cell>
<Cell><Data ss:Type="String">Net Booking</Data></Cell>




------------------------------

Date: Thu, 22 Jan 2004 20:45:49 +0100
From: AlV <skweek@no.spam>
Subject: Re: Perl module to generate Excel XML
Message-Id: <bup99d$knr$1@news-reader2.wanadoo.fr>

Ravi Krishna wrote:
> Hi,
> 
> I need to generate XML reports in Perl which can be read by Excel.
> I get the data from database using Perl DBI/DBD.
> 
> Excel has the capability to directly read a XML file and display it,
> while preserving all fonts, colors etc.
> 
> Is there a module in CPAN (or elsewhere) where I can convert standard row/column
> data into a Excel-XML. A sample of that type of XML is attached below.

What about writing Excel native file using Spreadsheet::WriteExcel?
http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-0.42/WriteExcel.pm

Or is there a strong requirement for XML other than being read by Excel?



------------------------------

Date: 23 Jan 2004 05:20:28 -0800
From: jmcnamara@cpan.org (John McNamara)
Subject: Re: Perl module to generate Excel XML
Message-Id: <8cceb2da.0401230520.61a25f0a@posting.google.com>

"Ravi Krishna" <rkdba@sympatico.ca> wrote:

> I need to generate XML reports in Perl which can be read by Excel.
> I get the data from database using Perl DBI/DBD.
> 
> Excel has the capability to directly read a XML file and display it,
> while preserving all fonts, colors etc.


You can create Excel files in the native binary format using
Spreadsheet::WriteExcel:

    http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/

I wrote the above module and I am currently working on a version that
will emit Excel XML. I will hopefully be releasing a preliminary
version to CPAN in the next 2-3 weeks.

John.
--


------------------------------

Date: 23 Jan 2004 10:27:36 -0800
From: rkdba@sympatico.ca (Ravi Krishna)
Subject: Re: Perl module to generate Excel XML
Message-Id: <bc4e5389.0401231027.4efbe4be@posting.google.com>

jmcnamara@cpan.org (John McNamara) wrote in message news:<8cceb2da.0401230520.61a25f0a@posting.google.com>...
> "Ravi Krishna" <rkdba@sympatico.ca> wrote:
> 
> > I need to generate XML reports in Perl which can be read by Excel.
> > I get the data from database using Perl DBI/DBD.
> > 
> > Excel has the capability to directly read a XML file and display it,
> > while preserving all fonts, colors etc.
> 
> 
> You can create Excel files in the native binary format using
> Spreadsheet::WriteExcel:
> 
>     http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel/
> 
> I wrote the above module and I am currently working on a version that
> will emit Excel XML. I will hopefully be releasing a preliminary
> version to CPAN in the next 2-3 weeks.

Excellent. 
Thanks Avi and John.
If it is a wait of only a month, then I would prefer XML.

Thanks again.


------------------------------

Date: Thu, 22 Jan 2004 12:51:18 -0700
From: "Robin" <robin@csf.edu>
Subject: perl modules
Message-Id: <bupkgh$674$1@reader2.nmix.net>

I have a hosting co. that won't let me install new perl modules, anyway I
could still run the modules...? Put them in the same dir as my script?

cc to robin@csf.edu - Thanks.

--
Regards,
Robin
--
robin@csf.edu
--





------------------------------

Date: Thu, 22 Jan 2004 22:52:03 -0000
From: "gnari" <gnari@simnet.is>
Subject: Re: perl modules
Message-Id: <bupkc5$4p1$1@news.simnet.is>

"Robin" <robin@csf.edu> wrote in message
news:bupkgh$674$1@reader2.nmix.net...
> I have a hosting co. that won't let me install new perl modules, anyway I
> could still run the modules...? Put them in the same dir as my script?
>

this is a .... you guessed it !  ... FAQ

to be precise:
perldoc -q "How do I keep my own module/library directory?"

hope,
gnari





------------------------------

Date: Thu, 22 Jan 2004 23:22:45 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: perl modules
Message-Id: <x7wu7j601n.fsf@mail.sysarch.com>

>>>>> "R" == Robin  <robin@csf.edu> writes:

  R> I have a hosting co. that won't let me install new perl modules,
  R> anyway I could still run the modules...? Put them in the same dir
  R> as my script?

FAQ. did you read the ENTIRE FAQ as i told you to do? nooooo!! you have
to ignore good advice all the time and get spoon fed.

now read the goddamned FAQ as it was written for YOU in mind. do you get
it? you ask questions the others ask FREQUENTLY!! ever realize that? the
name FAQ HAS A MEANING. these questions are asked OVER and OVER by every
newbie that learns perl. you are no exception.

now read the FAQ. i request others stop responding to robin until she
has shown us she has read the whole FAQ (and i mean the WHOLE thing). we
should have a quiz for her before we answer anything else.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


------------------------------

Date: 23 Jan 2004 00:34:12 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude>
Subject: Re: perl modules
Message-Id: <Xns9478C7141AE63asu1cornelledu@132.236.56.8>

Uri Guttman <uri@stemsystems.com> wrote in 
news:x7wu7j601n.fsf@mail.sysarch.com:

>>>>>> "R" == Robin  <robin@csf.edu> writes:
> 
>   R> I have a hosting co. that won't let me install new perl modules,
>   R> anyway I could still run the modules...? Put them in the same dir
>   R> as my script?
> 
> FAQ. did you read the ENTIRE FAQ as i told you to do? nooooo!! you have
> to ignore good advice all the time and get spoon fed.

 ...

> now read the FAQ. i request others stop responding to robin until she
> has shown us she has read the whole FAQ (and i mean the WHOLE thing).
> we should have a quiz for her before we answer anything else.

What do you say we put together a web site for that purpose? :))

-- 
A. Sinan Unur
1usa@llenroc.ude (reverse each component for email address)


------------------------------

Date: Thu, 22 Jan 2004 19:00:36 -0700
From: "Robin" <robin@csf.edu>
Subject: Re: perl modules
Message-Id: <buq0di$9k7$1@reader2.nmix.net>



"Uri Guttman" <uri@stemsystems.com> wrote in message
news:x7wu7j601n.fsf@mail.sysarch.com...
> >>>>> "R" == Robin  <robin@csf.edu> writes:
>
>   R> I have a hosting co. that won't let me install new perl modules,
>   R> anyway I could still run the modules...? Put them in the same dir
>   R> as my script?
>
> FAQ. did you read the ENTIRE FAQ as i told you to do? nooooo!! you have
> to ignore good advice all the time and get spoon fed.
>
> now read the goddamned FAQ as it was written for YOU in mind. do you get
> it? you ask questions the others ask FREQUENTLY!! ever realize that? the
> name FAQ HAS A MEANING. these questions are asked OVER and OVER by every
> newbie that learns perl. you are no exception.
>
> now read the FAQ. i request others stop responding to robin until she
> has shown us she has read the whole FAQ (and i mean the WHOLE thing). we
> should have a quiz for her before we answer anything else.

I don't really have time, it's not a she, I'm on perlfaq2 now...peace,
-Robin




------------------------------

Date: Thu, 22 Jan 2004 19:01:05 -0700
From: "Robin" <robin@csf.edu>
Subject: Re: perl modules
Message-Id: <buq0dj$9k7$2@reader2.nmix.net>



"A. Sinan Unur" <1usa@llenroc.ude> wrote in message
news:Xns9478C7141AE63asu1cornelledu@132.236.56.8...
> Uri Guttman <uri@stemsystems.com> wrote in
> news:x7wu7j601n.fsf@mail.sysarch.com:
>
> >>>>>> "R" == Robin  <robin@csf.edu> writes:
> >
> >   R> I have a hosting co. that won't let me install new perl modules,
> >   R> anyway I could still run the modules...? Put them in the same dir
> >   R> as my script?
> >
> > FAQ. did you read the ENTIRE FAQ as i told you to do? nooooo!! you have
> > to ignore good advice all the time and get spoon fed.
>
> ...
>
> > now read the FAQ. i request others stop responding to robin until she
> > has shown us she has read the whole FAQ (and i mean the WHOLE thing).
> > we should have a quiz for her before we answer anything else.
>
> What do you say we put together a web site for that purpose? :))

haha...
--Robin




------------------------------

Date: Thu, 22 Jan 2004 19:01:28 -0700
From: "Robin" <robin@csf.edu>
Subject: Re: perl modules
Message-Id: <buq0dk$9k7$3@reader2.nmix.net>


> this is a .... you guessed it !  ... FAQ
>
> to be precise:
> perldoc -q "How do I keep my own module/library directory?"
>
Thanks for that -q option... peace...
-Robin




------------------------------

Date: Fri, 23 Jan 2004 10:43:04 +0000
From: Helgi Briem <HelgiBriem_1@hotmail.com>
Subject: Re: perl modules
Message-Id: <fku110lsur6kin82qs8ucgb7hu9se320h7@4ax.com>

On Thu, 22 Jan 2004 23:22:45 GMT, Uri Guttman <uri@stemsystems.com>
wrote:

>>>>>> "R" == Robin  <robin@csf.edu> writes:
>
>  R> I have a hosting co. that won't let me install new perl modules,
>  R> anyway I could still run the modules...? Put them in the same dir
>  R> as my script?
>
>FAQ. did you read the ENTIRE FAQ as i told you to do? nooooo!! you have
>to ignore good advice all the time and get spoon fed.
>
>now read the goddamned FAQ as it was written for YOU in mind. do you get
>it? you ask questions the others ask FREQUENTLY!! ever realize that? the
>name FAQ HAS A MEANING. these questions are asked OVER and OVER by every
>newbie that learns perl. you are no exception.
>
>now read the FAQ. i request others stop responding to robin until she
>has shown us she has read the whole FAQ (and i mean the WHOLE thing). we
>should have a quiz for her before we answer anything else.

Uri, did you suddenly find your Shift button?  ;-)


------------------------------

Date: Fri, 23 Jan 2004 17:43:42 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: perl modules
Message-Id: <x7llny4l2q.fsf@mail.sysarch.com>

>>>>> "HB" == Helgi Briem <HelgiBriem_1@hotmail.com> writes:

  HB> On Thu, 22 Jan 2004 23:22:45 GMT, Uri Guttman <uri@stemsystems.com>
  HB> wrote:

  >> now read the goddamned FAQ as it was written for YOU in mind. do you get
  >> it? you ask questions the others ask FREQUENTLY!! ever realize that? the
  >> name FAQ HAS A MEANING. these questions are asked OVER and OVER by every
  >> newbie that learns perl. you are no exception.

  HB> Uri, did you suddenly find your Shift button?  ;-)

nah, it is enabled when i post to the clueless. consider it a LART
action.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


------------------------------

Date: Fri, 23 Jan 2004 11:44:13 -0000
From: "Eric" <Eric@nowhere.com>
Subject: Perl MySQL NEXT_INSERT_ID?
Message-Id: <bur1da$87n$1@news5.svr.pol.co.uk>

Hi,

I know I can get LAST_INSERT_ID from a MySQL database... but is there a way
to determine what the next INSERT_ID would be if I were to insert a new
record?

Thanks,

Eric




------------------------------

Date: Fri, 23 Jan 2004 21:51:41 +1000
From: Gregory Toomey <nospam@bigpond.com>
Subject: Re: Perl MySQL NEXT_INSERT_ID?
Message-Id: <bur1tn$ld6lb$2@ID-202028.news.uni-berlin.de>

Eric wrote:

> Hi,
> 
> I know I can get LAST_INSERT_ID from a MySQL database... but is there a
> way to determine what the next INSERT_ID would be if I were to insert a
> new record?
> 
> Thanks,
> 
> Eric

Select max(key)+1 as nextkey from table

should work.

gtoomey


------------------------------

Date: Fri, 23 Jan 2004 12:04:02 -0000
From: "Eric" <Eric@nowhere.com>
Subject: Re: Perl MySQL NEXT_INSERT_ID?
Message-Id: <bur2ig$vpr$1@newsg2.svr.pol.co.uk>

> > I know I can get LAST_INSERT_ID from a MySQL database... but is there a
> > way to determine what the next INSERT_ID would be if I were to insert a
> > new record?
>
> Select max(key)+1 as nextkey from table

Surely that will only work if there's not been any record deletions since
the last inserion?

Eric




------------------------------

Date: Fri, 23 Jan 2004 07:48:19 -0500
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: Perl MySQL NEXT_INSERT_ID?
Message-Id: <20040123074613.R15931@dishwasher.cs.rpi.edu>

On Fri, 23 Jan 2004, Eric wrote:

> Hi,
>
> I know I can get LAST_INSERT_ID from a MySQL database... but is there a way
> to determine what the next INSERT_ID would be if I were to insert a new
> record?
>
> Thanks,
>
> Eric

http://www.mysql.com/doc/en/SHOW_TABLE_STATUS.html

Run the query SHOW TABLE STATUS on your table, and find the value of the
column "auto_increment".  This will give you the next auto-incrementing id
value.

Paul Lalli



------------------------------

Date: Fri, 23 Jan 2004 14:59:17 -0000
From: "Eric" <Eric@nowhere.com>
Subject: Re: Perl MySQL NEXT_INSERT_ID?
Message-Id: <burcr2$59d$1@newsg1.svr.pol.co.uk>

> > I know I can get LAST_INSERT_ID from a MySQL database... but is there a
way
> > to determine what the next INSERT_ID would be if I were to insert a new
> > record?
>
> http://www.mysql.com/doc/en/SHOW_TABLE_STATUS.html
>
> Run the query SHOW TABLE STATUS on your table, and find the value of the
> column "auto_increment".  This will give you the next auto-incrementing id
> value.

Thank you. That works a treat!

Eric




------------------------------

Date: Fri, 23 Jan 2004 19:01:59 +0000
From: Andy Hassall <andy@andyh.co.uk>
Subject: Re: Perl MySQL NEXT_INSERT_ID?
Message-Id: <vpr2109e27o0t65bshh39acvkm5jkj5oel@4ax.com>

On Fri, 23 Jan 2004 07:48:19 -0500, Paul Lalli <ittyspam@yahoo.com> wrote:

>On Fri, 23 Jan 2004, Eric wrote:
>
>> I know I can get LAST_INSERT_ID from a MySQL database... but is there a way
>> to determine what the next INSERT_ID would be if I were to insert a new
>> record?

 Not reliably, no. You can only get the ID after you insert the record.

>http://www.mysql.com/doc/en/SHOW_TABLE_STATUS.html
>
>Run the query SHOW TABLE STATUS on your table, and find the value of the
>column "auto_increment".  This will give you the next auto-incrementing id
>value.

 ... at the time of the call.

 You then have a race condition if you rely on that value, since there's
nothing stopping it being taken by another session in the meantime.

-- 
Andy Hassall <andy@andyh.co.uk> / Space: disk usage analysis tool
<http://www.andyh.co.uk> / <http://www.andyhsoftware.co.uk/space>


------------------------------

Date: Sat, 24 Jan 2004 13:50:00 +0000
From: pkent <pkent77tea@yahoo.com.tea>
Subject: Re: Perl MySQL NEXT_INSERT_ID?
Message-Id: <pkent77tea-91BF1E.13500024012004@pth-usenet-01.plus.net>

In article <bur1da$87n$1@news5.svr.pol.co.uk>,
 "Eric" <Eric@nowhere.com> wrote:

> I know I can get LAST_INSERT_ID from a MySQL database... but is there a way
> to determine what the next INSERT_ID would be if I were to insert a new
> record?

perldoc DBD::mysql says:

Statement Handles
 ...
mysql_insertid 
MySQL has the ability to choose unique key values automatically. If this 
happened, the new ID will be stored in this attribute.

So you'd access this as $sth->{'mysql_insertid'}


You can't really know what the next one _will_ be, because you don't 
know what else has been inserted since you got that value back. It may 
be nothing, in which case you can just add on one (assuming the value 
doesn't overflow), but if 3 people have added records then you need to 
add on 4, but you don't know that. However you do it you'll get a race 
condition and you'll never know the next ID for sure until you actually 
do an insert and see what value was actually used.

Why do you need to know what this next value will be? There may be 
another way to do this.

P

-- 
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 6033
***************************************


home help back first fref pref prev next nref lref last post