How to pass variable to a query?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to pass variable to a query?
# 8  
Old 06-18-2015
Double quotes in sqlplus have a different meaning than in the shell. There they say that the identifier they surround has to be treated case sensitive. Put the date format specifier in single quotes like in my example.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Need to pass variable in a command and assign value to a variable

Hello All, Hope you're doing well ! I am trying below command to be passed in a shell script, header_date_14 is a variable and $1 is the name of a file I intend to pass as a command line argument, however command line argument is not being accepted. header_date_14=$(m_dump... (8 Replies)
Discussion started by: ektubbe
8 Replies

2. Shell Programming and Scripting

Need script to pass all sql file names in a directory to DB query

Hi All, In this path /home/all_files we have follwing files and direcotries proc_edf_sot.sql proc_ssc_sot.sql func_dfg_sot.sql sot unic cmr sdc under sot directory we have other directories sql pas ref under sql directory we have sql_sot sql_mat (6 Replies)
Discussion started by: ROCK_PLSQL
6 Replies

3. Shell Programming and Scripting

How to pass string into sql query?

Hi Gurus, I have a request which needs to pass string into sql. dummy code as below: sqlplus -s user/password@instance << EOF >>output.txt set echo off head off feed off pagesize 0 trimspool on linesize 1000 colsep , select emp_no, emp_name from emp where emp_no in ('a', 'b', 'c'); exit;... (4 Replies)
Discussion started by: ken6503
4 Replies

4. Shell Programming and Scripting

How to pass Variable from shell script to select query for SqlPlus?

echo "set echo off"; echo "set feedback off"; echo "set linesize 4000"; echo " set pagesize 0"; echo " set sqlprompt ''"; echo " set trimspool on"; Select statement is mentioned below echo "select res.ti_book_no from disney_ticket_history res where res.ti_status =${STATUS} and... (7 Replies)
Discussion started by: aroragaurav.84
7 Replies

5. UNIX for Dummies Questions & Answers

To pass multiple arguments from file in to an sql query

Hi all , I want to pass contents from a file say f1 as arguments to a sql query which has In statement using a script example select * from table_1 where login in ( `cat f1`) ; will this work or is there any other way to do it. (1 Reply)
Discussion started by: zozoo
1 Replies

6. Red Hat

How to pass value of pwd as variable in SED to replace variable in a script file

Hi all, Hereby wish to have your advise for below: Main concept is I intend to get current directory of my script file. This script file will be copied to /etc/init.d. A string in this copy will be replaced with current directory value. Below is original script file: ... (6 Replies)
Discussion started by: cielle
6 Replies

7. Shell Programming and Scripting

How to pass a function with a variable parameter into another variable?

Hello again :) Am currently trying to write a function which will delete a record from a file. The code currently looks as such: function deleteRecord() { clear read -p "Please enter the ID of the record you wish to remove: " strID ... (2 Replies)
Discussion started by: U_C_Dispatj
2 Replies

8. Programming

JDBC code to pass the SQL query as parameter and execute?

Below i have the sample code. i need to pass the entire query from file or as parameter and read the results and write into a output file. here the number of columns are unknown. some times it may be 2,3 or entire columns from the table. read all the column results and write into a comma... (0 Replies)
Discussion started by: laknar
0 Replies

9. Shell Programming and Scripting

add the output of a query to a variable to be used in another query

I would like to use the result of a query in another query. How do I redirect/add the output to another variable? $result = odbc_exec($connect, $query); while ($row = odbc_fetch_array($result)) { echo $row,"\n"; } odbc_close($connect); ?> This will output hostnames: host1... (0 Replies)
Discussion started by: hazno
0 Replies

10. Shell Programming and Scripting

pass result from one query to another

Can any one help me how to pass the value of result of one query to another query. I to pass the value of result of 'select max(id) from a' into another query like update table set col =<value from last query> where ....; updatestaging() { xx=`$ORACLE_HOME/bin/sqlplus -s... (1 Reply)
Discussion started by: u263066
1 Replies
Login or Register to Ask a Question
ost::Datetime(3)					     Library Functions Manual						  ost::Datetime(3)

NAME
ost::Datetime - The Datetime class uses a julian date representation of the current year, month, and day and a integer representation of the current time. SYNOPSIS
#include <numbers.h> Inherits ost::Date, and ost::Time. Public Member Functions Datetime (time_t tm) Datetime (tm *dt) Datetime (const char *str, size_t size=0) Datetime (int year, unsigned month, unsigned day, int hour, int minute, int second) Datetime () virtual ~Datetime () char * getDatetime (char *buffer) const time_t getDatetime (void) const bool isValid (void) const Datetime & operator= (const Datetime datetime) Datetime & operator+= (const Datetime &datetime) Datetime & operator-= (const Datetime &datetime) Datetime & operator+= (const Time &time) Datetime & operator-= (const Time &time) int operator== (const Datetime &) int operator!= (const Datetime &) int operator< (const Datetime &) int operator<= (const Datetime &) int operator> (const Datetime &) int operator>= (const Datetime &) bool operator! () const String strftime (const char *format) const Additional Inherited Members Detailed Description The Datetime class uses a julian date representation of the current year, month, and day and a integer representation of the current time. This is then manipulated in several forms and may be exported as needed. Author: Marcelo Dalmas mad@brasmap.com.br Integer based time class. Constructor &; Destructor Documentation ost::Datetime::Datetime (time_ttm) ost::Datetime::Datetime (tm *dt) ost::Datetime::Datetime (const char *str, size_tsize = 0) ost::Datetime::Datetime (intyear, unsignedmonth, unsignedday, inthour, intminute, intsecond) ost::Datetime::Datetime () virtual ost::Datetime::~Datetime () [virtual] Member Function Documentation char* ost::Datetime::getDatetime (char *buffer) const time_t ost::Datetime::getDatetime (void) const bool ost::Datetime::isValid (void) const Reimplemented from ost::Date. bool ost::Datetime::operator! () const Reimplemented from ost::Date. int ost::Datetime::operator!= (const Datetime &) Datetime& ost::Datetime::operator+= (const Datetime &datetime) Datetime& ost::Datetime::operator+= (const Time &time) Datetime& ost::Datetime::operator-= (const Datetime &datetime) Datetime& ost::Datetime::operator-= (const Time &time) int ost::Datetime::operator< (const Datetime &) int ost::Datetime::operator<= (const Datetime &) Datetime& ost::Datetime::operator= (const Datetimedatetime) int ost::Datetime::operator== (const Datetime &) int ost::Datetime::operator> (const Datetime &) int ost::Datetime::operator>= (const Datetime &) String ost::Datetime::strftime (const char *format) const Author Generated automatically by Doxygen for GNU CommonC++ from the source code. GNU CommonC++ Sat Jun 23 2012 ost::Datetime(3)