Sponsored Content
Top Forums Shell Programming and Scripting How to execute a no of SELECT COUNT(*) statements using a loop Post 302454615 by chebarbudo on Sunday 19th of September 2010 08:43:37 AM
Old 09-19-2010
Hi Ustechie,
Can you please post how your file looks like.
We have very few information.
If it's written in SQL then I'd do:
Code:
while true; do
    mysql < input.file
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

for i loop with conditional statements?

New to scripting in general, so patience plz. If I ask a stupid question or don't get it, I thank you for your kindness in advance. That said, did a for i loops checks to see if a PB* file is there but I need to know two things before I copy the file. I need to know if the file's create date... (2 Replies)
Discussion started by: xgringo
2 Replies

2. Shell Programming and Scripting

is that possible to keep statements in any loop??

Hi, Actually i stored all validdisks in one array and corresponding partitions required for all individual disks in other array.. Example: Validdisks=dsk2 dsk3 dsk5 ValidPartition=4 4 3 Now i have to create domain.. Domain creation can be done by below commands: fs_setup -d... (1 Reply)
Discussion started by: mansa
1 Replies

3. Shell Programming and Scripting

How do I execute multiple statements within If then else

Please help me. I have been doing this for several hours. Here is the code if then echo a b c d >> file.txt echo 1111 >> file.txt fi The reason I want the two echo is because I want these statements printed on multiple lines. I keep getting error . First it tells me... (2 Replies)
Discussion started by: asemota
2 Replies

4. Shell Programming and Scripting

for each value in an array, execute select statement

Hello All, I am new to shell scripting. I am working on Solaris O/S, bash script and sybase programming. I want to loop through multiple values in an array and for each value, I want to select a row from the database. following is the code written for it. output="loop.csv" ... (8 Replies)
Discussion started by: arundhati_s
8 Replies

5. Shell Programming and Scripting

execute multiple statements in if-else

how can we execute multiple statements in else condition i have if then statement else statements fi in else condition i have multiple statements but it executing only one statement is there any way to execute multiple statements (4 Replies)
Discussion started by: nani1984
4 Replies

6. Shell Programming and Scripting

Combine 4 awk pattern count statements into 1

Hello fellow awkers, I am trying to combine the following awk statements into 1 so that the results are more accurate: awk '/\=\+/ { count++ } END { print count}' filename awk '/\=\?/ { count++ } END { print count}' filename awk '/\=\-/ { count++ } END { print count}' filename awk... (8 Replies)
Discussion started by: ux4me
8 Replies

7. Shell Programming and Scripting

2 statements in for loop

Bash shell, variables i and rem are working fine in 2 separate for loops, but I'd like to consolidate them like this: for && This gives syntax error on &&. Thanks in advance for direction. (5 Replies)
Discussion started by: p1ne
5 Replies

8. Shell Programming and Scripting

Count lines with awk if statements

Hi Everybody, I wanna count lines in many files, but only if they meet a condition, I have something like this, cat /path1/usr/STAT/GPRS/ESTCOL_GPRS_2016* | awk 'BEGIN{FS=",";}{ if (substr($5,1,8)=='$DATE'){a++} END{for(i in a)print a}}' DATE=$(date +%Y%m%d -d "1 day ago") But it has... (6 Replies)
Discussion started by: Elly
6 Replies

9. Shell Programming and Scripting

For loop statements order of operations

Say I have a for loop that parse through a file....Say it look for the colors red and blue in sections of the file. Say it find red before it find blue in the file. Say I have two if statements in the for loop Something like if blue is found print blue is my favorite color is the first if... (7 Replies)
Discussion started by: scj2012
7 Replies

10. UNIX for Beginners Questions & Answers

One Line Command how to use pipe statements to execute and comment on multiple possible outcomes

Hello Forum, I'm looking to expand the following command: INACTIVE_KERNELS=$(python -mplatform | grep -qi red && rpm -qa | grep '^kernel-' |grep -vE `uname -r` | paste -sd \; || echo "Not Red Hat Server") Currently this command will check if my server is RedHat server using the grep -qi... (6 Replies)
Discussion started by: greavette
6 Replies
RDF::Query::Compiler::SQL(3pm)				User Contributed Perl Documentation			    RDF::Query::Compiler::SQL(3pm)

NAME
RDF::Query::Compiler::SQL - Compile a SPARQL query directly to SQL. VERSION
This document describes RDF::Query::Compiler::SQL version 2.908. METHODS
"new ( $parse_tree )" Returns a new compiler object. "compile ()" Returns a SQL query string for the specified parse tree. "emit_select" Returns a SQL query string representing the query. "limit_clause" Returns a SQL LIMIT clause, or an empty string if the query does not need limiting. "order_by_clause" Returns a SQL ORDER BY clause, or an empty string if the query does not use ordering. "variable_columns ( $var )" Given a variable name, returns the set of column aliases that store the values for the column (values for Literals, URIs, and Blank Nodes). "add_variable_values_joins" Modifies the query by adding LEFT JOINs to the tables in the database that contain the node values (for literals, resources, and blank nodes). "patterns2sql ( @triples, $level, %args )" Builds the SQL query in instance data from the supplied @triples. $level is used as a unique identifier for recursive calls. %args may contain callback closures for the following keys: 'where_hook' 'from_hook' When present, these closures are used to add SQL FROM and WHERE clauses to the query instead of adding them directly to the object's instance data. "expr2sql ( $expression, $level, %args )" Returns a SQL expression for the supplied query $expression. $level is used as a unique identifier for recursive calls. %args may contain callback closures for the following keys: 'where_hook' 'from_hook' When present, these closures are used to add necessary SQL FROM and WHERE clauses to the query. "_mysql_hash ( $data )" Returns a hash value for the supplied $data string. This value is computed using the same algorithm that Redland's mysql storage backend uses. "_mysql_node_hash ( $node )" Returns a hash value (computed by "_mysql_hash" for the supplied $node. The hash value is based on the string value of the node and the node type. "qualify_uri ( $uri )" Returns a fully qualified URI from the supplied $uri. $uri may already be a qualified URI, or a parse tree for a qualified URI or QName. If $uri is a QName, the namespaces defined in the query parse tree are used to fully qualify. "add_function ( $uri, $function )" Associates the custom function $function (a CODE reference) with the specified URI, allowing the function to be called by query FILTERs. "get_function ( $uri )" If $uri is associated with a query function, returns a CODE reference to the function. Otherwise returns "undef". AUTHOR
Gregory Williams <gwilliams@cpan.org> perl v5.14.2 2012-01-31 RDF::Query::Compiler::SQL(3pm)
All times are GMT -4. The time now is 12:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy