hello,
I am trying to parse an error returned by a command inside the if statement but it is just displays the full error instead and then stops.
if ; then
echo "no such package"
else
echo "similar version found will use pkgrm"
fi
the above code just displays
please let me know... (2 Replies)
:b:hi,
I have a script as given below:
pr_det="1"
if
then
awk ' BEGIN {printf("%23s","session")}' >> report.txt
awk ' BEGIN {printf "\n"} ' >> report.txt
else
awk ' BEGIN {printf("%55s","file_dsc")} ' >> report.txt
awk ' BEGIN {printf("%101s","no_recs")} '... (1 Reply)
year=`date '+%Y'`
month=`date '+%m'`
day=`date '+%d'`
day=`expr $day - 1`
case $month in
1 | 3 | 5 | 7 | 8 | 10 | 12);;
if($day =7 ); then
$day=6
fi
4 | 6 | 9 | 11);;
if ; then
$day=31
fi
2);;
if ; then
if ; then (2 Replies)
Hi ,
I am getting an error when I run the script for checking word "view" in a file . I am using if statement. like this
if
then
VW_VAR=` cat $TN.${ecmdate}.sql1 | grep -i view | awk '{print $3}' | cut -d '.' -f2 `
echo " VW_$VW_VAR "
sed -e... (16 Replies)
HI i am getting error while executing the given statement
for filename in `cat a/file.lst`
do
if then
echo "Exit Code Description :File $filename - is missing in Input Directory" >a.log
exit
else
count1=`awk 'END {print NR}' $filename`
echo "$count1">>a.log
count2=`awk 'END {print... (4 Replies)
hi,
When i try to run the code below, i get the following error
"ksh: syntax error: `(' unexpected"
i am not able to figure it out. Can anyone help me?
Code: (2 Replies)
Hi
Can you please tell me what is wrong with this line:
if && ]; then
basically i want to check if x = 12 and F (Filename) end with 'g'. But it is throwing syntax error. (7 Replies)
Can anybody tell the correct way to use the following awk pattern check within an if statement?
When I run this command outside of the if statement
cat /tmp/test2.out | awk -v T=$TIME -v G=$GROUP -v C=$CDATE '$0 ~ T && $0 ~ G && $0 ~ C' | grep -i "Starting the group"
I get the following... (0 Replies)
hello all
im new to unix and when i use below script i get an error :
#! /bin/bash
Echo -e "enter the name of the file : \c"
read file_name
if
then
echo "$file_name found"
else
echo "$file_name not found"
fi
running the script i get below error :
$ ./hello (26 Replies)
Discussion started by: Ibrahims1
26 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)