Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^3: Relational table with perl DBI

by poj (Prior)
on Mar 14, 2013 at 10:43 UTC ( #1023455=note: print w/replies, xml ) Need Help??

in reply to Re^2: Relational table with perl DBI
in thread Relational table with perl DBI

It looks to me like this code has the potential to give you the same event more than once in the event table each with a different id.
if ($_ =~ /=E-(.*)=event/){ $event = $1; push @event_prepare, $event; }
It would be much simpler to forget using numerical keys and just use the $event itself as the primary key. Use a hash to eliminate duplicates like this ;
if ($_ =~ /=E-(.*)=event/){ $event_prepare{$1} = 1; }
With regard to the article table, I would use the n value from the filename outputcondord.n.txt as the primary key thus avoiding sorting and synchronising problems as well as making the data in the table more human readable. Your article_event_index would then just need to contain the n value from the filename and the text from the events in that file.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1023455]
[trahulprajapati]: Hi All
[trahulprajapati]: can anyone please help me to login to a form which uses javascript ?

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2017-06-22 17:06 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (525 votes). Check out past polls.