Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Shell Script: Traverse Database Table Row by Row Post 302549230 by gary_w on Monday 22nd of August 2011 10:00:47 AM
Old 08-22-2011
Have a look at this example of reading data into shell variables from a SQL/Plus session. It should be of some help:

https://www.unix.com/shell-programmin...variables.html
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script add each row value

Hi, I wrote below small script which will add up each row value from a file and print the total, but it is not.plz let me know what is wrong.script hangs and not displaying anything. ----------------- while read line ; do sum=0; sum=$sum+$line; done echo $sum; exit 0; ------------------... (8 Replies)
Discussion started by: pradeep_script
8 Replies

2. Shell Programming and Scripting

How to do row comparison in shell script

Hi, I need help on doing the below thing in shell script. I have a file with millions of rows called "abc.txt". i have another file with millions of rows called "xyz.txt". I would like to do the below operation. Open the abc.txt, read the first line, do some operations on the column... (2 Replies)
Discussion started by: informsrini
2 Replies

3. Shell Programming and Scripting

Script shell on line and row

Hello, I want to make a script to do this : the file is with line : TOTO TEST1 TOTO TEST2 TITI TEST1 TITI TEST2 TITI TEST3 i want he become : TOTO TEST1 TEST2 TITI TEST1 TEST2 TEST3 (3 Replies)
Discussion started by: safsound
3 Replies

4. Shell Programming and Scripting

Moving new row and deleting old row to another table

Hi, I want to move a new row to another table if the field from new row doesn't have the first word that I categorized (like: IRC blablabla, PTM blablabla, ADM blablabla, BS blablabla). I already use this script but doesn't work as I expected. CHECK_KEYWORD="$( mysql -uroot -p123456 smsd -N... (7 Replies)
Discussion started by: jazzyzha
7 Replies

5. Shell Programming and Scripting

In php, Moving a new row to another table and deleting old row

Hi, I already succeed moving a new row to another table if the field from new row doesn't have the first word that I categorized (like: IRC blablabla, PTM blablabla, ADM blablabla, BS blablabla). But it can't delete the old row. Please help me with the script. my php script: INSERT INTO... (2 Replies)
Discussion started by: jazzyzha
2 Replies

6. Shell Programming and Scripting

awk to convert table-by-row to matrix table

Hello, I need some help to reformat this table-by-row to matrix? infile: site1 A:o,p,q,r,s,t site1 C:y,u site1 T:v,w site1 -:x,z site2 A:p,r,t,v,w,z site2 C:u,y site2 G:q,s site2 -:o,x site3 A:o,q,s,t,u,z site3 C:y site3 T:v,w,x site3 -:p,routfile: SITE o p q r s t v u w x y... (7 Replies)
Discussion started by: yifangt
7 Replies

7. Shell Programming and Scripting

Add Row from First Row (Split Row)

HI Guys, I have Below Input :- RepigA_hteis522 ReptCfiEtrBsCll_aofe MSL04_MSL2_A25_1A 0 9 MSL04_MSL2_A25_1B 0 9 MSL04_MSL2_A25_1C 0 9 RepigA ReptCfiEtrBsCll hteis522 aofe MSL04_MSL2_A25_1A 0 9 MSL04_MSL2_A25_1B 0 9 MSL04_MSL2_A25_1C 0 9 Split Data in two first row... (2 Replies)
Discussion started by: pareshkp
2 Replies

8. UNIX for Beginners Questions & Answers

Keep only the closet match of timestamped row (include headers) from file1 to precede file2 row/s

My original files are like this below and I distinguish them from the AP_ID (file1 has 572 and file2 has 544). Also, the header on file1 has “G_” pre-pended. NOTE: these are only snippets of very large files and much of the data is not present here. Original File 1: ... (36 Replies)
Discussion started by: aachave1
36 Replies

9. Shell Programming and Scripting

Splitting single row into multiple rows based on for every 10 digits of last field of the row

