Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Any good Perl coders out there?

Reply
Thread Tools

Any good Perl coders out there?

 
 
amerar@iwc.net
Guest
Posts: n/a
 
      03-21-2007
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];
..
..
..
}

 
Reply With Quote
 
 
 
 
Michael Vilain
Guest
Posts: n/a
 
      03-21-2007
In article <. com>,
"" <> 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...



 
Reply With Quote
 
 
 
 
amerar@iwc.net
Guest
Posts: n/a
 
      03-21-2007
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.

 
Reply With Quote
 
Chris Scholz
Guest
Posts: n/a
 
      03-21-2007
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/
 
Reply With Quote
 
Michael Vilain
Guest
Posts: n/a
 
      03-21-2007
In article < .com>,
"" <> 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...



 
Reply With Quote
 
Timo Jokinen
Guest
Posts: n/a
 
      03-21-2007
Michael Vilain wrote:
> In article <. com>,
> "" <> 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


 
Reply With Quote
 
Jamie
Guest
Posts: n/a
 
      03-21-2007
In <GMhMh.21970$> ,
Timo Jokinen <> mentions:
>Michael Vilain wrote:
>> In article <. com>,
>> "" <> 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
 
Reply With Quote
 
Keith Keller
Guest
Posts: n/a
 
      03-21-2007
On 2007-03-21, Jamie <> wrote:
> In <GMhMh.21970$> ,
> Timo Jokinen <> 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-
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information

 
Reply With Quote
 
Michael Carman
Guest
Posts: n/a
 
      04-02-2007
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
 
Reply With Quote
 
Uri Guttman
Guest
Posts: n/a
 
      04-02-2007
>>>>> "f" == fishfry <> 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 ------ -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
501 PIX "deny any any" "allow any any" Any Anybody? Networking Student Cisco 4 11-16-2006 10:40 PM
Ex-Perl coders: Howz it feel to convert to Ruby? Chris Ruby 88 09-28-2004 01:04 PM
just curious about perl coders Robin Perl Misc 3 04-04-2004 08:27 AM
Perl, PHP, ASP, XML, Java, C++ Coders NEEDED ZfUpR Lois Parker Java 4 12-12-2003 09:31 PM
Perl, PHP, ASP, XML, Java, C++ Coders NEEDED YDvnz Kathy Rogers Java 0 12-11-2003 09:51 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57