Hi
I want to get the a field from a SQL query into unix shell script variable. the whole situation is like this.
1. Opened a cursor to a table in DB2 databse.
2. Fetching individual rows with the help of cursor.
3. Each row has 4 fields.
I want each of the field in individual shell... (1 Reply)
Hi All,
I needed to get the result of two sqlplus queris into shell variables.
After days of looking for the ultimate solution to this problem.. i found this...
sqlplus -s USER/PASS@DB <<EOF | awk '{if(NR==1) printf("%s ", $1); if(NR==2) printf("%s ",
$1);}' | read VAR1 VAR2
set head off... (2 Replies)
Hi
I would like to know if there is a way to just have one ORACLE connection established, using which we can execute different queries and store the results under different variables.
For e.g the following uses to two silent ORACLE connection to store the result under two different... (4 Replies)
I want to store the sql query output into a variable
#!/bin/ksh
ORACLE_SID=DB01;
export ORACLE_SID;
export FILE_PATH=/home/asg/Tmp
# Order Checking
echo " removing old files "
rm $FILE_PATH/Malformed_Order.txt
echo " Enter the Malformed Order ....!"
read orders
echo "Regrade... (5 Replies)
While assisting a forum member, I recommended running SQL/Plus in a coprocess (to make database connections and run a test script) for the duration of his script rather than starting/stopping it once for every row in a file he was processing.
I recalled I made a coprocess example for folks at... (2 Replies)
Hello,
I am very new to shell scripting and I am not sure of how best to handle the following scenario. I need to query a list of values from a table. I need to store those results and use them to selectively delete values in yet another table in a separate database. I do know how to store the... (3 Replies)
Hi,
I have a script where I make a sqlplus connection. In the script I have multiple sql queries within that sqlplus connection. I want the result of the queries to be stored in shell variables declared earlier. I dont want to use procedures. Is there anyway else.
Thanks in advance..
Cheers (6 Replies)
Hi,
I have connected to oracle database with sqlplus -s / <<EOF
select ename, age from emp where empid=1234;
EOF
I want to save the values of ename and age in unix shell variables. Any pointers would be welcome..
Thanks in advance!!1
Cheers :):):):) (1 Reply)
Requirement 1) I need to execute 15 SQL queries in oracle through linux script. All these query results needs to be stored in array variables.
Requirement 2) And these 15 queries needs to be executed in parallel.
Requirement 3) Once all the queries executed then the shell script should... (3 Replies)
Hi
iam new to shell scripting
how to declare variables as redshift query and I have to compare two counts by using if condition .
ex:count=select count(*) from prd;
select count(*) from prd;
select count(*) from tag;
can any one help me .
Please use CODE tags when displaying... (1 Reply)
Discussion started by: sam526
1 Replies
LEARN ABOUT OSX
sql::translator::parser::dbix::class
SQL::Translator::Parser::DBIx::Class(3) User Contributed Perl Documentation SQL::Translator::Parser::DBIx::Class(3)NAME
SQL::Translator::Parser::DBIx::Class - Create a SQL::Translator schema from a DBIx::Class::Schema instance
SYNOPSIS
## Via DBIx::Class
use MyApp::Schema;
my $schema = MyApp::Schema->connect("dbi:SQLite:something.db");
$schema->create_ddl_dir();
## or
$schema->deploy();
## Standalone
use MyApp::Schema;
use SQL::Translator;
my $schema = MyApp::Schema->connect;
my $trans = SQL::Translator->new (
parser => 'SQL::Translator::Parser::DBIx::Class',
parser_args => {
package => $schema,
add_fk_index => 0,
sources => [qw/
Artist
CD
/],
},
producer => 'SQLite',
) or die SQL::Translator->error;
my $out = $trans->translate() or die $trans->error;
DESCRIPTION
This class requires SQL::Translator installed to work.
"SQL::Translator::Parser::DBIx::Class" reads a DBIx::Class schema, interrogates the columns, and stuffs it all in an $sqlt_schema object.
Its primary use is in deploying database layouts described as a set of DBIx::Class classes, to a database. To do this, see "deploy" in
DBIx::Class::Schema.
This can also be achieved by having DBIx::Class export the schema as a set of SQL files ready for import into your database, or passed to
other machines that need to have your application installed but don't have SQL::Translator installed. To do this see "create_ddl_dir" in
DBIx::Class::Schema.
PARSER OPTIONS
add_fk_index
Create an index for each foreign key. Enabled by default, as having indexed foreign key columns is normally the sensible thing to do.
sources
Arguments: @class_names
Limit the amount of parsed sources by supplying an explicit list of source names.
SEE ALSO
SQL::Translator, DBIx::Class::Schema
AUTHORS
See "CONTRIBUTORS" in DBIx::Class.
LICENSE
You may distribute this code under the same terms as Perl itself.
perl v5.16.2 2012-08-16 SQL::Translator::Parser::DBIx::Class(3)