473,800 Members | 2,406 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

45 New Member
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 3154
Atli
5,058 Recognized Expert Expert
Hi.

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
boss1
45 New Member
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.acu lly 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
Atli
5,058 Recognized Expert Expert
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.
Sorry.
Oct 3 '07 #4
boss1
45 New Member
[hi,Atali

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
boss1
45 New Member
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");
  2.  
  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;
  23.  
  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)");
  30.  
  31.     echo $third1;
  32.  
  33.  
  34. fclose($file);
  35. fclose($file1);
  36. fclose($file2);
  37.  
  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
boss1
45 New Member
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
pbmods
5,821 Recognized Expert Expert
Merged duplicate threads.
Oct 23 '07 #8

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

Similar topics

2
16676
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 V8.1.6.0.0 - Production vsnsta=0 vsnsql=e vsnxtr=3 Windows 2000 Version 5.0 , CPU type 586
1
5936
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: Thurs, Mar 17 2005 5:40 am Subject: Read Text file into Oracle Reports Reply | Reply to Author | Forward | Print | Individual Message | Show original | Remove | Report Abuse
2
4873
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 to get max date. Where and what DTS task should I use to complete the job? Data Driven Query? Transform data task? How ? can u give me samples. Perhaps you can email me the Demo Package as well.
5
7411
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 help.
0
1715
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 application running on the scanners executes Web service methods, which in turn execute Oracle database functions. The Web service and the Oracle database are running on separate servers. The Web service uses the Microsoft OLE DB driver for Oracle....
1
1454
by: Karan | last post by:
Directly transfer data from text file to oracle
4
2058
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 "SearchResult.aspx". "SearchForm.aspx" houses a Form with a select list & 2 TextBoxes. The select list is populated from a Access database table. When the Form is submitted, the user is taken to "SearchResult.aspx" which retrieves & displays the...
1
5360
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 the I dont need filtering in Oracle, but only indexing. If I put file references to the filtered files in the database and index these (using FILE_DATASTORE), everything works fine. But I rather put the filtered data in the database, and index it...
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10275
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.