473,238 Members | 3,152 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,238 software developers and data experts.

How to transfer text file into oracle database by using php?

i have a text file like below: named "rez.text" and
i wnt to transfer each column into oracle database which have the same column name as views here.Every time it will goto database atomatecally after a certaintime like :5 hours.

Date Time Ext CO Dial Number Ring Duration Acc code CD


03/30/02 04:12PM 201 10 7617707 00:00'22

03/30/02 04:12PM 166 01 7112786 00:01'26

03/30/02 04:12PM 200 09 8120500 00:01'20
Sep 29 '07 #1
7 3117
5,058 Expert 4TB

If you want to insert that into your database, you will have to parse it into an array, using the String functions, and insert it into your Oracle database, using the Oracle functions.

Have you made any attempts at this yourself?
Could you share them with us?
Sep 29 '07 #2
hi atli,
thanks for co-operation
i have to develop a pbx call accounting software using oracle and php but i still i have not found any code how to read data from serial port and pull it into database autometically after a fixed amount of time periodiacly.acully i m new in php thats why i don,t know how to do it.

if u could help me by providing php code then i will be gratefull to u.
Oct 2 '07 #3
5,058 Expert 4TB
To trigger a PHP script periodically you could set up a cron job. I have no experience with this but a Google search should provide the information you need.

I've personally never tried to interact with a serial port myself but, again, Google will provide some useful information on the subject.

I can't provide any code for you. Firstly because that is against TSDN posting policy and Secondly, because I don't have any.
Oct 3 '07 #4

thank u for ur cooperation .it would be better for me if provide some clues to insert data(shown as before) from a textfile to database.so that i can understand easily.

or anyone in this forum who can help me?
Oct 7 '07 #5
Hi Atli.
thanks for ur co operation.if u please send me smple code for insert data from text file to related fileds in a table of oracle db.Then it will be easy for me to understand.
i have tried a simple code that is :problem is it doesnt insert morethan 1 row.i want to insert every row in db.

Expand|Select|Wrap|Line Numbers
  1. $file = fopen("raw_data_31_03.txt","rb");
  3. while(! feof($file))
  4.   {
  5.   //echo fgets($file). "<br />";
  6.   $first=trim($first.fgets($file));
  7.   //echo $first;
  8.   }
  9.     $first1= substr($first,0,8);
  10.     //$filewr = fwrite(fopen($first1,"r+"),$tonek,280);
  11.     //mysql_query("insert into test(name) values($first1)");
  12.   echo $first1;
  13. $file1 = fopen("raw_data_31_03.txt","rb");  
  14.   while(! feof($file1))
  15.   {
  16.   //echo fgets($file). "<br />";
  17.   $second=trim($second.fgets($file1));
  18.   //echo $first;
  19.   }
  20.     $second1= substr($second,9,7);
  21.     //mysql_query("insert into test(name1) values($second1)");
  22.   echo $second1;
  24.   while(! feof($file2))
  25.   {
  26.   $third=trim($third.fgets($file2));
  27.   }
  28.     $third1 = substr($third,16,6);
  29.     mysql_query("insert into test(name2) values($third1)");
  31.     echo $third1;
  34. fclose($file);
  35. fclose($file1);
  36. fclose($file2);
  38. ?>
Text file that i want to insert:
03/31/02 04:21PM 136 11 9564499- 00:00'54 TR

03/31/03 04:22PM 202 10 9338340 00:00'00

03/31/04 04:22PM 202 10 8916116 00:00'05

03/31/05 04:23PM 142 06 <I> 0'00 00:00'31 TR

03/31/06 04:23PM 125 08 108 00:00'32

03/31/07 07:51AM 13 <I> 0'05 NA

03/31/08 04:23PM 180 05 9561760 00:03'45 TR

03/31/09 04:24PM 125 04 8126666 00:00'11

03/31/11 04:24PM 201 10 018222255 00:00'12

03/31/22 07:57AM 13 <I> 0'05 NA

03/31/33 04:24PM 202 07 <I> 0'07 00:01'42

03/31/44 04:24PM 201 10 018222255 00:00'02
Oct 7 '07 #6
i have a text file called rez.txt .it contains a large no. of rows.
Each row contains several substrings or words.i want to read each and every substring from row by row and finally insert into a table respect related field.

can anybody help me how to do it by php?
Oct 23 '07 #7
5,821 Expert 4TB
Merged duplicate threads.
Oct 23 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

by: KULJEET | last post by:
control file not created at time of installtion of oracle database now how we can create it see alert file Dump file e:\ORacle\admin\new\bdump\newALRT.LOG Tue Sep 09 10:45:53 2003 ORACLE...
by: rishka | last post by:
Rishka Mar 17, 5:40 am show options Newsgroups: comp.databases.oracle.tools From: "Rishka" <ris...@webmail.co.za> - Find messages by this author Date: 17 Mar 2005 05:40:45 -0800 Local:...
by: fhadlaq | last post by:
I need a little help here.. I want to transfer ONLY new records AND update any modified records from Oracle into SQL Server using DTS. How should I go about it? a) how do I use global variable...
by: Tom | last post by:
Hi I am trying to transfer to a different .ASPX page using Server.Transfer. However, I get the following error: "Error executing child request for .aspx." Anyone know why? Thanks for...
by: Anonymous User | last post by:
Hi, I am working on a mobile application that consists of a number of handheld scanners, an Xml Web service and an Oracle 9i database in a highly secure environment. The .Net Compact Framework...
by: Karan | last post by:
Directly transfer data from text file to oracle
by: rn5a | last post by:
Assume that there's a website named www.abc.com. There are 2 ASPX files & one MS-Access database file in this site. The 1st ASPX file is named "SearchForm.aspx" & the 2nd ASPX file is named...
by: Server Applications | last post by:
Hello I am trying to build a system where I can full-text index documents with UTF8 or UTF16 data using Oracle Text. I am doing the filtering in a third-party component outside the database, so...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.