sql's questions - English 1answer

98 sql questions.

I am working on setting up Tomcat 8.0.35 on Ubuntu 16.04 with Oracle Java 1.8.0_91-b14 (not openjdk) to use Kerberos authentication when authenticating to our Microsoft SQL database. The issue I am ...

Requirement is to generate output files in a directory appended to an already existing location in a sql file based on the input provided to a shell script in Linux. How can this be achieved. Please ...

I am new to Hive database. Can someone please help me to change the datatype in Hive database? Below is a complete information about the same. I have a database named "test". It has a table "name". ...

I am trying to substitute a unix variable to a select statement, but I am getting the below error. What did I do wrong? sqlplus "/ as sysdba" << EOF spool /home/oracle/l.log archive log list; ...

I've recently received a SQL-dump file, but it contains multiple databases in it. Is there any tool I can use to easily split this up into multiple .sql files, one per database?

Wanted to know if it is possible to "pass a variable value as an input to an oracle sql file that is being called from a shell script" I am trying like this, but its not working: SQL file: set head ...

I have a file with some SQLs and I want to find out the fields that have cast by using shell scripting. For example, I have a file abc.txt with the below sql SELECT field1,field2,field3,field4,...

I have a program which uses these tables, and I want to add some additional functionality to its logging without modifying the program. groups ------ id bigint not null name character varying(100) ...

I'm trying to run a sqlite3 query against a small DB to update a table. While the script is more complicated, for testing I set the following variables: DN=123 UP=123 downlocalip=10.1.2.3 ...

I use Ubuntu 16.04 with Bash and MySQL Ver 14.14 Distrib 5.7.21, for Linux (x86_64) using EditLine wrapper. I try to create a DB stack for a webapp (WordPress) directly from command line and I share ...

Trying to run this Python file python pid_info.py 12345 which looks like #!/usr/bin/env python import subprocess import sys, getopt # add if -b or -e then look for username/email like etc... # ...

I am using a shell script like the following to spool two columns(fields) of a particular table into a csv file as follow: #!/usr/bin/bash FILE="emp.csv" sqlplus -s scott/tiger@XE <<EOF SET ...

I'm a little confused about ANSI and sql. Is the ansi/sql relationship the same as posix/unix? Is sql language an ansi standard?

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 ...

I have a rough and ready table as: mysql> mysql> show tables; +----------------------+ | Tables_in_businesses | +----------------------+ | 2017july | +----------------------+ 1 row ...

