Hi,
I am using few ISQL statements to update and delete from a few tables in sybase, now i want to roll back the transaction when any of the statements fail.How i can i capture these errors in the shell scripts.Please advise.
Thanks,
Gopi (4 Replies)
Hi,
I have a script called read.sh that takes a file as input. Now I want to make that script take the file as input with a -f option preceding the filename. How can I do this validation. How can I find whether the given option is -f or not inside the script.
Thanks in advance (2 Replies)
Hi,
I want to do the following validations in my script when my script gets 2 parameters as command line inputs.
My script expects 2 inputs : a -f option and a filename
If a filename is given as input without the -f option then I have to exit. If only -f option is given and no filename is... (6 Replies)
Hi
I have the following block of code in korn shell and don't now how to refer to variable `print variable1.$dvd` ?
---
integer dvd=4
integer number=0
while (( dvd!=0 ))
do
print "Iteracja numer : $dvd"
print "$_" #it refers to $dvd var but want to refer... (3 Replies)
Korn Shell in AIX 6.1
I want to print the below shown pipe (|) separated list line by line.
line=es349889|nhb882309|ts00293|snh03524|bg578835|bg37900|rnh00297|py882201|sg175883
for i in line
do
echo "Hello $line "
done
I wanted to execute the above for loop. But i can't even set the... (3 Replies)
This may be a dumb question, but googling is not giving me an answer. I'm trying to figure out how to refer to an input file in my code.
Lets say i run a script in bash:
"sh shellscript.sh inputfile"
(Inputfile will be variable...whatever file i run the script on)
I wanted to make... (5 Replies)
Hi i have to cut columns 2 to 6 from a file and assign it to arrays ,
The following code works
for ctcol in 2 3 4 5 6;
do
set -A a$ctcol $(cut -d, -f $ctcol test_file)
done
how ever this does not work
for ctcol in {2..6};
do
set -A a$ctcol $(cut -d, -f $ctcol test_file)... (4 Replies)
There are two Korn Shell scripts :
script_1.ksh ( located in /home/dir1 )
script_2.ksh ( located in /home/dir2 )
Content of script_2.ksh is
#!/usr/bin/ksh
echo "Hello world.."
The script_2.ksh is called from within script_1.ksh using the following command :
./home/dir2/script_2.ksh
but... (7 Replies)
Hi i have to find the shell script that contain the word
PROC__TO_UPDATE
SEARCH SHOULD BE INSENSITIVE AND SCRIPT CAN BE DEPLOYED IN ANY PATH.
I am on Solaris. (27 Replies)
I have a unix command that prompts for 'y'. How do I run this from my shell script? (4 Replies)
Discussion started by: Sree10
4 Replies
LEARN ABOUT PHP
mssql_field_seek
MSSQL_FIELD_SEEK(3)MSSQL_FIELD_SEEK(3)mssql_field_seek - Seeks to the specified field offsetSYNOPSIS
bool mssql_field_seek (resource $result, int $field_offset)
DESCRIPTION
Seeks to the specified field offset. If the next call to mssql_fetch_field(3) won't include a field offset, this field would be returned.
PARAMETERS
o $result
- The result resource that is being evaluated. This result comes from a call to mssql_query(3).
o $field_offset
- The field offset, starts at 0.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Using mssql_field_seek(3) on the example for mssql_fetch_field(3)
<?php
// Connect to MSSQL and select the database
mssql_connect('MANGOSQLEXPRESS', 'sa', 'phpfi');
mssql_select_db('php');
// Send a select query to MSSQL
$query = mssql_query('SELECT * FROM [php].[dbo].[persons]');
// Construct table
echo '<h3>Table structure for 'persons'</h3>';
echo '<table border="1">';
// Table header
echo '<thead>';
echo '<tr>';
echo '<td>Field name</td>';
echo '<td>Data type</td>';
echo '<td>Max length</td>';
echo '</tr>';
echo '</thead>';
// Dump all fields
echo '<tbody>';
for ($i = 0; $i < mssql_num_fields($query); ++$i) {
// Fetch the field information, notice the
// field_offset parameter is not set. See
// the mssql_field_seek call below
$field = mssql_fetch_field($query);
// Print the row
echo '<tr>';
echo '<td>' . $field->name . '</td>';
echo '<td>' . strtoupper($field->type) . '</td>';
echo '<td>' . $field->max_length . '</td>';
echo '</tr>';
// Move the internal seek pointer to the next
// row in the result set
mssql_field_seek($query, $i + 1);
}
echo '</tbody>';
echo '</table>';
// Free the query result
mssql_free_result($query);
?>
SEE ALSO mssql_fetch_field(3).
PHP Documentation Group MSSQL_FIELD_SEEK(3)