Revision 711
Added by Matt Jones over 23 years ago
src/edu/ucsb/nceas/metacat/QuerySpecification.java | ||
---|---|---|
126 | 126 |
System.err.println("USAGE: java QuerySpecification <xmlfile>"); |
127 | 127 |
return; |
128 | 128 |
} else { |
129 |
String xmlfile = args[0]; |
|
130 |
|
|
129 |
int i = 0; |
|
130 |
boolean useXMLIndex = true; |
|
131 |
if ( args[i].equals( "-noindex" ) ) { |
|
132 |
useXMLIndex = false; |
|
133 |
i++; |
|
134 |
} |
|
135 |
String xmlfile = args[i]; |
|
136 |
|
|
131 | 137 |
try { |
132 | 138 |
MetaCatUtil util = new MetaCatUtil(); |
133 | 139 |
FileReader xml = new FileReader(new File(xmlfile)); |
134 | 140 |
QuerySpecification qspec = |
135 | 141 |
new QuerySpecification(xml, util.getOption("saxparser"), |
136 | 142 |
util.getOption("accNumberSeparator")); |
137 |
boolean useXMLIndex = false; |
|
138 | 143 |
System.out.println(qspec.printSQL(useXMLIndex)); |
139 | 144 |
|
140 | 145 |
} catch (IOException e) { |
bin/xml2sql | ||
---|---|---|
25 | 25 |
|
26 | 26 |
export CPATH=$PDIR/build/metacat.jar:$PARSER:$JDBC |
27 | 27 |
|
28 |
echo " " |
|
29 |
echo "WITH INDEX" |
|
30 |
echo "----------" |
|
31 |
echo " " |
|
28 | 32 |
java -cp ${CPATH} edu.ucsb.nceas.metacat.QuerySpecification $1 |
33 |
echo " " |
|
34 |
|
|
35 |
echo "NO INDEX" |
|
36 |
echo "----------" |
|
37 |
echo " " |
|
38 |
java -cp ${CPATH} edu.ucsb.nceas.metacat.QuerySpecification -noindex $1 |
|
39 |
echo " " |
Also available in: Unified diff
Modifications to allow printing of SQL with and without INDEX option.