Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Need help to correct a simple script

by marto (Bishop)
on Jan 07, 2013 at 15:42 UTC ( #1012049=note: print w/replies, xml ) Need Help??

in reply to Need help to correct a simple script

Hi, at first glance


Should be:


Also Oracle will complain about that SQL statement:

CREATE TABLE test_data($count)(

Shoud be:

CREATE TABLE test_data$count(

See Use strict and warnings, Create Table and the DBI documentation. Pay attention to the section on placeholders and bind variables.

Update: At second glance there's other problems. Let me fix this and update.

Update 2:

With Oracle (and perhaps other databases) Bind variables can be used for DML (Select, insert) but not DDL (Create, Alter, Drop) statements. (See What are the difference between DDL, DML and DCL commands?). This means that my previous advice on placeholders and bind variables won't help you much, though the topic is still worth reading. I'd try to create a stored procedure within Oracle to do the table create, and call if from your Perl script passing in the appropriate table name.

Replies are listed 'Best First'.
Re^2: Need help to correct a simple script
by space_monk (Chaplain) on Jan 08, 2013 at 09:52 UTC
    With respect to Update 2, you also can't use bind variables in respect of table names - see comment below.
    A Monk aims to give answers to those who have none, and to learn from those who know more.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1012049]
[msh210]: oh, good point. It's the best kind of correct
[shmem]: msh210: but I'd not call it a lie outright. That's when you do know the truth.
[msh210]: I don't have sendmail (I'm on MS Windows), so does one of you think you can report the bug?
[shmem]: msh210: 'tis about time to tell the sad truth to perl5porters - via perlbug
[msh210]: probably whoever wrote that actually knows the truth
[shmem]: msh210: you can save the perlbug text in a file and send that via your mail agent of choice
[msh210]: hm, okay, I'll try, thanks
[shmem]: ...not as an attachment, it's probably better to c&p that into the mail body

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (12)
As of 2017-04-24 12:49 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (439 votes). Check out past polls.