venkatesh Sarivisetty
asked on
To do an Automation
Hi,
can someone help me how to grep multiple strings from a file. I dont want to put separately, wherever it got started, I would like to print those lines.
Thanks
Venkatesh.
can someone help me how to grep multiple strings from a file. I dont want to put separately, wherever it got started, I would like to print those lines.
Thanks
Venkatesh.
Hey Venkatesh,
If you are familiar with javascript, you can use nodejs.
Create a file to connect to db, and do all the work.
Setup a scheduled task to run it every x minutes as you require.
If you are familiar with javascript, you can use nodejs.
Create a file to connect to db, and do all the work.
Setup a scheduled task to run it every x minutes as you require.
ASKER
Hi Vish,
Thank you
Could you please share me a code snippet. ..I will use it as reference. ..
Thank you
Could you please share me a code snippet. ..I will use it as reference. ..
I dont have code right now, but you can refer to
https://www.npmjs.com/package/excel4node for excel building.
https://github.com/mysqljs/mysql - for DB access.
https://www.npmjs.com/package/excel4node for excel building.
https://github.com/mysqljs/mysql - for DB access.
Running node.js (even if 'legitimate') still doesn't tell you how you're going to integrate as a system service. And i can't tell you how since you decided not to answer my question
Java and Javascript are two different thing language. What is this "the SQL db" ? mysql ? oracle ? MS SQL ?
ASKER
Java script should connect database from the code by passing db properties.. it is sql database only
Assuming you are on windows.
You dont have to run it as server, create a batch file with 'node [folder]/index.js' create a scheduled task to run the batch file. Everything should work fine.
As Leakim971 mentioned Java and javascript are totally different.
if you say javascript(which uses in browser, now it is possible to run without browser.). But 'Java script' can be a script written in java. Please tell us
- Install nodejs
- create a folder
- open CMD in that folder, run 'npm init'
- create index.js file.
- Write script.
You dont have to run it as server, create a batch file with 'node [folder]/index.js' create a scheduled task to run the batch file. Everything should work fine.
As Leakim971 mentioned Java and javascript are totally different.
if you say javascript(which uses in browser, now it is possible to run without browser.). But 'Java script' can be a script written in java. Please tell us
ASKER
Hi, Actually I am not pressing a program language here. My requirement is clear that program should run every 15 minutes and pull the information from the SQL database using the queries which I have configured in the program. If there the query condition not satisfied, it should skip that minute or else if any it should pick the details and prepare a spreadsheet and send to respective people. T
This is what my requirement is, If you people can help me with any language I am fine with. But I am familer with Java and shell scripting.. If you are people can tell which will be easier to do this can helpful..
Thanks
Venkatesh.
This is what my requirement is, If you people can help me with any language I am fine with. But I am familer with Java and shell scripting.. If you are people can tell which will be easier to do this can helpful..
Thanks
Venkatesh.
what is this SQL database and what is the server OS ?
ASKER
MS SqL. . I would like to run the program in my machine...it means windows only
you can use command line and the windows task scheduler :
https://technet.microsoft.com/en-us/library/cc721931%28v=ws.11%29.aspx?f=255&MSPPError=-2147217396
https://technet.microsoft.com/en-us/library/cc721931%28v=ws.11%29.aspx?f=255&MSPPError=-2147217396
for /f %%a in ('sqlcmd -S your_server_ip -d you_database_name -Q "SET NOCOUNT ON; SELECT COUNT(1) FROM SOMETABLE WHERE YOUR_CONDITIONS"')
do set NB_LINE=%%a
IF %NB_LINE% <> 0 ()
<< if any it should pick the details and prepare a spreadsheet and send to respective people >>
)
ASKER
Can someone provide me the java code
ASKER
I need a java script which will accomplish my requirement. Please share your thoughts as earliest.
Thanks
Venkatesh
Thanks
Venkatesh
ASKER
Hi, I am trying to run one sql query but I am getting one error, can someone help me why I am getting this error ASAP.
ORA-01722: invalid number
01722. 00000 - "invalid number"
*Cause:
*Action:
SQL condition
FROM INQ_LOG A, APPLC_ACTVY_LOG_VW B
WHERE A.CUST_ID IN(1234,5678,91011,12345)
AND A.TRAN_ID = B.TRAN_ID AND
A.DIGITAL = B.DIGITAL AND
A.CUST = B.CUST
ORA-01722: invalid number
01722. 00000 - "invalid number"
*Cause:
*Action:
SQL condition
FROM INQ_LOG A, APPLC_ACTVY_LOG_VW B
WHERE A.CUST_ID IN(1234,5678,91011,12345)
AND A.TRAN_ID = B.TRAN_ID AND
A.DIGITAL = B.DIGITAL AND
A.CUST = B.CUST
Not knowable from that. You said you were using MS SQL. That's clearly Oracle
ASKER
I am using ORACLE SQL only. where I am running the queries.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
What OS is this going to run on? The software should really run as a service