in reply to Re^4: String Search
in thread String Search

So you have a "sort of human readable" text dump of a CDR Database (telephone call records, or Call Data Recording). You are trying to generate a report from this text dump.

First, I would say: WRONG approach. This CDR database is extremely likely to be a pretty darn fancy thing that understands SQL queries (probability approaches 1.0).

Perl is fantastic at DB and SQL stuff. That is the right approach for what you need. Forget this text dump of a complex OO DB! Start thinking about how to connect to this server with the CDR records and what questions you would like to ask it. Perl can connect to SQL DB's and get that job done extremely well!

Go do some homework about (a) what you want to know, (b) simple SQL syntax, (c) run some queries from your terminal at the UI level, then come back and ask about how Perl can make magic happen with that process.

Summary:
WRONG: using text dump of OO DB.
RIGHT: talk to the DB server.

Replies are listed 'Best First'.
Re^6: String Search
by kallol.chakra (Initiate) on Aug 31, 2009 at 12:31 UTC

    Hi Marshall, Thanks a lot for your king help. But I have already thouht that approach also. The logic I had thought as Find the data and insert the data into table But some problem will arise for that. 1. The database we are using as Oracle Database. 2. The table where I will insert the data is very big table and there will lacs of files where every file may be have 1000 records , so it will take hugh time to load into database. 3. Better approach I think SQL*Loader. Because perl is very useful to format the data into "," separated file and SQL*Loader always very fast to load data into table. Your Help is reqired here

      Great! We are making some progress!
      1. You do have a professional grade Database.
      2. It can definitely do SQL stuff.

      From your description of "lots of files with up to 1,000 records", I figure we are talking about a lot less than 1 million records.

      I don't understand the "problem". You are getting this stuff from an Oracle DB and it is going into another Oracle DB. Oracle has tools that can do this very efficiently. One thing to think about is that: what the heck, even if this takes 12 hours, you would already be done in the time its taken to discuss this on Monks!

      As far as generating a CSV, Comma Separated Value file goes, your Oracle DB can do that itself. The command for this report will probably be complex, but the DB can do it. But even more efficient will be the merging tools that Oracle provides, or so I suspect. And I think there are some very good reasons for suspecting that.

      At this point, I would ask any Monk who knows about Oracle to give advice. Perl may play a role in this DB merge, but I don't think that it will be the "star" player.

        Marshall,

        I got an idea for this. Please find the structure:

        1> we can declare structure in C for same structure as the data.

        2> Then create link list for the stucture.

        3> Map the data with the structure with the structure and allocate memory dynamically as each structure.

        4> Search the data and extract the data from leaf to root.

        Please help me whether I am right or wrong..

        Regards,