Sponsored Content
Full Discussion: Need Help (Select query)
Top Forums Shell Programming and Scripting Need Help (Select query) Post 302166548 by topgear1000cc on Tuesday 12th of February 2008 06:22:05 AM
Old 02-12-2008
Hey thanx again for the quick reply.... I tried temp table as well, but some how its not working, may b i m doin somethin wrong... But still i m happy with 2nd n 3rd Solution provided by u...
Thanx once again...
:-)Smilie wish u all the best
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Select a portion of file based on query

Hi friends :) I am having a small problem and ur help is needed... I have a long file from which i want to select only some portions after filtering (grep). My file looks like : header xxyy lmno xxyy wxyz footer header abcd xy pqrs footer . . (14 Replies)
Discussion started by: vanand420
14 Replies

2. Shell Programming and Scripting

Displaying the data from the select query in a particular format

Hi, I have a shell script that returns 10 records for the column Name and age from a select query. Where when i store those data in retrieve_list.txt file i need to store the data in a particular format like:- $Jason$30 $Bill$23 $Roshan$25 Here is my script: 1)... (15 Replies)
Discussion started by: sachin.tendulka
15 Replies

3. Shell Programming and Scripting

How to store the data retrived by a select query into variables?

Hi Friends, Can u please help mw with the following query . I need to run a database sql statement to select particular fields from a table.I need to store the retrieved filed values into variables so that i can print it in a specific format. But the particular select query retrieves more... (12 Replies)
Discussion started by: jisha
12 Replies

4. UNIX for Dummies Questions & Answers

Reading from a file and passing the value to a select query

Hi all, Here is my problem. I want to read data from a file and pass the variable to a select query. I tried but it doesn't seem to work. Please advise. Example below. FileName='filekey.txt' while read LINE do var=$LINE print "For File key $var" ${ORACLE_HOME}/bin/sqlplus -s... (1 Reply)
Discussion started by: er_ashu
1 Replies

5. Shell Programming and Scripting

Redirect Postgresql Select Query to Variable

How to redirect postgresql select query to a variable using shell scripts? I tried to use psql -c "select ip from servers" db | egrep '+\.+\+\+' | sed 's/^ *\(.*\) *$/\1/' Output: 10.10.10.180 10.10.10.181 It display ip addresses from the databasem, but how could i redirect the... (3 Replies)
Discussion started by: uativan
3 Replies

6. Shell Programming and Scripting

Select query implement in a shell

I have been asked to create a shell script that accepts a number of SQL select queries as input, runs them in sequence, spools the output to an EXCEL workbook, where, each worksheet is an output of a Select statement run above. The workbook should be in a .XLS format. If a particular select... (2 Replies)
Discussion started by: ShellNovice1
2 Replies

7. Shell Programming and Scripting

mysql select query optimization..

