Putting query result dynamically to one cell of table from shell

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Putting query result dynamically to one cell of table from shell
# 1  
Old 08-09-2016
Putting query result dynamically to one cell of table from shell

I have to send a data in mail table format.only one cell need to get dynamically from query.
my code is like
Code:
(echo '<table boarder="1">
echo '<tr><td>stock</td><td>/path</td><td>.........</td></tr>'
echo '</table>
)sendmail..

in ......... I am trying to get query result.By putting query directly it prints the query in mail body.I want the result to print
Moderator's Comments:
Mod Comment Please use CODE tags when displaying sample input, sample output, and code segments, as required by Forum Rules.

Last edited by Don Cragun; 08-10-2016 at 12:19 AM.. Reason: Add CODE tags.
# 2  
Old 08-10-2016
Knowing what operating system you're using, what shell you're using, what query language you're using to connect to your database, and what type of database you're using would give us a better chance of helping you solve this.

Showing us the query you plan to use to get data out of your database and the data you are trying to format into a mail message would also help.
# 3  
Old 08-10-2016
Hi Don ,
I am using redhat 6.4 x86_64 os.and using mysql.Query will be like " hive -e "use db; set mapred.job.queue.name=dd;select max(date_ship) from db.table;" .I am using hql.I want the result of this hql will print on 3rd cell of table.The out put of query will be like "2016-08-08".
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parameterizing to dynamically generate the extract file from Oracle table using Shell Script

I have below 2 requirements for parameterize the generate the extract file from Oracle table using Shell Script. Could you please help me by modifying the script and show me how to execute it. First Requirement: I have a requirement where I need to parameterize to generate one... (0 Replies)
Discussion started by: hareshvikram
0 Replies

2. UNIX and Linux Applications

SQL - how to alter info of a cell in table

Hello, I am newbie on mysql and trying to edit my database from terminal under linux. What I need to do is to change the information written in a cell in table. Let me explain what I tried: $ mysql -u mysqluser -p $ show databases; $ USE catalogue; $ show tables ; $ select * from... (2 Replies)
Discussion started by: baris35
2 Replies

3. Shell Programming and Scripting

Shell scripting unable to send the sql query data in table in body of email

I have written a shell script that calls below sql file. It is not sending the query data in table in the body of email. spool table_update.html; SELECT * FROM PROCESS_LOG_STATS where process = 'ActivateSubscription'; spool off; exit; Please use code tags next time for your code and data.... (9 Replies)
Discussion started by: Sharanakumar
9 Replies

4. Shell Programming and Scripting

Taking information from a postgres sql query and putting it into a shell script array

I have a postgres sql statement that is the following: select age from students; which gives me the entries: Age --- 10 15 13 12 9 14 10 which is about 7 rows of data. Now what I would like to do with this is use a shell script to create an array age. As a results... (3 Replies)
Discussion started by: JSNY
3 Replies

5. Programming

Query result from shell script

Hi, I wrote the below script to get the query result from a Syabase DB. isql -s -U **** -P **** SYBASE SERVERNAME USE ***(Database name in Sybase) @command.sql But im not getting the output. Can anyone help me on this (2 Replies)
Discussion started by: rohan G
2 Replies

6. Shell Programming and Scripting

Query the table and return values to shell script and search result values from another files.

Hi, I need a shell script, which would search the result values from another files. 1)execute " select column1 from table_name" query on the table. 2)Based on the result, need to be grep from .wft files. could please explain about this.Below is the way i am using. #!/bin/sh... (4 Replies)
Discussion started by: Rami Reddy
4 Replies

7. Shell Programming and Scripting

Shell script to query Oracle table

Hi, unix gurnis I need help for following requirement for writing a shell scritp. log in to oracle database, query one table total records (select count(*) from table1), pass the return value to a file. Thanks in advance (2 Replies)
Discussion started by: ken002
2 Replies

8. Shell Programming and Scripting

How to put db2 query result into an array in shell script?

Hello, Can someone please advise me how to put the db2 query reult into an array? For example, the query reults are: string A string B string C Then how do I put them into array=string A array=string B ... (2 Replies)
Discussion started by: hanul
2 Replies

9. Shell Programming and Scripting

How to store query multiple result in shell script variable(Array)

:) Suppose,I have one table A. Table A have one column. Table A have 10 rows. I want this 10 rows store into shell script variable. like #!/bin/ksh v_shell_var=Hi here in call oracle , through loop How can I store table A's 10 rows into v_shell_var (Shell Script Array). Regards, Div (4 Replies)
Discussion started by: div_Neev
4 Replies
Login or Register to Ask a Question