Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   Any good Perl coders out there? (http://www.velocityreviews.com/forums/t902348-any-good-perl-coders-out-there.html)

amerar@iwc.net 03-21-2007 04:14 PM

Any good Perl coders out there?
 
Hi All,

I need to convert a PHP script into Perl. This PHP script interacts
with our Oracle database. It executes some stored procedures and
returns values. I've pasted the PHP code below, I'm just not sure how
to code it in Perl & DBI. Can anyone help?? I would really
appreciate it.

PHP CODE
----------------
$conn = ociplogon("scott", "tiger", "ABCD.world");
$curs = OCINewCursor($conn);
$stmt = OCIParse($conn,"BEGIN AUTO_CHARGE.EXP_RENEW_SUBSCR(:data);
end ;");
ocibindbyname($stmt,"data",&$curs,-1,OCI_B_CURSOR);
ociexecute($stmt);
ociexecute($curs);

while (OCIFetchInto($curs,&$data)) {
$customer_id = $data[0];
$owner_name = $data[1];
$type = $data[2];
$code = $data[3];
..
..
..
}


Michael Vilain 03-21-2007 06:52 PM

Re: Any good Perl coders out there?
 
In article <1174493670.753360.57970@n76g2000hsh.googlegroups. com>,
"amerar@iwc.net" <amerar@iwc.net> wrote:

> Hi All,
>
> I need to convert a PHP script into Perl. This PHP script interacts
> with our Oracle database. It executes some stored procedures and
> returns values. I've pasted the PHP code below, I'm just not sure how
> to code it in Perl & DBI. Can anyone help?? I would really
> appreciate it.
>
> PHP CODE
> ----------------
> $conn = ociplogon("scott", "tiger", "ABCD.world");
> $curs = OCINewCursor($conn);
> $stmt = OCIParse($conn,"BEGIN AUTO_CHARGE.EXP_RENEW_SUBSCR(:data);
> end ;");
> ocibindbyname($stmt,"data",&$curs,-1,OCI_B_CURSOR);
> ociexecute($stmt);
> ociexecute($curs);
>
> while (OCIFetchInto($curs,&$data)) {
> $customer_id = $data[0];
> $owner_name = $data[1];
> $type = $data[2];
> $code = $data[3];
> .
> .
> .
> }


Gee, your boss should know you're in over your head and completely
incompetent. Where do you work?

--
DeeDee, don't press that button! DeeDee! NO! Dee...




amerar@iwc.net 03-21-2007 06:54 PM

Re: Any good Perl coders out there?
 
On Mar 21, 1:52 pm, Michael Vilain <vil...@spamcop.net> wrote:
> In article <1174493670.753360.57...@n76g2000hsh.googlegroups. com>,
>
>
>
>
>
> "ame...@iwc.net" <ame...@iwc.net> wrote:
> > Hi All,

>
> > I need to convert a PHP script into Perl. This PHP script interacts
> > with our Oracle database. It executes some stored procedures and
> > returns values. I've pasted the PHP code below, I'm just not sure how
> > to code it in Perl & DBI. Can anyone help?? I would really
> > appreciate it.

>
> > PHP CODE
> > ----------------
> > $conn = ociplogon("scott", "tiger", "ABCD.world");
> > $curs = OCINewCursor($conn);
> > $stmt = OCIParse($conn,"BEGIN AUTO_CHARGE.EXP_RENEW_SUBSCR(:data);
> > end ;");
> > ocibindbyname($stmt,"data",&$curs,-1,OCI_B_CURSOR);
> > ociexecute($stmt);
> > ociexecute($curs);

>
> > while (OCIFetchInto($curs,&$data)) {
> > $customer_id = $data[0];
> > $owner_name = $data[1];
> > $type = $data[2];
> > $code = $data[3];
> > .
> > .
> > .
> > }

>
> Gee, your boss should know you're in over your head and completely
> incompetent. Where do you work?
>
> --
> DeeDee, don't press that button! DeeDee! NO! Dee...- Hide quoted text -
>
> - Show quoted text -


I think your Father sexually abused you, which is why you have such a
disgusting personality.


Chris Scholz 03-21-2007 07:21 PM

Re: Any good Perl coders out there?
 
amerar@iwc.net schrieb:
> Hi All,
>
> I need to convert a PHP script into Perl. This PHP script interacts
> with our Oracle database. It executes some stored procedures and
> returns values. I've pasted the PHP code below, I'm just not sure how
> to code it in Perl & DBI. Can anyone help?? I would really
> appreciate it.


http://learn.perl.org/

Michael Vilain 03-21-2007 07:32 PM

Re: Any good Perl coders out there?
 
In article <1174503269.831017.314720@y80g2000hsf.googlegroups .com>,
"amerar@iwc.net" <amerar@iwc.net> wrote:

> On Mar 21, 1:52 pm, Michael Vilain <vil...@spamcop.net> wrote:
> > In article <1174493670.753360.57...@n76g2000hsh.googlegroups. com>,
> >
> >
> >
> >
> >
> > "ame...@iwc.net" <ame...@iwc.net> wrote:
> > > Hi All,

> >
> > > I need to convert a PHP script into Perl. This PHP script interacts
> > > with our Oracle database. It executes some stored procedures and
> > > returns values. I've pasted the PHP code below, I'm just not sure how
> > > to code it in Perl & DBI. Can anyone help?? I would really
> > > appreciate it.

> >
> > > PHP CODE
> > > ----------------
> > > $conn = ociplogon("scott", "tiger", "ABCD.world");
> > > $curs = OCINewCursor($conn);
> > > $stmt = OCIParse($conn,"BEGIN AUTO_CHARGE.EXP_RENEW_SUBSCR(:data);
> > > end ;");
> > > ocibindbyname($stmt,"data",&$curs,-1,OCI_B_CURSOR);
> > > ociexecute($stmt);
> > > ociexecute($curs);

> >
> > > while (OCIFetchInto($curs,&$data)) {
> > > $customer_id = $data[0];
> > > $owner_name = $data[1];
> > > $type = $data[2];
> > > $code = $data[3];
> > > .
> > > .
> > > .
> > > }

> >
> > Gee, your boss should know you're in over your head and completely
> > incompetent. Where do you work?
> >
> > --
> > DeeDee, don't press that button! DeeDee! NO! Dee...- Hide quoted text -
> >
> > - Show quoted text -

>
> I think your Father sexually abused you, which is why you have such a
> disgusting personality.


Actually, IIRC, it was your father. I recall a mole on his left buttock
and another in an improbable and generally hard to access location. Oh,
and your mom says "Hello". But I degress.

There are CPAN libraries you can download and build to add Oracle
connectivity to your perl installation. Writing the code won't help you
if your perl installation doesn't know how to access the database.
Start by using Google to find sites that describe what you're attempting
to do (rather than get someone else to do it for you).

http://www.perl.com/pub/a/2003/10/23/databases.html
http://www.xml.com/pub/a/2000/12/13/perlxmldb.html

Seriously, if you expect someone to do your homework or job for you
without the slightest shred of effort on your part, you're going to be
sadly disappointed in this life. Where do you work?

--
DeeDee, don't press that button! DeeDee! NO! Dee...




Timo Jokinen 03-21-2007 09:50 PM

Re: Any good Perl coders out there?
 
Michael Vilain wrote:
> In article <1174493670.753360.57970@n76g2000hsh.googlegroups. com>,
> "amerar@iwc.net" <amerar@iwc.net> wrote:
>
>> Hi All,
>>
>> I need to convert a PHP script into Perl. This PHP script interacts
>> with our Oracle database. It executes some stored procedures and
>> returns values. I've pasted the PHP code below, I'm just not sure how
>> to code it in Perl & DBI. Can anyone help?? I would really
>> appreciate it.
>>
>> PHP CODE
>> ----------------
>> $conn = ociplogon("scott", "tiger", "ABCD.world");
>> $curs = OCINewCursor($conn);
>> $stmt = OCIParse($conn,"BEGIN AUTO_CHARGE.EXP_RENEW_SUBSCR(:data);
>> end ;");
>> ocibindbyname($stmt,"data",&$curs,-1,OCI_B_CURSOR);
>> ociexecute($stmt);
>> ociexecute($curs);
>>
>> while (OCIFetchInto($curs,&$data)) {
>> $customer_id = $data[0];
>> $owner_name = $data[1];
>> $type = $data[2];
>> $code = $data[3];
>> .
>> .
>> .
>> }

>
> Gee, your boss should know you're in over your head and completely
> incompetent. Where do you work?
>

Sorry but if you doesn't want to help him/her don't bother to
write your sarcastic's answer's.

cheers
-timppa



Jamie 03-21-2007 10:07 PM

Re: Any good Perl coders out there?
 
In <GMhMh.21970$Uk6.15371@reader1.news.saunalahti.fi> ,
Timo Jokinen <jokinentimo@kolumbus.fi.invalid> mentions:
>Michael Vilain wrote:
>> In article <1174493670.753360.57970@n76g2000hsh.googlegroups. com>,
>> "amerar@iwc.net" <amerar@iwc.net> wrote:
>>
>>> Hi All,
>>>
>>> I need to convert a PHP script into Perl. This PHP script interacts
>>> with our Oracle database. It executes some stored procedures and
>>> returns values. I've pasted the PHP code below, I'm just not sure how
>>> to code it in Perl & DBI. Can anyone help?? I would really
>>> appreciate it.
>>>
>>> PHP CODE
>>> ----------------
>>> $conn = ociplogon("scott", "tiger", "ABCD.world");
>>> $curs = OCINewCursor($conn);
>>> $stmt = OCIParse($conn,"BEGIN AUTO_CHARGE.EXP_RENEW_SUBSCR(:data);
>>> end ;");
>>> ocibindbyname($stmt,"data",&$curs,-1,OCI_B_CURSOR);
>>> ociexecute($stmt);
>>> ociexecute($curs);
>>>
>>> while (OCIFetchInto($curs,&$data)) {
>>> $customer_id = $data[0];
>>> $owner_name = $data[1];
>>> $type = $data[2];
>>> $code = $data[3];
>>> .
>>> .
>>> .
>>> }


>Sorry but if you doesn't want to help him/her don't bother to
>write your sarcastic's answer's.


Well said!

This is part of the reason perl is loosing ground to other languages like PHP.


Here we have a perfectly good opportunity to introduce someone to the wonders
of perl and we've thrown it away. The original poster will probably walk away
from all this thinking

"Perl? phew! no thanks!"


As far as offering a helpful answer, (to the original post) what you'll want to
do is check out the DBI and DBD modules at your friendly neighborhood CPAN
archive.

DBI is the modern way perl programs communicate with databases, DBI is a
generic interface. DBD is the actual database driver for it. (there is
one DBI and separate DBD's for each particular database.)

You'll find that with with the standard interface of DBI, porting your
application to other databases is a bit easier.

Do a 'perldoc DBI' for the details, it's quite easy once you get around to
understanding statement handles and connection handles. (these are a bit like
Resource handles of PHP)

You'll also want to glance over the DBD driver for oracle to find the connection
string details.

Jamie
--
http://www.geniegate.com Custom web programming
Perl * Java * UNIX User Management Solutions

Keith Keller 03-21-2007 10:24 PM

Re: Any good Perl coders out there?
 
On 2007-03-21, Jamie <nospam@geniegate.com> wrote:
> In <GMhMh.21970$Uk6.15371@reader1.news.saunalahti.fi> ,
> Timo Jokinen <jokinentimo@kolumbus.fi.invalid> mentions:
>
>>Sorry but if you doesn't want to help him/her don't bother to
>>write your sarcastic's answer's.

>
> Well said!
>
> This is part of the reason perl is loosing ground to other languages like PHP.


I'm sure you have data to support this claim!

(not advocating answering questions sarcastically, I just doubt your
claim)

--keith


--
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information


Michael Carman 04-02-2007 03:49 AM

Re: Any good Perl coders out there?
 
fishfry:
> Jamie:
>> Timo Jokinen:
>>>
>>> Sorry but if you doesn't want to help him/her don't bother to write your
>>> sarcastic's answer's.

>>
>> This is part of the reason perl is loosing ground to other languages like
>> PHP.


If you think that all Perl is good for is CGI, then you have a lot to learn.

>> Here we have a perfectly good opportunity to introduce someone to the
>> wonders of perl and we've thrown it away. The original poster will probably
>> walk away from all this thinking "Perl? phew! no thanks!"


If it means one less person coming here looking for someone do to their
job/homework for them the old timers will be pleased.

> This newsgroup has had an attitude problem from day one.


It can be blunt at the best of times, but you shouldn't take that personally.

As far as "help me!" threads go, I'd rather scare off the gimme gimme crowd (who
have nothing to contribute) than drive away the experts.

The people here are very happy to help *if* you make a genuine effort to figure
things out yourself first. Repeat after me: "Usenet is not a helpdesk."

> A PHP programmer comes here with a request for a how-to on the standard db
> connection/retrieval syntax...


It didn't look that way to me. It looked like he wanted someone to write the
code for him. There's nothing wrong with that, but those sorts of things belong
in a jobs newsgroup, not a discussion one.

-mjc

Uri Guttman 04-02-2007 03:52 AM

Re: Any good Perl coders out there?
 
>>>>> "f" == fishfry <BLOCKSPAMfishfry@your-mailbox.com> writes:


f> I'm happy to add a hearty Me Too to this thread. This newsgroup has
f> had an attitude problem from day one. I don't know if the
f> newsgroup's attitude correlates with the decline of Perl as a
f> development language; but it certainly isn't helping any.

perl isn't in any decline. just that more kiddies who can't code are
using php. fine with us. perl is used for much more outside the web
anyhow. ever heard php called the ducttape of the internet?

f> A PHP programmer comes here with a request for a how-to on the
f> standard db connection/retrieval syntax; and he gets a hearty ****
f> YOU from several different people. It's really sad.

well, did you try to help him? no. the bitching types are always the
ones who never offer help. 100% of the time this is the case. so you
help all those php kiddies who wander into here asking for help. notice
that they don't ask in the php groups since they are populated by more
of the kiddies who cut/paste and don't know actually how to
program. everyone comes to the perl group as they claim we are
smarter. hmmm, smarter coders use perl but perl is losing ground. sounds
like the kiddies are learning that php is not as good as they hoped and
they will never learn more from their fellow php kiddies. too bad.

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


All times are GMT. The time now is 07:13 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.