• Uncategorized

About sql-server : How-to-get-row-values-when-we-run-SQL-query-from-Linux-Shell-script

Question Detail

My shellscript contains below code to retrieve rows from a table in SQL server.

OUTPUT=aa.out

DATE_STR=20220103

{$ISQL} -U{$SQL_UU} -P{$SQL_PP} -S{$SERVER_NAME} << !! > {$OUTPUT}

GO

USE {$DB_NAME}

SELECT EMP_NAME FROM EMPLOYEE WHERE CONVERT(CHAR(8), LOGIN_TIME,112)={$DATE_STR}

GO

!!

I’m getting output in aa.out as below

locale is en_US.UFT-8

locale charset is UFT-8

using default charset UFT-8

1>2>3>4>EMP_NAME

ALICE
BOB
(1 row affected)
1>

how to modify my query or shellscript to get output

ALICE

BOB

Question Answer

No answer for now.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.