DBASE_REPLACE_RECORD(3) 1 DBASE_REPLACE_RECORD(3)dbase_replace_record - Replaces a record in a databaseSYNOPSIS
bool dbase_replace_record (int $dbase_identifier, array $record, int $record_number)
DESCRIPTION
Replaces the given record in the database with the given data.
PARAMETERS
o $dbase_identifier
- The database link identifier, returned by dbase_open(3) or dbase_create(3).
o $record
- An indexed array of data. The number of items must be equal to the number of fields in the database, otherwise
dbase_replace_record(3) will fail.
Note
If you're using dbase_get_record(3) return value for this parameter, remember to reset the key named deleted.
o $record_number
- An integer which spans from 1 to the number of records in the database (as returned by dbase_numrecords(3)).
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Updating a record in the database
<?php
// open in read-write mode
$db = dbase_open('/tmp/test.dbf', 2);
if ($db) {
// gets the old row
$row = dbase_get_record_with_names($db, 1);
// remove the 'deleted' entry
unset($row['deleted']);
// Update the date field with the current timestamp
$row['date'] = date('Ymd');
// Replace the record
dbase_replace_record($db, $row, 1);
dbase_close($db);
}
?>
SEE ALSO dbase_add_record(3), dbase_delete_record(3).
PHP Documentation Group DBASE_REPLACE_RECORD(3)
Check Out this Related Man Page
PX_GET_RECORD(3)PX_GET_RECORD(3)px_get_record - Returns record of paradox databaseSYNOPSIS
array px_get_record (resource $pxdoc, int $num, [int $mode])
DESCRIPTION PARAMETERS
o $pxdoc
- Resource identifier of the paradox database as returned by px_new(3).
o $num
- The record number is an artificial number counting records in the order as they are stored in the database. The first record has
number 0.
o $mode
- The optional $mode can be PX_KEYTOLOWER or PX_KEYTOUPPER in order to convert the keys of the returned array into lower or upper
case. If $mode is not passed or is 0, then the key will be exactly like the field name. The element values will contain the field
values. NULL values will be retained and are different from 0.0, 0 or the empty string. Fields of type PX_FIELD_TIME will be
returned as an integer counting the number of milliseconds starting at midnight. A timestamp ( PX_FIELD_TIMESTAMP) and date (
PX_FIELD_DATE) are floating point respectively int values counting milliseconds respectively days starting at the beginning of
julian calendar. Use the functions px-timestamp2string(3) and px-date2string(3) to convert them into a character representation.
RETURN VALUES
Returns the $num'th record from the paradox database. The record is returned as an associated array with its keys being the field names.
SEE ALSO px_retrieve_record(3).
PHP Documentation Group PX_GET_RECORD(3)
I am trying to use two files and walk through the first one to see if a value from each record resides in the other file.
I am reading the file record by record and awking out the first field into a varaiable. That is working fine.
When I try to write my grep command it gives me an error.
... (7 Replies)
Hi
I need to do some thing like "find and insert before that " in a file which contains many records. This will be clear with the following example.
The original data record should be some thing like this
60119827 RTMS_LOCATION_CDR INSTANT_POSITION_QUERY 1236574686123083rtmssrv7 ... (8 Replies)
Can someone tell me, how do i write a recursive code using shell ( eg like 'for' loop in C) which outputs the record to a database table as one row per iteration? (7 Replies)
Hi,
I want to test a var, $inputPin to see if is 3 digits in a row or not in a Bash script.
I am getting stuck on the regex to do this.
And the equality test if it is in an if statement as below?
-ne is for comparing numbers
But I guess it would be != in this case
if \{3,3\]}]
... (6 Replies)
Hi, I am trying to remove the carriage return on the record which starts with ADD, MODIFY, or DELETE keyword as the first value in the record. If the records does not start with anyone of these keywords then combine the records with the previous record (line).
Input
File name xyz.txt... (6 Replies)
Hi Forum.
I searched the forum for a solution but could not find an exact one to my problem.
I have some records in the file where I would like to convert the last date field to another format while preserving the rest of the other fields.
For example:
Found:... (6 Replies)
Hi All,
I have a file that I would like to search for data and replace other data by record position number:
Example search..
search for "CLARK KENT" and replace Amt data "000025" with "000155"???
I'm able to search and replace unique data but, came to a stump when wanting to replace data... (11 Replies)
Hi,
There were a few files deleted from a server by user xyz.
The file names are:-
/oraextME4/oradata/ME11G22/TEST_IMPORT_01.dbf
/oraextME4/oradata/ME11G22/RKVITR1_03.dbf
/oraextME4/oradata/ME11G22/TEST_IMPORT_02.dbf
need to know the ip address of the terminal from which that... (10 Replies)
Hi all,
I have one file with IDs
Q8NDM7
P0C1S8
Q8TF30
Q9BRP8
O00258
Q6AWC2
Q9ULE0
Q702N8
A4UGR9
Q13426
Q6P2D8
Q9ULM3
A8MXQ7
I want to compare ID file with another file which has complete information about these IDs and also about other IDs which are not in the above ID file. As... (10 Replies)
Dear All,
I am new to UNIX . Please tell me how to retreive row number from the file.
In AS/400 we can retreive RRN(Relative record number ) from the file, In same way what is the option to take relative record number from the file in UNIX.
It may be very easy query, but still I need ur... (9 Replies)
Hello Experts,
Below is the record i have:
sample data attached
I want this record of each row to be in single line and there are multiple rowise unixtime mentioned e.g 11996327 , This needs to be converted to Human readdable data and time from multiple rows
Can you help me , it will be... (10 Replies)
Hi! all
can any one tell me how to compare current record of column with next and previous record in awk without using array
my case is like this
input.txt
0 32
1 26
2 27
3 34
4 26
5 25
6 24
9 23
0 32
1 28
2 15
3 26
4 24 (7 Replies)
Hello
I have been trying to remove a row from a file which has the same first three columns as another row - I have tried lots of different combinations of suggestion on this forum but can't get it exactly right.
what I have is
900 - 1000 = 0
900 - 1000 = 2562
1000 - 1100 = 0
1000 - 1100... (7 Replies)
I have data coming in the below format for each record
<?xml version="1.0" encoding="UTF-8" standalone="no"?><test_sox xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><testdetials>....</test_sox>
<?xml version="1.0" encoding="UTF-8" standalone="no"?><test_sox... (8 Replies)