Hi ALL, We have requirement in a file, i have multiple rows. Example below: Input file rows 01,1,102319,0,0,70,26,U,1,331,000000113200000011920000001212 01,1,102319,0,1,80,20,U,1,241,00000059420000006021 I need my output file should be as mentioned below. Last field should split for... (4 Replies)
Discussion started by: kotra
4 Replies

10. UNIX for Beginners Questions & Answers

Keep only the closet match of timestamped row (include headers) from file1 to precede file2 row/s

This is a question that is related to one I had last August when I was trying to sort/merge two files by millsecond time column (in this case column 6). The script (below) that helped me last august by RudiC solved the puzzle of sorting/merging two files by time, except it gets lost when the... (0 Replies)
Discussion started by: aachave1
0 Replies
DBIx::Class::Manual::Glossary(3)			User Contributed Perl Documentation			  DBIx::Class::Manual::Glossary(3)

NAME
DBIx::Class::Manual::Glossary - Clarification of terms used. INTRODUCTION
This document lists various terms used in DBIx::Class and attempts to explain them. DBIx::Class TERMS DB schema Refers to a single physical schema within an RDBMS. Synonymous with the terms 'database', for MySQL; and 'schema', for most other RDBMS(s). In other words, it's the 'xyz' _thing_ you're connecting to when using any of the following DSN(s): dbi:DriverName:xyz@hostname:port dbi:DriverName:database=xyz;host=hostname;port=port Inflation The act of turning database row data into objects in language-space. DBIx::Class result classes can be set up to inflate your data into perl objects which more usefully represent their contents. For example: DBIx::Class::InflateColumn::DateTime for datetime or timestamp column data. See also DBIx::Class::InflateColumn. Deflation The opposite of "Inflation". Existing perl objects that represent column values can be passed to DBIx::Class methods to store into the database. For example a DateTime object can be automatically deflated into a datetime string for insertion. See DBIx::Class::InflateColumn and other modules in that namespace. ORM Object-relational mapping, or Object-relationship modelling. Either way it's a method of mapping the contents of database tables (rows), to objects in programming-language-space. DBIx::Class is an ORM. Relationship In DBIx::Class a relationship defines the connection between exactly two tables. The relationship condition lists the columns in each table that contain the same values. It is used to output an SQL JOIN condition between the tables. Relationship bridge A relationship bridge, such as "many_to_many" defines an accessor to retrieve row contents across multiple relationships. The difference between a bridge and a relationship is, that the bridge cannot be used to "join" tables in a "search", instead its component relationships must be used. Schema A Schema object represents your entire table collection, plus the connection to the database. You can create one or more schema objects, connected to various databases, with various users, using the same set of table "Result class" definitions. At least one DBIx::Class::Schema class is needed per database. Result class A Result class defines both a source of data (usually one per table), and the methods that will be available in the "Row" objects created using that source. One Result class is needed per data source (table, view, query) used in your application, they should inherit from DBIx::Class::Core. ResultSource ResultSource objects represent the source of your data, these are sometimes (incorrectly) called table objects. ResultSources do not need to be directly created, a ResultSource instance is created for each "Result class" in your "Schema", by the proxied methods "table" and "add_columns". See also: "METHODS" in DBIx::Class::ResultSource ResultSet This is an object representing a set of conditions to filter data. It can either be an entire table, or the results of a query. The actual data is not held in the ResultSet, it is only a description of how to fetch the data. See also: "METHODS" in DBIx::Class::ResultSet Record See Row. Row Row objects contain your actual data. They are returned from ResultSet objects. Object See Row. join prefetch SQL TERMS
Join This is an SQL keyword, it is used to link multiple tables in one SQL statement. This enables us to fetch data from more than one table at once, or filter data based on content in another table, without having to issue multiple SQL queries. Normalisation A normalised database is a sane database. Each table contains only data belonging to one concept, related tables refer to the key field or fields of each other. Some links to webpages about normalisation can be found in DBIx::Class::Manual::FAQ. Related data In SQL, related data actually refers to data that are normalised into the same table. (Yes. DBIC does mis-use this term). perl v5.16.2 2012-10-18 DBIx::Class::Manual::Glossary(3)
All times are GMT -4. The time now is 10:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy