The sql tag has no usage guidance.
3
votes
0answers
32 views
Tomcat, sql, kerberos, oh my!
I am working on setting up tomcat 8.0.35 on ubuntu 16.04 with Oracle Java (not openjdk) 1.8.0_91-b14 to use kerberos authentication when authenticating to our Microsoft SQL database. The issue I am ...
1
vote
1answer
44 views
Output broken when appending output of sql query in ksh
I'm very new to scripting. I would like to add the output of the sql function given below to another variable for example:
month_end ()
{
mdate=$($SQLPLUS_HOME/sqlplus.exe -S $DBC << END
set ...
0
votes
0answers
33 views
How to connect SQL from VMWare?
I've windows 7 and I am using linux in vmware. Can I connect to my sql database which is running in my windows7 from linux?
0
votes
1answer
25 views
How to write down SQL query to get the data count of a table?
I have one table named FDR_DATA. There are following fields present in the table. Fields are: B1_NAME, B2_NAME, B3_NAME, ELEMENT, DATUM, WERT. Now I want to query the total number of data in this ...
0
votes
1answer
36 views
How to populate a database in sqlite3 using shell script while extracting data from files
I have many .dat files containing specific fields such as <Overall>, <Content>, <Cleanliness> all with a number next to them.
I have the code to be able to extract the data from ...
1
vote
2answers
64 views
Bash script - chomp parts out of a line
I have a data file (see sample three lines below) separated by pipes.
What I want to be able to do is to "chomp" out the fields and put them into variables. They are of pre-defined lengths. I want to ...
3
votes
2answers
51 views
vim: Force specific syntax via command-line argument
When I want to easily read my PostgreSQL schema, I dump it to stderr and redirect it to vim:
pg_dump -h localhost -U postgres dog_food --schema-only | vim -
This gives:
vim does not have a ...
0
votes
2answers
97 views
Read SQL file by blocks in bash
I've been trying to do a string replacement type of operation in bash. It's not exactly as easy as it seems though, so here's the explanation:
Say you have an SQL file with multiple SELECT statements ...
0
votes
0answers
26 views
sqoop from MS SQL 2000
I have this sqoop problem with MS SQL server 2000 on my Cloudera setup, I tried to use jtds 1.3.1 to list the database it gave me the following error, not sure if anyone has experienced before:
#...
0
votes
0answers
28 views
How to read fields of a text block?
I would like to create sql inserts based on Radius log fields. For example, I have these two types of accounting logs and I'd like to convert each text block to an insert like below:
INSERT INTO ...
0
votes
4answers
79 views
Run multiple piped grep commands from a list in bash
As part of my security job, I analyze dozens of Google Chrome history files each day using sqlite3 over SSH.
There are a few dozen authorized "safe" sites each user is allowed to navigate to. For my ...
0
votes
1answer
37 views
unlang: sql results to local variable
I'm trying to save a resultset of a SQL query in unlang. (First time unlang for me by the way, so please don't judge me for mistakes)
The corresponding line is
Sql-Result-Set = %{expr: %{sql:...
1
vote
2answers
80 views
Complex sed Command with AND/OR/NOT
I have a bunch of php files which have many select commands.
In each query i want to insert a coloumn variable admin_id = '$admin_id'
i.e. if the query is select * from users where abc='xyz' and qwe='...
0
votes
0answers
55 views
The curious case of high 5 min load average
Looking for some expert advice here. I'm a first time sys admin on my own server and I can't figure the bottle neck in my server.
Linux CentOS 6 Apache 2.4 PHP 5.5
I've been receiving tons of high 5 ...
0
votes
0answers
204 views
How do I use grep to search for strings that exist both on single lines and multiple lines?
I am searching large amounts of SQL scripts for data dependencies but due to variations in the scripts, I have encountered an interesting problem. If I am searching for the word FROM it only returns ...
0
votes
1answer
807 views
Cannot run test program while cross compiling - cross compiling Firebird
I've tried to compile firebird server for arm linux, with cross-compiler (it's choosen - it's working properly).
When using:
./autogen.sh --host=arm-linux-gnu
I get this error:
checking for ...
0
votes
1answer
50 views
Reading Multi Line SQL in UNIX
Currently, I am reading few queries from the below .sql file
--SOURCE TABLE NAME
--SOURCE QUERY
SEL COL1, COL2, COL3, COL4,
COL5, COL6, COL7 WHERE COL5 = '2015-11-04 16:24:00.000000' FROM ...
-1
votes
1answer
24 views
Physical Backup of Maria DB as a snapshot using LVM
I have a SQL database which I want to backup as a snapshot. I want to use LVM to do so, but I am not able to do it. Also my database is not stored in a LVM partition but its located in my /dev/sda2 ...
1
vote
0answers
38 views
tab-delimiting a file in shell [closed]
I have a file that I want to put in a table in SQL with 10 columns. I am trying to tab-delimit the file so that the file can go in the table.
Here is part of my txt file:
Chr12 MSU_osa1r7 exon ...
-1
votes
2answers
35 views
putting output into sql table
I am trying to convert the output of ps awux into 11 fields with the headers eliminated and then importing that output into an existing table in SQL.
0
votes
3answers
209 views
Use Command Line Argument and Variable with sed Inside Bash Script
I have a bash script that takes a bunch of command line arguments. The only one that matters in this context is the first, $1, which is a text file.
The header is very long, below are examples of ...
0
votes
1answer
64 views
removing all tabs in sqlplus
I can resolve this problem, but I don't understand, why happen this...
My task is: (in ksh)
1st step: Query a number from a DB with sqlplus,
2nd step: Format some text for a mail,
3rd step: send a ...
0
votes
1answer
183 views
How to delete the lines that starts with a specific word and end with a specific word
Eg:
CREATE TABLE COMM.ACL_ENTRY (
ACL_OID CHAR(18) FOR BIT DATA NOT NULL ,
USER_DESC_TYPE FOR COLUMN USER_00001 BIGINT NOT NULL ,
USER_DESC_OID FOR COLUMN USER_00002 ...
-1
votes
1answer
90 views
When to use SQL or NoSQL databases? [closed]
The title of this question pretty sums it up. I am interesting in learning when to use a SQL database, such as MariaDB, and when to use a NoSQL one, such as MongoDB. Is there a specific case where one ...
0
votes
1answer
162 views
FreeTDS missing encryption support to connect to MS SQL
I'm running a Gentoo Linux and I'm trying to connect to MS SQL via pyodbc using freetds.
I enabled the debug log in freetds. Now when I try to connect I'm seeing this:
18:13:00.841828 13523 (net.c:...
0
votes
1answer
76 views
How to return sequence value in sqlldr from unix shell
I have a test.txt file with column (Serialnumber,value).
test.txt:
"SEQ_IN_AMT.NEXTVAL",123123
"SEQ_IN_AMT.NEXTVAL",123114
here SEQ_IN_AMT is a sequence name create on Oracle. Now, when I load ...
1
vote
1answer
821 views
Pass shell variables to SQL statement
I want to pass shell variables to sql statement. Both shell script and SQL statement are present in the same script file.
I want the values of the variables retMonth, retLastDay and retPrvYear in the ...
1
vote
1answer
276 views
Passing multiple varibles to a script for SQL query
I have this script called info_code:
#!/bin/ksh
if [ $# -eq 0 ] ;then
echo "Enter code : \c"
read code
echo ""
else
code=$1
fi
code=`echo ${code} | tr '[a-z]' '[A-Z]'`
echo "select * from ...
1
vote
1answer
4k views
Redirect the output of a query in a file
How I can do to redirect the query result in a text file in sqlplus
I tried: start requete.sql > resultat.txt but it dosen't work
0
votes
1answer
44 views
Error not found [closed]
I wrote this script to encode / encrypt data from a sql query by changing the names of tables and fields (I played on the ASCII character codes).
#! /bin/bash
chr() {
[ "$1" -lt 256 ] || return 1
...
0
votes
3answers
7k views
Remove special characters in a text file
I have a text file which contains in each line a sql query.
For each line, I need to remove some special characters.
Expl: if I have:
select * from Users;
insert into Users values ('UR01','Kim','...
0
votes
2answers
219 views
Awk one-liner to print column of SQL table?
Suppose I have table like:
This is first line
name minimum maximum config_value
----------------------------------- ----------- ----------- ------------
some ...
2
votes
2answers
184 views
An error of variable type?
I've an error that I don't understand, it seems that that the problem is that my parameters into the shell are not of the same type as what they are in my SQL Database.
For a better understanding: I'...
-1
votes
1answer
55 views
To use several parameters that are in a .lst [closed]
I've a doc.lst that is :
23/02/2015 0 AAA
23/02/2015 0 AB1
23/02/2015 0 AC2
23/02/2015 0 FRR
23/02/2015 0 FPT
23/02/2015 0 PEI
23/02/2015 0 PEA
I would like to ...
0
votes
1answer
598 views
Loop for's result in a variable for sql query
I have this part of my script
for i in `cat ${RELLIST}`
do
for mr in `cat ${i}/DBA/install.list`
do
grep -i "'dba_" ${i}/DBA/sql/${mr}/*.tab 2> /dev/null | sed 's/^.*://'
#grep -i ...
0
votes
0answers
156 views
checkbox to automated sql scripts run
I want to provide a menu in a shell script that offers a check list of SQL scripts to run.
I actually need to execute the selected SQL scripts but it's about 20 of them and that make it hard to cover ...
2
votes
4answers
297 views
Tool for escaping all quotes in a string/file
I have a weird problem that I don't have a good way around.
My company, because reasons, stores scripting code in a database table. Don't ask. Whenever I have to insert a new version of the code, I ...
0
votes
0answers
516 views
Disabling strict mode does not take effect from the config file
I am trying to disable the MySQL/MariaDB strict mode in the variable sql_mode. But it doesn´t work. My my.cnf in section [mysqld] got this line:
sql_mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
...
0
votes
1answer
209 views
From Mysql query output to retrieve files in the file system and rename the files
I have to call a SQL query from bash that outputs 1000 rows of two columns
File_Path (Eg., /opt/files/dest/2.bin)
Name_of_the_file (Eg., fax attachment.pdf, invoice.docx... yes, there are spaces). ...
1
vote
1answer
688 views
Convert XML to SQL INSERT statements using the command line
Is there a way to convert XML to SQL INSERT using the command line, here is examples:
<something>
<somthingelse>lol</somethingelse>
</something>
would be
INSERT INTO `...
1
vote
0answers
199 views
How to run multiple queries in a KSH script
I have a KSH script that has one SQL Query and generates and emails output of the query in HTML format. I want to change the script so that it has three SQL queries and the last query generates and ...
-2
votes
1answer
62 views
unix oracle connectivity [closed]
Operating system : Windows8.1
i use Linux ubuntu using vmware
Today i have installed oracle database 11g release 2 in particular drive
i want to access database via linux/ubuntu
i able to ...
0
votes
1answer
5k views
SQLPLUS withing shell script loops
Hello I am trying to run a loop and get the details of a project. I have these projects in my work space. How do I loop over the SQL code?
#!/bin/bash
workspace=$(sudo locate -r '/workspace$')
...
0
votes
1answer
130 views
KSH script missinterpreting alias stored in SQL oracle DB
I have stored the path of my file in a table with as an alias (as the complete path was too long for the table's field). However, in my KSH script, when I am doing :
nomtmp=`sqlplus -S bla/bla <&...
0
votes
1answer
600 views
What is the format of the data that must be fed to the freetds tool bsqldb?
I need help figuring out how to input my data to bsqldb. I have been looking for a manual or some examples or tutorial but I cant find anything online beside its command line help.
I am planning to ...
2
votes
2answers
111 views
A combination of uniq and agrep?
I have a file full of long SQL queries, one per line. I need to create a list of unique queries, but most of the queries include parameter values that make using an exact matching tool like uniq ...
1
vote
1answer
933 views
dovecot mysql-connection error because of special charater in config
I successful set up my Server with froxlor, etc. but now I get errros with my mail delivery Agent because I use a '#' in my mysql-pw. I tried to escape it with a '\' but it doens't seem to work. :(
...
4
votes
2answers
6k views
Insert to oracle table in a loop
Requirement: In one server in a directory multiple files are present. I need to read the file names and populate into a oracle table.
I have written the script like this, but its not working:
#!/bin/...
0
votes
2answers
3k views
How can I get sql queries to show in output file?
I tried executing set of queries from a shell script while capturing both input (SQL query) and output in the log file.
But the input query is not displayed along with output. Only the outputs are ...
1
vote
1answer
2k views
Error out shell script if plsql program fails
In the shell script, I am calling a PLSQL stored procedure
sqlplus -s <<EOF
$v_fcp_login
set head off feed off serverout on size 1000000
exec XXIRIS_TEST_K.XXIRIS_TEST('$v_1',$v_2,$v_3,'$v_4',$...