Sponsored Content
Top Forums Shell Programming and Scripting From sql Insert Query to XML format Post 302795561 by hanson44 on Thursday 18th of April 2013 03:25:08 AM
Old 04-18-2013
It's good you use code tags. But put the whole section in one tag. You don't need a separate tag for each line. It makes it hard to read...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to Format the result driven from a SQL Query

Hi All, I want to format the result driven from the query into neat format. For example pls find the below code, #! /bin/sh result=' sqlplus -s uname/passwrd@DBname select no,name,address,ph_no, passport_no,salary,designation from emp_table where salary>1000; exit EOF' ... (8 Replies)
Discussion started by: little_wonder
8 Replies

2. Shell Programming and Scripting

need to create a insert query for a file

Hi Guys, I need to create a insert query for the below file Fri Sep 4 06:25:51 2009 ACTION : 'CREATE INDEX S100S_DC.PLInsuranceReportRules_testI1 ON S100S_DC.PLInsuranceReportRules_test1(ENTITY_KEY)' DATABASE USER: '/' PRIVILEGE : SYSDBA CLIENT USER: oracle CLIENT TERMINAL: pts/3... (6 Replies)
Discussion started by: mac4rfree
6 Replies

3. Shell Programming and Scripting

How to use sql data file in unix csv file as input to an sql query from shell

Hi , I used the below script to get the sql data into csv file using unix scripting. I m getting the output into an output file but the output file is not displayed in a separe columns . #!/bin/ksh export FILE_PATH=/maav/home/xyz/abc/ rm $FILE_PATH/sample.csv sqlplus -s... (2 Replies)
Discussion started by: Nareshp
2 Replies

4. Shell Programming and Scripting

Convertion of Date Format using SQL query in a shell script

When I write Select date_field from TableA fetch first row only I am getting the output as 09/25/2009. I want to get the output in the below format 2009-09-25 i.e., MM-DD-YYYY. Please help (7 Replies)
Discussion started by: dinesh1985
7 Replies

5. Programming

SQL : Fine tune Insert by query

i would like to know how can i fine tune the following query since the cost of the query is too high .. insert into temp temp_1 select a,b,c,d from xxxx .. database used is IDS.. (1 Reply)
Discussion started by: expert
1 Replies

6. Shell Programming and Scripting

How to use a variable in insert query?

My script contains as follows, VALUE=`sqlplus un/pwd <<EOF > OB.txt set pagesize 0 feedback off verify off heading off echo off select max(1) from table1; exit; EOF` insert into table2 values(1, 'The max value is $value',...); i need the value of VALUE to be inserted after 'The max... (2 Replies)
Discussion started by: savithavijay
2 Replies

7. Shell Programming and Scripting

Forming an insert query using awk

Hi, I'm trying to form an insert sql query using shell programming. I have table named company with four columns 'company name', 'company id', 'company code' and 'last change id' I have to read the company name, company code and last change id from a file delimited by | which has around 10... (4 Replies)
Discussion started by: rakesh_s
4 Replies

8. Programming

insert query help

Hello i want help to load data from file into mysql DB this part i know how to do but during loading i want to combine 2 fields into 1 field and insert into db as primary key in new column thanks advice how to do so (5 Replies)
Discussion started by: mogabr
5 Replies

9. Shell Programming and Scripting

Run SQL thru shell script: how to get a new line when run sql query?

Hi, this's Pom. I'm quite a new one for shell script but I have to do sql on shell script to query some information from database. I found a concern to get a new line...When I run my script, it retrieves all data as wondering but it's shown in one line :( What should I do? I'm not sure that... (2 Replies)
Discussion started by: Kapom
2 Replies

10. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies
MARC::File::USMARC(3pm) 				User Contributed Perl Documentation				   MARC::File::USMARC(3pm)

NAME
MARC::File::USMARC - USMARC-specific file handling SYNOPSIS
use MARC::File::USMARC; my $file = MARC::File::USMARC->in( $filename ); while ( my $marc = $file->next() ) { # Do something } $file->close(); undef $file; EXPORT
None. METHODS
decode( $string [, &filter_func ] ) Constructor for handling data from a USMARC file. This function takes care of all the tag directory parsing & mangling. Any warnings or coercions can be checked in the "warnings()" function. The $filter_func is an optional reference to a user-supplied function that determines on a tag-by-tag basis if you want the tag passed to it to be put into the MARC record. The function is passed the tag number and the raw tag data, and must return a boolean. The return of a true value tells MARC::File::USMARC::decode that the tag should get put into the resulting MARC record. For example, if you only want title and subject tags in your MARC record, try this: sub filter { my ($tagno,$tagdata) = @_; return ($tagno == 245) || ($tagno >= 600 && $tagno <= 699); } my $marc = MARC::File::USMARC->decode( $string, &filter ); Why would you want to do such a thing? The big reason is that creating fields is processor-intensive, and if your program is doing read- only data analysis and needs to be as fast as possible, you can save time by not creating fields that you'll be ignoring anyway. Another possible use is if you're only interested in printing certain tags from the record, then you can filter them when you read from disc and not have to delete unwanted tags yourself. update_leader() If any changes get made to the MARC record, the first 5 bytes of the leader (the length) will be invalid. This function updates the leader with the correct length of the record as it would be if written out to a file. _build_tag_directory() Function for internal use only: Builds the tag directory that gets put in front of the data in a MARC record. Returns two array references, and two lengths: The tag directory, and the data fields themselves, the length of all data (including the Leader that we expect will be added), and the size of the Leader and tag directory. encode() Returns a string of characters suitable for writing out to a USMARC file, including the leader, directory and all the fields. RELATED MODULES
MARC::Record TODO
Make some sort of autodispatch so that you don't have to explicitly specify the MARC::File::X subclass, sort of like how DBI knows to use DBD::Oracle or DBD::Mysql. Create a toggle-able option to check inside the field data for end of field characters. Presumably it would be good to have it turned on all the time, but it's nice to be able to opt out if you don't want to take the performance hit. LICENSE
This code may be distributed under the same terms as Perl itself. Please note that these modules are not products of or supported by the employers of the various contributors to the code. AUTHOR
Andy Lester, "<andy@petdance.com>" perl v5.10.1 2010-03-29 MARC::File::USMARC(3pm)
All times are GMT -4. The time now is 06:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy