Hi, I need to chope the header and footer record from an input file and make a new output file, please let me know how i can do it in unix.thanks. (4 Replies)
hi
Is there any way to automatically insert a predefined header into a file?
It would include the file name, author name, date and a description, the description entered on the first line of vi.
Thanks for any help
Oliver (4 Replies)
All,
I have a task to search through several hundred files and extract duplicate detail records and keep them grouped with their header record. If no duplicate detail record exists, don't pull the header. For example, an input file could look like this:
input.txt
HA
D1
D2
D2
D3
D4
D4... (17 Replies)
I am using HP UX and think this may be done with awk but bot sure.
I have a file with a several header records and undeneath many detail records I need to put in the header record the number of detail records above this header record and number of detail records below this header record
Header... (5 Replies)
Hello,
after 9 months of archiving 1000 files,
now, i need to change the order of fields in the header record.
some very large, space padded files.
HEADERCAS05212008D0210DOMEST01(spacepadded to record length 210)
must now be
05212008HEADERCASD0210DOMEST01(spacepadded to record length 210)
... (1 Reply)
Guys....
Got a scenario in which I need to skip parsing the header record while I do an awk.
Does awk has the flexibility to accomplish this?.
If so, how do we do this?.
Thanks !!!
-Anduzzi :) (2 Replies)
All,
I currently have a requirement to fetch a Date value from a table. And then insert a Header record into a file along with that date value.
ex:
echo "HDR"" "`date +%Y%j` `date +%Y%m%d`
In the above example I used julian date and standard date using Current Date. But the requirement... (0 Replies)
I have the following scenario where I need to use a header record from a file and generate a DML based off of it...
E.g.: The header can change periodically with an additional column in between or remove a col....
Sample header : (head -1 sample.txt)... (17 Replies)
I have a EBCDIC multi layout file which has a header record which is 21 bytes, The Detail records are 2427 bytes long and the trailer record is 9 bytes long.
Is there a command to remove the header as well as trailer record and read only the detail records while at the same time not altering... (1 Reply)
Hi,
I have a backup report that unfortunately has some kind of hanging indent thing where the first line contains one column more than the others
I managed to get the output that I wanted using awk, but just wanting to know if there is short way of doing it using the same awk
Below is what... (2 Replies)
Discussion started by: newbie_01
2 Replies
LEARN ABOUT PHP
maxdb_stmt_sqlstate
MAXDB_STMT_SQLSTATE(3) 1 MAXDB_STMT_SQLSTATE(3)maxdb_stmt_sqlstate - Returns SQLSTATE error from previous statement operationSYNOPSIS
string maxdb_stmt_sqlstate (resource $stmt)
DESCRIPTION
Returns a string containing the SQLSTATE error code for the most recently invoked prepared statement function that can succeed or fail.
The error code consists of five characters. '00000' means no error. The values are specified by ANSI SQL and ODBC.
Note
Note that not all MaxDB errors are yet mapped to SQLSTATE's. The value HY000 (general error) is used for unmapped errors.
RETURN VALUES
Returns a string containing the SQLSTATE error code for the last error. The error code consists of five characters. '00000' means no
error.
EXAMPLES
Example #1
Object oriented style
<?php
/* Open a connection */
$maxdb = new maxdb("localhost", "MONA", "RED", "DEMODB");
/* check connection */
if (maxdb_connect_errno()) {
printf("Connect failed: %s
", maxdb_connect_error());
exit();
}
$maxdb->query("CREATE TABLE temp.mycity LIKE hotel.city");
$maxdb->query("INSERT INTO temp.mycity SELECT * FROM hotel.city");
$query = "SELECT name, zip FROM temp.mycity ORDER BY name";
if ($stmt = $maxdb->prepare($query)) {
/* drop table */
$maxdb->query("DROP TABLE temp.mycity");
/* execute query */
$stmt->execute();
printf("Error: %s.
", $stmt->sqlstate);
/* close statement */
$stmt->close();
}
/* close connection */
$maxdb->close();
?>
Example #2
Procedural style
<?php
/* Open a connection */
$link = maxdb_connect("localhost", "MONA", "RED", "DEMODB");
/* check connection */
if (maxdb_connect_errno()) {
printf("Connect failed: %s
", maxdb_connect_error());
exit();
}
maxdb_query($link, "CREATE TABLE temp.mycity LIKE hotel.city");
maxdb_query($link, "INSERT INTO temp.mycity SELECT * FROM hotel.city");
$query = "SELECT name, zip FROM temp.mycity ORDER BY name";
if ($stmt = maxdb_prepare($link, $query)) {
/* drop table */
maxdb_query($link, "DROP TABLE temp.mycity");
/* execute query */
maxdb_stmt_execute($stmt);
printf("Error: %s.
", maxdb_stmt_sqlstate($stmt));
/* close statement */
maxdb_stmt_close($stmt);
}
/* close connection */
maxdb_close($link);
?>
The above example will output something similar to:
Warning: maxdb_stmt_execute(): -4004POS(23) Unknown table name:MYCITY [42000] <...>
Error: 42000.
SEE ALSO maxdb_stmt_errno(3), maxdb_stmt_error(3).
PHP Documentation Group MAXDB_STMT_SQLSTATE(3)