SQL database call into Multidimensional Array using Perl Script
-Comments Describing what I'm doing--------------
-I'm pulling information from a database that has an ID and Name. They are separated by a space and I'm trying to load them into a multidimensional array so as to manipulate Name of each element while keeping it's relationship to the ID constant.--------------------------
When I print #1, the information displays exactly how it should, but somewhere between the push and split function it goes wrong.
-I'm using the following statement to print out the results of the multi-dimensional array--------------------
Any thing will help.
Last edited by radoulov; 12-30-2011 at 04:50 PM..
Reason: Code tags!
i'm trying to open a file with three or more columns and an undetermined, but finite number of rows. I want to define an array for each row with each element of the row as a sub array. The columns are separated by tabs or spaces.
Here's the file:
12x3.12z34b.342sd3.sds 454.23.23.232 ... (9 Replies)
Hello Experts,,
Can anybody give me a brief idea what is following bold letter statement is for!!
what is the term called so that I can google for it..
It seems to be an array inside another array..
awk'
/TXADDR/ { txaddr=$NF } ##understood
/TXDATA/ { txdata]=$NF... (1 Reply)
In a single dim. awk array, we can use :
<index> in <array name>
to determine whether a particualar index exists in the array or not.
Is there a way to achieve this in a awk multi dim. array ? (4 Replies)
Hi! I need to make dynamic multidimensional arrays using the vector class. I found in this page How to dynamically create a two dimensional array? - Microsoft: Visual C++ FAQ - Tek-Tips the way to do it in 2D, and now i'm trying to expand it to 3D but i don't understand how is the operator working,... (0 Replies)
I'm currently working with dozens of FASTA files, and I'm tired of having to manually change the filename in my Perl script.
I'm trying to write a simple Perl script that'll create a 2-dimensional array containing the name of the folders and its contents.
For example, I would like the output... (6 Replies)
i have a file,like
1 3
4 5
6 7
8 9
i want to save it into an array.
and then i want to get every element, because i want to use them to calculate. for example: i want to calculate 1 + 3.
but i cannot reach my goal.
open (FILE, "<", "number");
my @arr;
while (<FILE>){
chomp;... (1 Reply)
Hi,
I was trying to process a file with the help of awk. I want to first display all the rows that contains 01 and at the end of processing I have to print some portion of all the lines. like below.
Output expected: (2 Replies)
Hi,
I am in the need of doing a bulk insert via :
SQL - INSERT INTO <table> (SELECT..)
OR
PLSQL Block - FORALL i IN 1 .. count INSERT INTO <table>(arrayname(i))
I have a 2D array in my perl code which has the rows to be bulk inserted.
Is there a way to bind the 2D array to the SQL... (4 Replies)
Hello,
Could someone please suggest if there is a way to pass an perl array(pass @v_array) to SQL as in below eg :
#!/usr/bin/perl
@v_array = (1,2,4,5,6,8);
$db_userid = 'ni71/ni711';
$bufTPO = qx{ sqlplus -s << EOF
$db_userid
set verify off
set feedback off
set... (1 Reply)
I am learning about bash system variables, such as $ , @ and #.
I have this piece of script implementing an array and it is doing its job just fine.
This is not the only array I will be using.
Just for ease of maintenance and more coding I would like to have the arrays in two dimensional... (4 Replies)
Discussion started by: annacreek
4 Replies
LEARN ABOUT DEBIAN
jifty::dbi::handle::pg
Jifty::DBI::Handle::Pg(3pm) User Contributed Perl Documentation Jifty::DBI::Handle::Pg(3pm)NAME
Jifty::DBI::Handle::Pg - A Postgres specific Handle object
SYNOPSIS DESCRIPTION
This module provides a subclass of Jifty::DBI::Handle that compensates for some of the idiosyncrasies of Postgres.
METHODS
connect
connect takes a hashref and passes it off to SUPER::connect; Forces the timezone to GMT, returns a database handle.
insert
Takes a table name as the first argument and assumes that the rest of the arguments are an array of key-value pairs to be inserted.
In case of insert failure, returns a Class::ReturnValue object preloaded with error info
id_sequence_name TABLE
Takes a TABLE name and returns the name of the sequence of the primary key for that table.
blob_params column_NAME column_type
Returns a hash ref for the bind_param call to identify BLOB types used by the current database for a particular column type. The current
Postgres implementation only supports BYTEA types.
apply_limits STATEMENTREF ROWS_PER_PAGE FIRST_ROW
takes an SQL SELECT statement and massages it to return ROWS_PER_PAGE starting with FIRST_ROW;
_make_clause_case_insensitive column operator VALUE
Takes a column, operator and value. performs the magic necessary to make your database treat this clause as case insensitive.
Returns a column operator value triple.
distinct_query STATEMENTREF
takes an incomplete SQL SELECT statement and massages it to return a DISTINCT result set.
canonical_true
The canonical true value in Postgres is 't'.
canonical_false
The canonical false value in Postgres is 'f'.
SEE ALSO
Jifty::DBI, Jifty::DBI::Handle, DBD::Pg
perl v5.14.2 2011-04-26 Jifty::DBI::Handle::Pg(3pm)