Sponsored Content
Top Forums UNIX for Advanced & Expert Users Bash executing Orcale Update statement Post 302331379 by zaxxon on Monday 6th of July 2009 03:44:22 AM
Old 07-06-2009
Is there any difference between the echo syntax in your longer and the working shorter script? Basically you have problems with single and/or double quotation marks it seems. Maybe try playing around by escaping them with a backslash until you get the desired output.
Another way might be putting the statement to a plain file and then hand it over as a parameter to your script to have less hassle.
Also use CODE-tags when posting code, data or logs in future please.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

installing Orcale 8i on unix

Dear Sir, I am working in a bank and our parent bank has developed an application package which will work with oracle 8i on unix platform. The unix on the server is unix ware 7.1.1 with pro*c compiler. My question is 1. Whether Oracle 8i or above for windows will work on any unix version... (1 Reply)
Discussion started by: Parameswaran.AR
1 Replies

2. Shell Programming and Scripting

Executing a Oracle SQL statement in a UNIX script

Hi All, I need to select one column from a table based upon the passed in parameter. I tried this: sqlplus -silent $MISP_USER << EOF set feedback off; set verify off; set sqlprompt "" SELECT mail_flag FROM dailyjobs WHERE job_name = '$1'; exit 0 EOF exit... (1 Reply)
Discussion started by: ganga.dharan
1 Replies

3. Shell Programming and Scripting

executing mysql load statement from shell script

Hi, I have a piece of shell script which will connect to mysql database and execute a load statement(which will load datas in a file to the database table).The code is working and the data is in the tables. Now my requirement is, i need to grab the output from the load statement... (4 Replies)
Discussion started by: DILEEP410
4 Replies

4. Programming

UPDATE statement: calculating changes

The problem I was working on is solved, but felt it would be worthwhile to ask for some opinions as to whether the approach can actually be improved. I am using the following example and data taken from https://www.unix.com/high-level-programming/119134-sql-datetime-calculations.html and MySQL... (0 Replies)
Discussion started by: figaro
0 Replies

5. Shell Programming and Scripting

Executing sql statement from .sh file

Hi, How to execute sql statements from the .sh file ?? Means, when we run .sh file then the sql statements within it should be get executed one by one from the sqlplus With Regards (3 Replies)
Discussion started by: milink
3 Replies

6. Homework & Coursework Questions

Problem with executing a possible if or case statement script

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Create a phonebook program. It should use functions to perform the required tasks. It should be menu-based,... (1 Reply)
Discussion started by: Rgasin02
1 Replies

7. Red Hat

RedHat 5 update 9 BASH update issue

Hi i want to update the BASH because of the "shell shock" vulnerability. my RedHat 5 is clean install with the default mirror site. when im running the command: yum update bash im getting a message saying there is no update. you can see in the attach picture... what am i doing wrong? is... (4 Replies)
Discussion started by: guy3145
4 Replies

8. Shell Programming and Scripting

Storing passing and executing select statement in loop

Hi, i want to do the following: Grep the following kind of strings for the 15digit ID which is stored in filename1: "14:06:51.396 INFO BMCREMEDYSD INPUT-ACTION Failed to retrieve Remedy Incident Modification record: 000000000039047 org.apache.axis2.AxisFault: Read timed out - complete... (9 Replies)
Discussion started by: Khushbu
9 Replies

9. Shell Programming and Scripting

Convert Update statement into Insert statement in UNIX using awk, sed....

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

10. Shell Programming and Scripting

How to keep staying on remote server after executing a shell script with if then exit end statement?

i have a "if .. then exit end " in s shell script on remote servers. now the connection to the remote server got killed after i run this script on the remote servers. How do i run this script on remote hosts and still keep remote connections alive after executing the script. Thank you. (10 Replies)
Discussion started by: moonmonk
10 Replies
ADDSLASHES(3)								 1							     ADDSLASHES(3)

addslashes - Quote string with slashes

SYNOPSIS
string addslashes (string $str) DESCRIPTION
Returns a string with backslashes before characters that need to be escaped. These characters are single quote ( '), double quote ( "), backslash ( ) and NUL (the NULL byte). An example use of addslashes(3) is when you're entering data into string that is evaluated by PHP. For example, O'Reilly is stored in $str, you need to escape $str. (e.g. eval("echo '".addslashes($str)."';"); ) To escape database parameters, DBMS specific escape function (e.g. mysqli_real_escape_string(3) for MySQL or pg_escape_literal(3), pg_escape_string(3) for PostgreSQL) should be used for security reasons. DBMSes have differect escape specification for identifiers (e.g. Table name, field name) than parameters. Some DBMS such as PostgreSQL provides identifier escape function, pg_escape_identifier(3), but not all DBMS provides identifier escape API. If this is the case, refer to your database system manual for proper escaping method. If your DBMS doesn't have an escape function and the DBMS uses to escape special chars, you might be able to use this function only when this escape method is adequate for your database. Please note that use of addslashes(3) for database parameter escaping can be cause of security issues on most databases. The PHP directive magic_quotes_gpc was on by default before PHP 5.4, and it essentially ran addslashes(3) on all GET, POST, and COOKIE data. Do not use addslashes(3) on strings that have already been escaped with magic_quotes_gpc as you'll then do double escaping. The func- tion get_magic_quotes_gpc(3) may come in handy for checking this. PARAMETERS
o $str - The string to be escaped. RETURN VALUES
Returns the escaped string. EXAMPLES
Example #1 An addslashes(3) example <?php $str = "Is your name O'Reilly?"; // Outputs: Is your name O'Reilly? echo addslashes($str); ?> SEE ALSO
stripcslashes(3), stripslashes(3), addcslashes(3), htmlspecialchars(3), quotemeta(3), get_magic_quotes_gpc(3). PHP Documentation Group ADDSLASHES(3)
All times are GMT -4. The time now is 02:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy