The -z test will not work in Bourne shell. It will in Korn - not sure about Bash.
The FILE_FIND command needs backticks - not quotes.
Also, in some forms of 'find' you need a -print command.
So...
The -z test will not work in Bourne shell. It will in Korn - not sure about Bash. Also, in some forms of 'find' you need a -print command.
Hi,
I have a statement in shell script which i am writing below:
if ]
then
.....
What is the meaning of -a option in files, meaning of the statement in the if condition ] means.
Thanks (3 Replies)
can someone please tell me what is wrong with the below. i'm trying to get a script to run if the content of a variable is either small letter y or capital letter Y.
if
then
whatever
fi (4 Replies)
I want to write a program that would convert yard to feet and feet to yard.
i.e
1 yard = 3 * feet
Echo "enter a"
read a
expr a *3
The trick is that I want to give the user some options. After the conversion from yard to feet is done, I want to ask the user whether or not he/she wants to... (10 Replies)
In my ksh script, if the conditions of a if statement are true, then do nothing; otherwise, execute some commands.
How do I write the "do nothing" statement in the following example?
Example:
if (( "$x"="1" && "$y"="a" && "$z"="happy" ))
then
do nothing
else
command
command
fi... (3 Replies)
Hi All,
I am using Unix ksh script.
I need to insert values to a table using the o/p from a slelect statement.
Can anybody Help!
My script looks like tihs.
---`sqlplus -s username/password@SID << EOF
set heading off
set feedback off
set pages 0
insert into ${TB_NAME}_D... (2 Replies)
I have the program:
#!/bin/ksh
echo Please enter yes or no
read n
typeset -l n
if ]
then
echo My name
exit
else
echo delete my name
fi
Question:
How can I make the program accept only the word "yes" or "no" otherwise it will ask the user to re-enter?
Thanks! (7 Replies)
Hi,
I have this code here. Its suppose to do something when certain condition is met, I'm pretty sure at least one of the condition will be meet somewhere in the loop but it always go to else part of the script.
Is something wrong on this script?
age_list=`tar -tvf /home/dir/$tarfile... (4 Replies)
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
LEARN ABOUT PHP
pdo.exec
PDO.EXEC(3) 1 PDO.EXEC(3)PDO ::exec - Execute an SQL statement and return the number of affected rows
SYNOPSIS
public int PDO::exec (string $statement)
DESCRIPTION PDO.exec(3) executes an SQL statement in a single function call, returning the number of rows affected by the statement.
PDO.exec(3) does not return results from a SELECT statement. For a SELECT statement that you only need to issue once during your program,
consider issuing PDO.query(3). For a statement that you need to issue multiple times, prepare a PDOStatement object with PDO.prepare(3) and
issue the statement with PDOStatement.execute(3).
PARAMETERS
o $statement
- The SQL statement to prepare and execute. Data inside the query should be properly escaped.
RETURN VALUES PDO.exec(3) returns the number of rows that were modified or deleted by the SQL statement you issued. If no rows were affected, PDO.exec(3)
returns 0.
Warning
This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on
Booleans for more information. Use the === operator for testing the return value of this function.
The following example incorrectly relies on the return value of PDO.exec(3), wherein a statement that affected 0 rows results in a call to
die(3):
<?php
$db->exec() or die(print_r($db->errorInfo(), true));
?>
EXAMPLES
Example #1
Issuing a DELETE statement
Count the number of rows deleted by a DELETE statement with no WHERE clause.
<?php
$dbh = new PDO('odbc:sample', 'db2inst1', 'ibmdb2');
/* Delete all rows from the FRUIT table */
$count = $dbh->exec("DELETE FROM fruit WHERE colour = 'red'");
/* Return number of rows that were deleted */
print("Deleted $count rows.
");
?>
The above example will output:
Deleted 1 rows.
SEE ALSO PDO.prepare(3), PDO.query(3), PDOStatement.execute(3).
PHP Documentation Group PDO.EXEC(3)