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)
Hello, I am new to this forums. I need help with shell, and ksh in particular. I have a case statement that does something if -k. So it looks like:
case $arg in
-k) PUT=y, SEND=1
Thats all good and dandy. But now I want to change it where whether or not the user puts -k or not, it will do... (2 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)
Can someone help me to write a script / command to read in a file, character by character, replace any unknown ASCII characters with space. then write out the file to a new filename/
Thanks! (1 Reply)
Hi All,
I have a big log file i want to delete all characters (between 350th to 450th characters) starting at 350th character position to 450th character position.
please advice or sample code. (6 Replies)
I have a korn shell code here on a while do statement which replace the string stored on an array removing double quotes characters on it but it doesn't work.
example record: appointmentDate = "tree" which value should result to tree
#!/bin/ksh
# Remove " on string records
let recordCount=3... (5 Replies)
I am having issues escaping special characters in my AWK script as follows:
for id in `cat file`
do
grep $id in file2 | awk '\
BEGIN {var=""} \
{ if ( /stringwith+'|'+'50'chars/ ) {
echo "do this"
} else if ( /anotherString/ ) {
echo "do that"
} else {
... (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)
Hi,
Anyone can help using SED searches a character string for a specified delimiter character, and returns a leading or trailing space/blank.
Text file :
"1"|"ExternalClassDEA519CF5"|"Art1"
"2"|"ExternalClass563EA516C"|"Art3"
"3"|"ExternalClass305ED16B8"|"Art9"
...
...
... (2 Replies)
Hi,
I am running a shell script that has to verify a password with an if statement. The password has an @ in it. I am having problems getting the if statement to test for the password. The @ causes problem. I tried the standard backslash escape but it did not work for me.
How can I do it?
I... (2 Replies)
Discussion started by: mojoman
2 Replies
LEARN ABOUT PHP
db2_num_rows
DB2_NUM_ROWS(3) 1 DB2_NUM_ROWS(3)db2_num_rows - Returns the number of rows affected by an SQL statementSYNOPSIS
int db2_num_rows (resource $stmt)
DESCRIPTION
Returns the number of rows deleted, inserted, or updated by an SQL statement.
To determine the number of rows that will be returned by a SELECT statement, issue SELECT COUNT(*) with the same predicates as your
intended SELECT statement and retrieve the value.
If your application logic checks the number of rows returned by a SELECT statement and branches if the number of rows is 0, consider modi-
fying your application to attempt to return the first row with one of db2_fetch_assoc(3), db2_fetch_both(3), db2_fetch_array(3), or
db2_fetch_row(3), and branch if the fetch function returns FALSE.
Note
If you issue a SELECT statement using a scrollable cursor, db2_num_rows(3) returns the number of rows returned by the SELECT state-
ment. However, the overhead associated with scrollable cursors significantly degrades the performance of your application, so if
this is the only reason you are considering using scrollable cursors, you should use a forward-only cursor and either call SELECT
COUNT(*) or rely on the boolean return value of the fetch functions to achieve the equivalent functionality with much better perfor-
mance.
PARAMETERS
o $stmt
- A valid stmt resource containing a result set.
RETURN VALUES
Returns the number of rows affected by the last SQL statement issued by the specified statement handle.
PHP Documentation Group DB2_NUM_ROWS(3)