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)
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)
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)
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)
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)
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)
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)
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)
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)
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
LEARN ABOUT DEBIAN
sql::translator::producer::xml::sqlfairy
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)