hi.. i need to optimize my select query .. my situation is like this .. i have 15 lac recors in my table.. the following query takes nine seconds to give the required output.. SELECT max(ah.AUC_AMT), SUBSTRING_INDEX(GROUP_CONCAT(SUBSTRING_INDEX(ah.AUC_CUS_NAME,'@',1) order by AUC_AMT... (0 Replies)
Discussion started by: senkerth
0 Replies

8. UNIX for Advanced & Expert Users

mysql select query optimization..

hi.. i need to optimize my select query .. my situation is like this .. i have 15 lac recors in my table.. the following query takes nine seconds to give the required output.. SELECT max(ah.AUC_AMT), SUBSTRING_INDEX(GROUP_CONCAT(SUBSTRING_INDEX(ah.AUC_CUS_NAME,'@',1) order by AUC_AMT... (1 Reply)
Discussion started by: senkerth
1 Replies

9. Shell Programming and Scripting

Help in executing select query from perl script

Hi, I have a perl snippet that call a select query with a bind variable,when i compile the script I'm unable to get the query output. The same query when i fire in sqlplus fetches few rows. The query takes bit time to fetch results in sqlplus. my $getaccts = $lda->prepare("select distinct ... (1 Reply)
Discussion started by: rkrish
1 Replies

10. Programming

Query to SELECT only Column Names that Contain a Specific String?

Hey Guys, I'm using SQuirreL SQL v3.5 GUI to fetch some data that I need for something I'm working on. I'm also using the IBM Informix Driver (*Version 3.5) to connect to the Database. What I want to do, if it's even possible, is to show all COLUMNS if they contain the word "Email". So in... (2 Replies)
Discussion started by: mrm5102
2 Replies
Data::Serializer::Cookbook(3pm) 			User Contributed Perl Documentation			   Data::Serializer::Cookbook(3pm)

NAME
Cookbook - Examples of how to use Data::Serializer DESCRIPTION
Data::Serializer::Cookbook is a collection of solutions for using Data::Serializer. CONVENTIONS
Unless otherwise specified, all examples can be assumed to begin with: use Data::Serializer; my $serializer = Data::Serializer->new(); Some examples will show different arguments to the new method, where specified simply use that line instead of the simple form above. CONVENTIONS for Raw Access Fort hose who want a straight pass through to the underlying serializer, where nothing else is done (no encoding, encryption, compression, etc) there is Data::Serializer::Raw(3). These begin like this: use Data::Serializer::Raw; my $raw_serializer = Data::Serializer::Raw->new(); Encrypting your data You wish to encrypt your data structure, so that it can only be decoded by someone who shares the same key. Solution $serializer->secret('mysecret'); my $encrypted_hashref = $serializer->serializer($hash); ... (in other program) ... $serializer->secret('mysecret'); my $clear_hash = $serializer->deserializer($encrypted_hash); Note: You will have to have the Crypt::CBC module installed for this to work. Compressing your data You wish to compress your data structure to cut down on how much disk space it will take up. Solution $serializer->compress(1); my $compressed_hashref = $serializer->serializer($hash); ... (in other program) ... my $clear_hash = $serializer->deserializer($compressed_hash); Note: You will have to have the Compress::Zlib module installed for this to work. Your mileage will vary dramatically depending on what serializer you use. Some serializers are already fairly compact. You want to read in data serialized outside of Data::Serializer You need to write a program that can read in data serialized in a format other than Data::Serializer. For example you need to be able to be able to process data serialized by XML::Dumper. Solution use Data::Serializer::Raw; my $xml_raw_serializer = Data::Serializer::Raw->(serializer => 'XML::Dumper'); my $hash_ref = $xml_raw_serializer->deserialize($xml_data); You want to write serialized data in a form understood outside of Data::Serializer You need to write a program that can write out data in a format other than Data::Serializer. Or said more generically you need to write out data in the format native to the underlying serializer. For our example we will be exporting data using XML::Dumper format. Solution ues Data::Serializer::Raw; my $xml_raw_serializer = Data::Serializer::Raw->(serializer => 'XML::Dumper'); my $xml_data = $xml_raw_serializer->serialize($hash_ref); You want to convert data between two different serializers native formats You have data serialized by php that you want to convert to xml for use by other programs. Solution use Data::Serializer::Raw; my $xml_raw_serializer = Data::Serializer::Raw->(serializer => 'XML::Dumper'); my $php_raw_serializer = Data::Serializer::Raw->(serializer => 'PHP::Serialization'); my $hash_ref = $php_raw_serializer->deserialize($php_data); my $xml_data = $xml_raw_serializer->serialize($hash_ref); Keeping data persistent between executions of a program. You have a program that you run every 10 minutes, it uses SNMP to pull some counters from one of your routers. You want your program to keep the counters from the last run so that it can see how much traffic has passed over a link since it last ran. Solution # path to store our serialized data # be paranoid, use full paths my $last_run_datafile = '/full/path/to/file/lastrun.data'; #We keep our data as a hash reference my $last_data = $serializer->retrieve($last_run_datafile); #Pull in our new data through 'pull_data()'; my $new_data = query_router($router); #run comparison code run_comparison($last_data,$new_data); $serializer->store($new_data); AUTHOR
Neil Neely <neil@neely.cx>. COPYRIGHT
Copyright (c) 2001-2011 Neil Neely. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
Data::Serializer(3) Data::Serializer::Raw(3) perl v5.12.4 2011-08-16 Data::Serializer::Cookbook(3pm)
All times are GMT -4. The time now is 08:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy