Forum

Kognitio Console issues, advice, etc.
deborahmartin

I don't see any output when using command line kogscript

by deborahmartin » Mon Nov 07, 2016 10:14 am

Unlike wxsubmit, kogscript will not by default, show any output to the screen.

So, if your kogscript code has something like :-

select * from ipe_user;

When you run the above using kogscript, you will not see any output.

In order to do this, you will need to use "print" in your kogscript code. There are lots of examples in the Kognitio Scripting Guide to get your started.
You can either download this guide from the forums here ( http://www.kognitio.com/forums/console_ ... _guide.zip ) or access the guide from within Kognitio Console, under the "Help" menu.

Below is a very simple example using one of the system tables found on the KAP database :

schema = 'SYS';
tabname = 'IPE_USER'
lookup = select * from $schema.$tabname;

for i,v in pairs(lookup.rows) do
userid=v.NAME
print ("output printed",i,userid,"\n");
end

When you run the above kogscript, you will now see output similar to the following, which prints a string "output printed" followed by the userid variable which is the NAME column from ipe_user on the database :-

wx2-support:# kogscript -s localhost -u sys -p ****** looptest.kog

output printed SYS
output printed GRP_LOG
output printed GRP_MONITOR
output printed GRP_DISKUSAGE
output printed GRP_DBG
output printed ODBC
output printed PUBLIC

If you want to simply debug your kogscript, you can also set the sqldebug parameter in your kogscript code. Refer to the Kognitio Scripting Guide Chapter 1 "Getting Started" for further details on setting this parameter.
Reply with quote Top
Contributor
Offline
Posts: 184
Joined: Wed May 29, 2013 2:10 pm
Location: Bracknell

Re: I don't see any output when using command line kogscript

by MikeAtkinson » Mon Nov 07, 2016 11:16 am

Kognitio Console examples ( under the Tools menu) has several examples of more complex processing of results.
  • Compare a table against expected data - Processing table elements
  • Use Lua generators to process query data - Advanced printing of results
  • Use a module to hold a table transpose function, write results to a database - Processing table elements
Reply with quote Top

Who is online

Users browsing this forum: No registered users and 1 guest

cron