9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
we have requirement, i am created a shell script , inside i am connecting sqlplus and execute the query. below my code for your reference.
get_sqlid ()
{
sqlid=$(
sqlplus -s $PBDW_USERID/$PBDW_PW@$PBDW_SID <<EOF
DEFINE TBLNAME=$1
set feedback off
set serverout on size... (4 Replies)
Discussion started by: KK230689
4 Replies
2. Shell Programming and Scripting
cat << EOF | telnet alt1.aspmx.l.google.com 25
HELO verify-email.org
MAIL FROM: <check@verify-email.org>
RCPT TO: <test@gmail.com>
quit
EOF
Hello, I'm trying to get the result of that execution, and can not see the result or bring it to a txt ... the direct command in ssh running the result... (5 Replies)
Discussion started by: c0i0t3
5 Replies
3. Shell Programming and Scripting
i am using bash shell
Whenever i declare an array, and then using sqlplus, i am getting sqlplus error and return code 127.
IFS=","
declare -a Arr=($Variable1);
SQLPLUS=sqlplus -s "${DBUSER}"/"${DBPASS}"@"${DBASE}
echo "set head off ; " > ${SQLCMD}
echo "set PAGESIZE 0 ;" >> ${SQLCMD}... (6 Replies)
Discussion started by: arghadeep adity
6 Replies
4. Shell Programming and Scripting
I am new in shell script i want to convert .txt file
in the format axsjdijdjjdk to
a
x
s
j
d
i
j
d
j
j
d
k (5 Replies)
Discussion started by: sreejithalokkan
5 Replies
5. Shell Programming and Scripting
hi all,
i need the shell script for he below requirement
i had the input file as
a_20121217_035120( frmat is a_date_hhmmss)
a_20121217_035128
a_20121217_035456
a_20121217_035767
a_20121217_035178
a_20121217_035189
a_20121217_035220
my output should be
a_20121217_035456... (0 Replies)
Discussion started by: hemanthsaikumar
0 Replies
6. Shell Programming and Scripting
Hello everyone,
I have a RHEL 5 system and have been trying to get a batch of 3-4 scripts each in a separate variables and they are not working as expected.
I tried using following syntax which I saw a lot of people on this site use and should really work, though for some reason it doesn't... (3 Replies)
Discussion started by: rockf1bull
3 Replies
7. Shell Programming and Scripting
Hello. I am a novince at writing shell scripts but here is the question. I have to write a shell script that does the following:
Once executed via crontab, the script should do the following:
a. get date/time stamp in for format 10-MAR-05 and
b. execute shell script my_script.sh (which... (2 Replies)
Discussion started by: jigarlakhani
2 Replies
8. UNIX for Advanced & Expert Users
Can I do something like this from a shellscript ?:
ftp 12.34.56.78 <<!
username
password
put a.c
bye
!
It does not go through as the login fails.
Is there any alternative to do the above requirement?
Thanks in advance.
Gowrish (3 Replies)
Discussion started by: ggowrish
3 Replies
9. Shell Programming and Scripting
I am new to UNIX.
I got the file from Oracle, with
two columns (Table Name and Column Name). I need to create the shell script where the result suppose to include
plain text, <table_name>, <Column_name> from the file.
Plain text will be the statements to create index in Oracle.
something like... (1 Reply)
Discussion started by: newuser100
1 Replies
MYSQLND_MS_QUERY_IS_SELECT(3) 1 MYSQLND_MS_QUERY_IS_SELECT(3)
mysqlnd_ms_query_is_select - Find whether to send the query to the master, the slave or the last used MySQL server
SYNOPSIS
int mysqlnd_ms_query_is_select (string $query)
DESCRIPTION
Finds whether to send the query to the master, the slave or the last used MySQL server.
The plugins built-in read/write split mechanism will be used to analyze the query string to make a recommendation where to send the query.
The built-in read/write split mechanism is very basic and simple. The plugin will recommend sending all queries to the MySQL replication
master server but those which begin with SELECT, or begin with a SQL hint which enforces sending the query to a slave server. Due to the
basic but fast algorithm the plugin may propose to run some read-only statements such as SHOW TABLES on the replication master.
PARAMETERS
o $query
- Query string to test.
RETURN VALUES
A return value of MYSQLND_MS_QUERY_USE_MASTER indicates that the query should be send to the MySQL replication master server. The function
returns a value of MYSQLND_MS_QUERY_USE_SLAVE if the query can be run on a slave because it is considered read-only. A value of
MYSQLND_MS_QUERY_USE_LAST_USED is returned to recommend running the query on the last used server. This can either be a MySQL replication
master server or a MySQL replication slave server.
If read write splitting has been disabled by setting mysqlnd_ms.disable_rw_split, the function will always return
MYSQLND_MS_QUERY_USE_MASTER or MYSQLND_MS_QUERY_USE_LAST_USED.
EXAMPLES
Example #1
mysqlnd_ms_query_is_select(3) example
<?php
function is_select($query)
{
switch (mysqlnd_ms_query_is_select($query))
{
case MYSQLND_MS_QUERY_USE_MASTER:
printf("'%s' should be run on the master.
", $query);
break;
case MYSQLND_MS_QUERY_USE_SLAVE:
printf("'%s' should be run on a slave.
", $query);
break;
case MYSQLND_MS_QUERY_USE_LAST_USED:
printf("'%s' should be run on the server that has run the previous query
", $query);
break;
default:
printf("No suggestion where to run the '%s', fallback to master recommended
", $query);
break;
}
}
is_select("INSERT INTO test(id) VALUES (1)");
is_select("SELECT 1 FROM DUAL");
is_select("/*" . MYSQLND_MS_LAST_USED_SWITCH . "*/SELECT 2 FROM DUAL");
?>
The above example will output:
INSERT INTO test(id) VALUES (1) should be run on the master.
SELECT 1 FROM DUAL should be run on a slave.
/*ms=last_used*/SELECT 2 FROM DUAL should be run on the server that has run the previous query
SEE ALSO
Predefined Constants, user filter .Runtime configuration, mysqlnd_ms.disable_rw_split, mysqlnd_ms.enable.
PHP Documentation Group MYSQLND_MS_QUERY_IS_SELECT(3)