How can I do this with an array? (without storing the array as regular variable) VAR='String1 String2 String3' SELECT * FROM db.table WHERE xy IN ( ${VAR// /, } ); not working example: SELECT * ...

I have a file with the following format INSERT INTO table1(field1,field2,field3) VALUES('values1','value2','value3'); INSERT INTO table1(field1,field2,field3) VALUES('other_values1','other_value2','...

The following works great: ssh plxch1035.pdx.xxxxxx.com "sqlite3 /p/hdk/rtl/proj_data/shdk74/fe_data/ipci/ipci.db 'select * from tools'" When I want a specific tool row though: ssh plxch1035.pdx....

I was looking for a way to traverse CSV files as relational database tables. I did some research as nothing I found fit my bill of requirements in its entirety. I found several partially good options,...

There have been several questions here regarding replacing multi-line strings using the Unix shell, but I haven't found one that will work in this situation. I am trying to remove keys and ...

I'm using bash shell attempting to do a search and replace. I have a file of lines that look like ... INSERT INTO currency (name, code, symbol) VALUES ('Baht', 'THB', '฿'); ... and I want to ...

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 ...

I am unable to read single VALUE from mysql Query in awk.I am able to read it in bash but not in awk. I want to read the result variable in awk as I want to fire the query only based on some dynamic ...

I'm trying to get tripwire working after changing my hostname. Now tripwire does have .bak files. What's the easiest way to properly restore them? I'm running Debian 9.1 with KDE.

I have a controller with this CPU: CPU Atmel AT91SAM9G20 with ARM926EJ-S Kernel Are there jdbc drivers for MS SQL Server for this CPU? Thanks

I can resolve this problem, but I don't understand why it happens. 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 mail ...

I have a loop with while that is reading a file and then makes a query of these values. But when I'm trying to show a message with dbms_output.put_line it says : dbms_output.put_line(henry); ...

Suppose I have a file.txt; the content of the file is: insert into x values('a ',' b',' c '); insert into x values(' m ',' n ',' p '); I just want to remove spaces from each line after the ...

I want to write a script that inserts values into a list of tables as follows. Example: insert into TABLE1 ( a,b,c) select a,b,c from TABLE2; But TABLE2 does not have column C, so I want to insert ...

I purchased a a WiFi server terminal which runs Busybox and only comes with a http web implementation which pops up once you connect to the WiFi. I'd like to support for SQL (or some variation) and ...

I know the thread How can I inner join two csv files in R which has a merge option, which I do not want. I have two data CSV files. I am thinking how to query like them like SQL with R. Two CSV ...

I have a .sql file that has a create table query: <<<<< some text >>>>> CREATE EXTERNAL TABLE table_name ( key1 int , key2 ...

Suppose there is a table with billion rows, and I issue a select statement as below, SQL> select * from big_table; During the statement execution is it possible to print the number the rows it ...

I have a challenging issue that I am facing below I have the below text in a file: create table "ctronsys".activity_codes ( code_list_id varchar(8), code_id varchar(10), record_type varchar(...

I am trying to extract one query at a time from an SQL file. This is what I have tried index1=1 index2=1 while read -n1 char; do if [[ $char == ";" ]] then SUBSTRING=$(awk 'substr($index1,$...

I want to left-align text in a .txt file generated by a pl/sql query (.sql file) being called inside a shell script, and send the .txt file over an email using email command. The issue is, the text ...

I have a text file which has inputs for select statement. sqlplus -s $USERNAME/$PASSWORD@$HOST<<EOF spool $DIRECTORY/UPDATE.xls select acc,cr,dr from count where acc in ***$DIRECTORY/acc.txt**...

I have a txt file with string values in a single column : File.txt A B . . . Z I have a sql script with a variable called 'parameter'. script.sql declare @var varchar(255) set @var = 'parameter'...

I am new to bash scripting and not sure how to accomplish this. I am trying to query a DB and need to remove empty strings as well as duplicates. The command I'm using mssql -f csv -c /path/to/mssql....

I have been using awk and some cisco commands to get information about devices connected to a network, the script connects via telnet to certain device, take the IP, serial number, and the name (...

I am getting some issue when running sql from sqlplus and want to assign the o/p to a Unix variable.The Output is showing correct in log file but not assign to variable. code : PASSWD variable ...

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 ...

I'm using Amazon Linux, bash shell. I have this statement, which extracts and prints the second row from a file with comma-delimited data ... awk -F',' 'select * FROM {print $2}' myfile.csv I would ...

I am new to Unix Shell scripting. I need to write a shell script for comparing 2 sql output files (basically in .txt format) which are the outputs of the same sql query (before and after a maintenance ...

We would like to implement an approach which has to write the log file simultaneously when the .sql file is executing by Unix process. At present, it is writing the log file once the process is ...

I have a SQL dump file having several insert commands. I would like to remove, through sed or grep (or even another simple bash trick), a specific column and its equivalent data at the VALUES clause. ...

I was trying to assign a string variable in shell the result of an SQL query . I was trying to extract the first name of a customer from a table having customer details by the following query: ...

I have a requirement of extracting the 2nd, 3rd and 4th field from a file aaa.log and producing output as - sqlplus -sl dbsnmp/Or8cle@\"COL3:COL4/COL2\" Input: $ cat aaa.log aaa:fDb:a0081:1800:...

I'm simply trying to get the output from a sql statement and store in bash variable. I am getting " unexpected EOF while looking for matching `)' " error. I don't see what i'm doing wrong. Why am I ...

Several times I've found myself working on data that has been exported to .sql files that I want to process rather than import into a database. I'm only talking about "pure data" sql files. Ones that ...

Related tags

Hot questions

Language

Popular Tags