TABLEAVG=`echo "scale=2; $TABLECHARS/$TABLELINES" | bc -l`
Thanku so much...it works...
But i have a problem...
I have given an if statment stating that if its whole number output the "TABLEAVG"
else
value with decimal...
if [ $TABLEAVG == 29 ]
then
echo "The file is good with count of comma per line : $TABLEAVG"
else
echo "The file is corrupt with commas : $TABLEAVG"
fi
If the output is 29, it displays 29.00 because i have given the sacle..is there any workaround for this..
Does anybody know if HP-UX uses any other directories besides /var/spool/lp/request to spool print jobs? I checked the man pages, and it only mentions /var/spool/lp in general. I was just wondering if anyone knew of some other place it might possibly use. thanks in advance for any help! (2 Replies)
i have a script in which awk prints "($2-1700)/10000"
and the answer is -0.07,but i want the answer in 4 decimal places.
that is -0.0700.
How can i sue awk to get my results in four decimal places (4 Replies)
i need to multiplay a number with 1.00.. so that the output should contain two decimal places at end..
for example...
236 * 1.00 = 236.00
245.8 * 1.00 = 245.80
but when i perform multiplication it shows output as.
236
245.8
can anyone help me to get the actual output of... (11 Replies)
Hi all,
I have to insert underscore at certain places(places before and after PAxxx/PAxxxx entries in a big file like this
ESR1 PA156 leflunomide PA450192
CHST3 PA26503 docetaxel tungstate Pa4586; thalidomide Pa34958;
PAxxx/PAxxxx entries are metioned between 2 names in each row
... (4 Replies)
Below is my requirement.
When I type 'ls' from the command prompt,
1. I need the output/listing to be shown on screen(which happens by default)
2. Also a file named a.txt should be populated with the output of 'ls' comma nd.
How should I do this?
-Yuvaraj. (2 Replies)
cat emp.lst
12 |Rob Cliff |G.M.
14 |Mark Rob |Chairman
Please use awk to invert the names in the file emp.lst, i.e. the surname should be 1st and then the 1st name. There are trailing spaces even in each field making them fixed length. (4 Replies)
Hello Team,
We would like to copy or sync a couple a zpool and all dataset inside between two datacenters one time per day, the structure and space are the same in both sides.
We are consider to use rsync and a cron job.
We would like to know what type of ports we have to open in the... (1 Reply)
I dont know why this Linux would give me badly placed () error all the time for this;
#include <stdio.h>
int main()
{
register int num=0 ;
while ((num < 5))
++num;
printf("Pass %d \n", num) ;
return 0 ;
}
can anyone help me please? (11 Replies)
I used the below script to Sum up a field in a file based on some unique values. But the problem is when it is summing up the units, it is truncating to 2 decimals and not 6 decimals as in the input file (Input file has the units with up to 6 Decimals – Sample data below, when the units in the 2... (4 Replies)
Discussion started by: brlsubbu
4 Replies
LEARN ABOUT PHP
sqlsrv_field_metadata
SQLSRV_FIELD_METADATA(3)SQLSRV_FIELD_METADATA(3)sqlsrv_field_metadata - Retrieves metadata for the fields of a statement prepared bysqlsrv_prepare(3)orsqlsrv_query(3)SYNOPSIS
mixed sqlsrv_field_metadata (resource $stmt)
DESCRIPTION
Retrieves metadata for the fields of a statement prepared by sqlsrv_prepare(3) or sqlsrv_query(3). sqlsrv_field_metadata(3) can be called
on a statement before or after statement execution.
PARAMETERS
o $stmt
- The statment resource for which metadata is returned.
RETURN VALUES
Returns an array of arrays is returned on success. Otherwise, FALSE is returned. Each returned array is described by the following table:
Array returned by sqlsrv_field_metadata
+----------+---------------------------------------------------+
| Key | |
| | |
| | Description |
| | |
+----------+---------------------------------------------------+
| Name | |
| | |
| | The name of the field. |
| | |
| Type | |
| | |
| | The numeric value for the SQL type. |
| | |
| Size | |
| | |
| | The number of characters for fields of character |
| | type, the number of bytes for fields of binary |
| | type, or NULL for other types. |
| | |
|Precision | |
| | |
| | The precision for types of variable precision, |
| | NULL for other types. |
| | |
| Scale | |
| | |
| | The scale for types of variable scale, NULL for |
| | other types. |
| | |
|Nullable | |
| | |
| | An enumeration indicating whether the column is |
| | nullable, not nullable, or if it is not known. |
| | |
+----------+---------------------------------------------------+
For more information, see sqlsrv_field_metadata in the Microsoft SQLSRV documentation.
EXAMPLES
Example #1
sqlsrv_field_metadata(3) example
<?php
$serverName = "serverNamesqlexpress";
$connectionInfo = array( "Database"=>"AdventureWorks", "UID"=>"username", "PWD"=>"password");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false ) {
die( print_r( sqlsrv_errors(), true));
}
$sql = "SELECT * FROM Table_1";
$stmt = sqlsrv_prepare( $conn, $sql );
foreach( sqlsrv_field_metadata( $stmt ) as $fieldMetadata ) {
foreach( $fieldMetadata as $name => $value) {
echo "$name: $value<br />";
}
echo "<br />";
}
?>
SEE ALSO sqlsrv_client_info(3).
PHP Documentation Group SQLSRV_FIELD_METADATA(3)