Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Return a value to command line

HI ,

I have requirement to return the value to console .I mean when i call the job .bat file from command line it should return  a

value..Trying to use t java component  no success.

Reading a value from database and i want to return it to command line.Any suggestion to use which componenet

 

Thanks in advance

Ramesh

 

Labels (3)
6 Replies
vapukov
Master II
Master II

if You need just print message to console, You can use tJavaFlex and code like:

 

System.out.println("Print message - "+row1.col1);

 

0683p000009Lsw6.png

0683p000009Lu10.png

TRF
Champion II
Champion II

Hi,

You may use tDie with a return code.
In your case, push the result of your select into a global variable, then set the return code using this global variable. It should like:
(Integer)globalMap.get("yourVariable ")

Regards,
vapukov
Master II
Master II


@TRF wrote:
Hi,

You may use tDie with a return code.
In your case, push the result of your select into a global variable, then set the return code using this global variable. It should like:
(Integer)globalMap.get("yourVariable ")

Regards,

Yes, it different angle for view

 

all depends how to read:

 

Reading a value from database and i want to return it to command line

tDie - kill Job and return only 1 value, but it could be used in script logic

if value more than 1 and Job must just display value and continue - need print

 

 

Anonymous
Not applicable
Author

Thanks for quick response. I have tried both tjavaflex and tdie components .
when i run in studio i see the value are printing.
when i to run .bat file command line did't get the return values.
do i have do anything to capture return values form command line
here is the output i got
C:\Users\rkacham\Documents\TalendJobs\tes_0.1\tes>cd C:\Users\rkacham\Documents\TalendJobs\tes_0.3\tes\

C:\Users\rkacham\Documents\TalendJobs\tes_0.3\tes>java -Xms256M -Xmx1024M -cp .;../lib/routines.jar;../lib/log4j-1.2.16.jar;../lib/dom4j-1.6.1.jar;../lib/talend_file_enhanced_20070724.jar;tes_0_1.jar; talend_poc1.tes_0_1.tes --context=Default

vapukov
Master II
Master II

could You attach some screenshots of Your Job (code)?

 

as You can see from screenshots it work

I normally store output direct to log file, so not often use print to console, but it work

 

0683p000009LtkG.png

Anonymous
Not applicable
Author

Here are the screen shot ,Value is not returning on to console .I have tried in unix and windows.

when i run from studio i do get  retrun value

looks like i am missing some option

0683p000009Lu28.jpg