10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise.
Eg :
Select 'Query 1 output' from dual;
Select 'Query 2 output' from dual;
I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies
2. Shell Programming and Scripting
Hi,
I'm having a xml file with multiple xml header. so i want to split the file into multiple files.
Sample.xml consists multiple headers so how can we split these multiple headers into multiple files in unix.
eg :
<?xml version="1.0" encoding="UTF-8"?>
<ml:individual... (3 Replies)
Discussion started by: Narendra921631
3 Replies
3. Shell Programming and Scripting
Hi
How do I translate
Let say
Cat inserts.sql
gives
Insert into PM9_TAXATION_ROUNDING
(STATE_GECODE, TAX_TYPE, TAX_AUTHORITY, SYS_CREATION_DATE, SYS_UPDATE_DATE, APPLICATION_ID, DL_SERVICE_CODE, ROUNDING_METHOD)
Values
('xx', 'xx', 'x', TO_DATE('10/26/2012 13:01:20',... (3 Replies)
Discussion started by: anuj87in
3 Replies
4. Shell Programming and Scripting
Hi ,
I have a below xml:
<ns:Body>
<ns:result>
<Date Month="June" Day="Monday:/>
</ns:result>
</ns:Body>
i have a lookup abc.txtt text file with below details
Month June July August
Day Monday Tuesday Wednesday
I need a output xml with below tags
<ns:Body>
<ns:result>... (2 Replies)
Discussion started by: Nevergivup
2 Replies
5. Shell Programming and Scripting
I've got two different files and want to compare them.
File 1 :
HTML Code:
<response ticketId="944" type="getQueryResults"><status>COMPLETE</status><description>Query results fetched successfully</description><recordSet totalCount="1" type="sms_records"><record... (1 Reply)
Discussion started by: Shaishav Shah
1 Replies
6. Shell Programming and Scripting
Hi All,
I'm stuck with adding multiple lines(irrespective of line number) to a file before a particular xml tag. Please help me.
<A>testing_Location</A>
<value>LA</value>
<zone>US</zone>
<B>Region</B>
<value>Russia</value>
<zone>Washington</zone>
<C>Country</C>... (0 Replies)
Discussion started by: mjavalkar
0 Replies
7. UNIX for Advanced & Expert Users
Hi Experts:
I have a shell script that's kicked off by cron. Inside this shell script, I need to kick off two or more oracle sql scripts to process different groups of tables. And when both sql scripts are done, I will continue in the shell script to do other things like checking processing... (3 Replies)
Discussion started by: huasheng8
3 Replies
8. Shell Programming and Scripting
Hi!
I would like to do a single connection to sqlplus and execute some querys.
Actually I do for every query one connection to database
i.e
echo 'select STATUS from v$instance;
exit' > $SQL_FILE
sqlplus user/pass@sid @$SQL_FILE > $SELECT_RESULT
echo 'select VERSION from v$instance;... (6 Replies)
Discussion started by: guif
6 Replies
9. UNIX for Dummies Questions & Answers
Hi guys,
I am new on here, I have a function in oracle that returns a specific value:
create or replace
PACKAGE BODY "CTC_ASDGET_SCHED" AS
FUNCTION FN_ASDSCHEDULE_GET
RETURN VARCHAR2
AS
BEGIN
DECLARE
ASDSchedule varchar2(6);
ASDComplete... (1 Reply)
Discussion started by: reptile
1 Replies
10. Shell Programming and Scripting
Hi-
I am trying to achieve the following in a script so I can schedule it on a cron job. I am fairly new to the unix environment...
I have written a shell script that reads a flat file and loads the data into an Oracle table (Table1) via SQLLDR. This Works fine. Then, I run a nested insert... (5 Replies)
Discussion started by: rajagavini
5 Replies
SQL::Translator::Producer::XML::SQLFairy(3pm) User Contributed Perl Documentation SQL::Translator::Producer::XML::SQLFairy(3pm)
NAME
SQL::Translator::Producer::XML::SQLFairy - SQLFairy's default XML format
SYNOPSIS
use SQL::Translator;
my $t = SQL::Translator->new(
from => 'MySQL',
to => 'XML-SQLFairy',
filename => 'schema.sql',
show_warnings => 1,
);
print $t->translate;
DESCRIPTION
Creates XML output of a schema, in the flavor of XML used natively by the SQLFairy project (SQL::Translator). This format is detailed here.
The XML lives in the "http://sqlfairy.sourceforge.net/sqlfairy.xml" namespace. With a root element of <schema>.
Objects in the schema are mapped to tags of the same name as the objects class (all lowercase).
The attributes of the objects (e.g. $field->name) are mapped to attributes of the tag, except for sql, comments and action, which get
mapped to child data elements.
List valued attributes (such as the list of fields in an index) get mapped to comma separated lists of values in the attribute.
Child objects, such as a tables fields, get mapped to child tags wrapped in a set of container tags using the plural of their contained
classes name.
An objects' extra attribute (a hash of arbitrary data) is mapped to a tag called extra, with the hash of data as attributes, sorted into
alphabetical order.
e.g.
<schema name="" database=""
xmlns="http://sqlfairy.sourceforge.net/sqlfairy.xml">
<tables>
<table name="Story" order="1">
<fields>
<field name="id" data_type="BIGINT" size="20"
is_nullable="0" is_auto_increment="1" is_primary_key="1"
is_foreign_key="0" order="3">
<extra ZEROFILL="1" />
<comments></comments>
</field>
<field name="created" data_type="datetime" size="0"
is_nullable="1" is_auto_increment="0" is_primary_key="0"
is_foreign_key="0" order="1">
<extra />
<comments></comments>
</field>
...
</fields>
<indices>
<index name="foobar" type="NORMAL" fields="foo,bar" options="" />
</indices>
</table>
</tables>
<views>
<view name="email_list" fields="email" order="1">
<sql>SELECT email FROM Basic WHERE email IS NOT NULL</sql>
</view>
</views>
</schema>
To see a complete example of the XML translate one of your schema :)
$ sqlt -f MySQL -t XML-SQLFairy schema.sql
ARGS
add_prefix
Set to true to use the default namespace prefix of 'sqlf', instead of using the default namespace for
"http://sqlfairy.sourceforge.net/sqlfairy.xml namespace"
e.g.
<!-- add_prefix=0 -->
<field name="foo" />
<!-- add_prefix=1 -->
<sqlf:field name="foo" />
prefix
Set to the namespace prefix you want to use for the "http://sqlfairy.sourceforge.net/sqlfairy.xml namespace"
e.g.
<!-- prefix='foo' -->
<foo:field name="foo" />
newlines
If true (the default) inserts newlines around the XML, otherwise the schema is written on one line.
indent
When using newlines the number of whitespace characters to use as the indent. Default is 2, set to 0 to turn off indenting.
LEGACY FORMAT
The previous version of the SQLFairy XML allowed the attributes of the the schema objects to be written as either xml attributes or as data
elements, in any combination. The old producer could produce attribute only or data element only versions. While this allowed for lots of
flexibility in writing the XML the result is a great many possible XML formats, not so good for DTD writing, XPathing etc! So we have moved
to a fixed version described above.
This version of the producer will now only produce the new style XML. To convert your old format files simply pass them through the
translator :)
$ sqlt -f XML-SQLFairy -t XML-SQLFairy schema-old.xml > schema-new.xml
AUTHORS
Ken Youens-Clark <kclark@cpan.org>, Darren Chamberlain <darren@cpan.org>, Mark Addison <mark.addison@itn.co.uk>.
SEE ALSO
perl(1), SQL::Translator, SQL::Translator::Parser::XML::SQLFairy, SQL::Translator::Schema, XML::Writer.
perl v5.14.2 2012-01-18 SQL::Translator::Producer::XML::SQLFairy(3pm)