Sponsored Content
Top Forums Shell Programming and Scripting How to include SQL within a script Post 302448797 by mcclunyboy on Friday 27th of August 2010 04:35:54 AM
Old 08-27-2010
How to include SQL within a script

Hi,

I have a script I am developing (actually more than 1 just now).

1st part - executes SQL in a 2nd script.
2nd part - reformats the output of the sql into a csv

Problem:

How am I able to run the SQL from the first script? I assume there is a sql command? I generally use isql when interrogating by myself but I have never had a need to add it to a script before.

Edit - I only want 1 script which deals with the entire process.
 

10 More Discussions You Might Find Interesting

1. Programming

How to include shell script in C program

hi I want to call a shell script in C program the script is : ssh -t user@remote sh /<remote>home/user/<file_name>.sh and other several commands C program : Call this script and the retrive the task that is been done in <file_name>.sh file can any one tell me how... (5 Replies)
Discussion started by: mridula
5 Replies

2. Shell Programming and Scripting

Include lines within a script

I want to add lines in my script dynamically. My script: ... echo addscript end addscript ... Lines to add: (can be put in a file and can be added) cp /opt/script1.sh opt/script1_org.sh sed 's/testusr/'${FUNCTID}'/g' /opt/script1.sh > ./tmpfile mv ./tmpfile /opt/script1.sh... (1 Reply)
Discussion started by: chiru_h
1 Replies

3. Shell Programming and Scripting

Calling SQL LDR and SQL plus scripts in a shell script

Hi- I am trying to achieve the following in a script so I can schedule it on a cron job. I am fairly new to the unix environment... I have written a shell script that reads a flat file and loads the data into an Oracle table (Table1) via SQLLDR. This Works fine. Then, I run a nested insert... (5 Replies)
Discussion started by: rajagavini
5 Replies

4. UNIX for Dummies Questions & Answers

Include PERL script with in the unix shell script

Hi Gurus, Is it possible to include perl script with in the unix shell script? What would be the general syntax? In the above case, is it required to write the below first two lines of codes? #!usr/bin/sh -x #!usr/bin/perl -w Thanks in advance / Mysore Ganapati. (1 Reply)
Discussion started by: ganapati
1 Replies

5. Shell Programming and Scripting

include in script

Hello, I have a script and a second file that contains all parameters needed for the script. How can I include this file in the script ? I tried source but I have a "no such file or directory" error. :) (1 Reply)
Discussion started by: pppswing
1 Replies

6. UNIX for Dummies Questions & Answers

script/program in vi include $? or...

Hi. When you write a script/program in vi Do you include the $ Eg. #!/bin/bash $ echo "Today's date is `date`" or echo "Today's date is `date`" Make your script executable. $chmod +x script I included that. I keep getting a permission denied... why? Thanks! (5 Replies)
Discussion started by: JudoMan
5 Replies

7. UNIX for Dummies Questions & Answers

Execute PL/SQL function from Unix script (.sql file)

Hi guys, I am new on here, I have a function in oracle that returns a specific value: create or replace PACKAGE BODY "CTC_ASDGET_SCHED" AS FUNCTION FN_ASDSCHEDULE_GET RETURN VARCHAR2 AS BEGIN DECLARE ASDSchedule varchar2(6); ASDComplete... (1 Reply)
Discussion started by: reptile
1 Replies

8. UNIX for Dummies Questions & Answers

Option in sql script to include column headers when spooling file to .csv format

Can anyone help me how to include COLUMN HEADER when spooling file to .CSV format through SQL statement. Thanks, Akbar (4 Replies)
Discussion started by: s1a2m3
4 Replies

9. Shell Programming and Scripting

How to include a command in shell script?

# dbc "delete from alert;" DELETE 10 # However, the script created below generates an error that command does not exits. Can any one please exist. script.sh: #!/bin/sh dbc "delete from alert;" >>$TASKLOGFILE ./script.sh: line 38: dbc: command not found can any one please... (2 Replies)
Discussion started by: sureshcisco
2 Replies

10. UNIX for Dummies Questions & Answers

[solved] Script creation (how to include options in the script)

Hi guys i have written a script which takes the options given to him and execute itself accordingly. for example if a script name is doctortux then executing doctortux without option should made doctortux to be executed in automatic mode i.e. doctortux -a or if a doctortux is needed to run in... (4 Replies)
Discussion started by: pinga123
4 Replies
biomaj(1)							   USER COMMANDS							 biomaj(1)

NAME
biomaj - downloads and transform remote biological data banks SYNOPSIS
biomaj [-h] DESCRIPTION
BioMAJ (BIOlogie Mise A Jour) is a workflow engine dedicated to data synchronization and processing.The Software automates the update cycle and the supervision of the locally mirrored databank repository. User must have roots rights to run biomaj. OPTIONS
-h display the list of commands. INSTALL
At installation, BioMAJ requires a database to run (MySQL), installer should first create a database (biomaj_log) and a database user (the one used at installation setup). The database configuration for biomaj can be set or modified in /etc/biomaj/db_properties/global.properties. In the install fails due to a SQL error, the install script must be manually run to create/upgrade the database: perl /usr/share/biomaj/sql/migration/update.pl The script will create/upgrade the database and update the configuration files. ADMIN USER
A default admin user (admin) is created by the scripts. If using the biomaj-watcher, the default password (admin) MUST be changed immedi- atly via the watcher interface. If only biomaj core is used, password is useless. .PP UPGRADE
In the case of a package upgrade, if properly configured, the migration scripts will be ran automatically at install. It is possible to run manually the script: .B See perl /usr/share/biomaj/sql/migration/update.pl -h for usage. DATA BANKS
By default, biomaj is configured (data.dir in global.properties) to write banks to /var/lib/biomaj. EXAMPLES
Update a bank: biomaj --update genbank Show console biomaj --update genbank --console Show status: biomaj --status EXIT STATUS
biomaj returns a zero exist status if it succeeds, it does not represent the bank update status. AUTHOR
Olivier Sallou (olivier.sallou (at) irisa.fr) Romaric Sabas (romaric.sabas (at) irisa.fr) version 1.2.0 September 14, 2011 biomaj(1)
All times are GMT -4. The time now is 02:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy