[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Missing post? - see this post about spam for more information.
Change column delimiter?  XML
Forum Index » Jisql
Author Message
rrankins

Newbie

Joined: 05/04/2011 09:17:02
Messages: 2
Offline

Hi - we are migrating our databases from Sybase to SQL Server, but still have some Unix scripts that we need to run on a daily basis that need to access SQL Server.
Currently we use Sybase's isql to submit queries from our Unix scripts against the Sybase server, but of course, that won't work against SQL Server datbases.
Jisql seems like just the tool we need to replace isql in our Unix scripts to submit the queries against SQL Server.
however, the jisql defaults to using the vertical bar ( "|" ) as the column delimiter instead of just an blank space like isql does.
We have some scripts that parse the isql output so it's important that the output from jisql look as mush like the isql output as possible.

Is there a way to change the default column separator in jisql from the vertical bar to a single space?
I tried using the -delimiter option with the default format, but I get the following error:

joptsimple.UnrecognizedOptionException: 'd' is not a recognized option
at joptsimple.OptionException.unrecognizedOption(OptionException.java:93)
at joptsimple.OptionParser.validateOptionCharacters(OptionParser.java:470)
at joptsimple.OptionParser.handleShortOptionCluster(OptionParser.java:420)
at joptsimple.OptionParser.handleShortOptionToken(OptionParser.java:415)
at joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:57)
at joptsimple.OptionParser.parse(OptionParser.java:392)
at com.xigole.util.sql.Jisql.parseArgs(Jisql.java:552)
at com.xigole.util.sql.Jisql.main(Jisql.java:261)


I'm using version 2.0.8.422.

Here is the command line I'm running when running Jisql againts our Sybase erver


java -classpath $CLASSPATH com.xigole.util.sql.Jisql -user myuser -password mypasswd -driver jconnect6 -cstring jdbc:sybase:Tds:myserver:3020/mydb -formatter default -left -delimiter

If I leave off the -delimiter option, it runs fine, but as I said, It's putting vertical bars between the columns.

Thanks,
Ray

stdunbar

Newbie
[Avatar]

Joined: 06/22/2005 14:51:37
Messages: 884
Location: Superior, CO, USA
Offline

Yep - there's a bug. Try the new 2.0.9. I don't have access to a native Sybase or MS/SQL to verify it though. Try it and see if it works as you expect. My command line included the option -delimiter " " - that's a space between two double quotes.

Edit - and I'm sorry about your venture to the dark side

This message was edited 1 time. Last update was at 05/04/2011 20:37:24


Thanks for using the forums at hotjoe.com
[WWW] [Yahoo!] [ICQ]
rrankins

Newbie

Joined: 05/04/2011 09:17:02
Messages: 2
Offline

Thanks - that did the trick. We need to do some more testing, but I think this will work okay for us. We'll just have to make some minor modifications to our shell scripts to invoke jisql instead of isql.

Now we just need to find a flavor of bcp that runs on Unix that has the ability to import/export to/from SQL Server.
Do you know of anything that's out there that's free?

Actually, our move to the "dark side" is being forced somewhat by Sybase and their unwillingness to negotiate with our agency on maintenance and licensing costs. They appear that they'd rather lose a customer than offer any sort of discount.
We're actually looking forward to moving to SQL Server as it has a much richer T-SQL language than Sybase has these days, a much richer development and adminstriation toolset, and the server we are running on has significantly better performance than the server that Sybase is running on (more, and faster CPUs, signficnatly more memory, much faster disk). We are just limping along on our Sybase server which is woefully under configured for our purposes but there's no budget (or desire) to upgrade the server.

Anyway, thanks for the quick fix.

-Ray
 
Forum Index » Jisql
Go to:   
Powered by JForum 2.1.9 © JForum Team
This site run by Scott Dunbar of Xigole Systems. © 2005-2012 - Scott Dunbar
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners
hotjoe.com, xigole.com, and Scott Dunbar have no affiliation with Oracle