sql utility

datamoeras
Posts: 5
Joined: Mon Aug 09, 2010 9:12 am

sql utility

Post by datamoeras » Wed Sep 08, 2010 10:15 am

I'm trying to get the sql utility to work. The system is Autoline (KCML 06.20.50.15148 for Linux).

I've tried different parameters, using the information we have from the kconf.xml file:

$ sql -d DEMO -u kccdm -z
Virtual database: No tables to show

If I add a query, I get this error:
$ sql -d DEMO -u kccdm "SELECT * FROM terms"
operation not allowed on virtual database

The documentation on the sql utility is virtually nonexistent, so I'm hoping anyone here was able to get it to work on Autoline, and would like to share the knowledge!

Regards,
Mike

Thor
Posts: 11
Joined: Sat Jan 09, 2010 9:56 pm

Re: sql utility

Post by Thor » Thu Sep 09, 2010 6:00 am

You should get a list of the switches and what they do
If you do sql -?
:D

datamoeras
Posts: 5
Joined: Mon Aug 09, 2010 9:12 am

Re: sql utility

Post by datamoeras » Thu Sep 09, 2010 8:00 am

Hi Thor,

We have found documentation on the commandline switches before, but we are missing any documentation on the errors the sql utility is returning...

Thor
Posts: 11
Joined: Sat Jan 09, 2010 9:56 pm

Re: sql utility

Post by Thor » Thu Sep 09, 2010 9:01 am

If you do
sql -d DEMO -u kccdm -z
you will get a list of the tables in the database

so I think you need to do
sql -d DEMO -u kccdm "select * from GB_00_Terminals"

Thor
Posts: 11
Joined: Sat Jan 09, 2010 9:56 pm

Re: sql utility

Post by Thor » Thu Sep 09, 2010 9:06 am

Are you sure about the database name
I think the error is due to the wrong database name

datamoeras
Posts: 5
Joined: Mon Aug 09, 2010 9:12 am

Re: sql utility

Post by datamoeras » Thu Sep 09, 2010 10:52 am

Hi Thor,

DEMO wasn't the correct database name; it gives an error opening the database:
$ ./sql -d DEMO -u kccdm "select * from GB_00_Terminals"
sql: ERROR: opening database

I double checked the kconf.xml, and noticed I forgot the "2" at the end. It (again) gives the error "operation not allowed on virtual database":
$ ./sql -d DEMO2 -u kccdm "select * from GB_00_Terminals"
operation not allowed on virtual database

$ ./sql -d AUTOLINENL -u kccdm "select * from GB_00_Terminals"
operation not allowed on virtual database

We don't need the ODBC connector for this, do we?

Thor
Posts: 11
Joined: Sat Jan 09, 2010 9:56 pm

Re: sql utility

Post by Thor » Thu Sep 09, 2010 1:20 pm

No you don't need the ODBC conector for this
I really need to see your kconf.xml file
Can you zip it up and post on here so I can down load it
Virtual database errors mean you are not looking at a service that is setup for ODBC access

datamoeras
Posts: 5
Joined: Mon Aug 09, 2010 9:12 am

Re: sql utility

Post by datamoeras » Thu Sep 09, 2010 1:44 pm

Hi Thor,

Please find attached the kconf.xml file!
Attachments
kconf.xml.zip
kconf
(1.98 KiB) Downloaded 171 times

Thor
Posts: 11
Joined: Sat Jan 09, 2010 9:56 pm

Re: sql utility

Post by Thor » Thu Sep 09, 2010 7:05 pm

I have had a look at your kconf.xml
based on what is in it
your system is not setup for ODBC access via connection manager
so any sql commands are going to fail :(

datamoeras
Posts: 5
Joined: Mon Aug 09, 2010 9:12 am

Re: sql utility

Post by datamoeras » Fri Sep 10, 2010 11:46 am

Hi Thor,

Thanks for your info. From what I understood earlier, you said we didn't need ODBC connectivity, but it turns out we do need ODBC connectivity for the sql utility to work?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest