ISF Logo   IS Forum
Forum Index Register Members List Events Mark Forums Read Help

Go Back   International Skeptics Forum » General Topics » Computers and the Internet
 


Welcome to the International Skeptics Forum, where we discuss skepticism, critical thinking, the paranormal and science in a friendly but lively way. You are currently viewing the forum as a guest, which means you are missing out on discussing matters that are of interest to you. Please consider registering so you can gain full use of the forum features and interact with other Members. Registration is simple, fast and free! Click here to register today.
Reply
Old 15th May 2019, 11:07 AM   #1
Faydra
sinning sybarite
 
Faydra's Avatar
 
Join Date: Jan 2007
Posts: 6,223
SQLPLUS query outputs twice

Any idea why a sqlplus command executed in a linux script with sqlplus -s will produce the output twice? When I run it from a sqlplus prompt, I get it only once.

Query: select job from job_table where machine='value'.



From a sqlplus prompt I get 40 rows.

From the linux shell script I still get 40 rows, but I get them twice.

script is:

sqlplus -s ${cs} <<-EOF
set head off
select job
from job_table
where machine='$1'
order by job;

/
EOF
Faydra is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 15th May 2019, 11:10 AM   #2
Faydra
sinning sybarite
 
Faydra's Avatar
 
Join Date: Jan 2007
Posts: 6,223
Never mind - I just finally found it in google.

The slash was the problem.
Faydra is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 15th May 2019, 12:40 PM   #3
GlennB
Loggerheaded, earth-vexing fustilarian
 
GlennB's Avatar
 
Join Date: Sep 2006
Location: Arcadia, Greece
Posts: 24,553
Yeah. I'd say the semi-colon and the slash amount to the same thing and it will execute twice.
__________________
"Even a broken clock is right twice a day. 9/11 truth is a clock with no hands." - Beachnut
GlennB is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Old 15th May 2019, 03:06 PM   #4
Faydra
sinning sybarite
 
Faydra's Avatar
 
Join Date: Jan 2007
Posts: 6,223
Yep.. I was today years old when I learned what a / does in sqlplus.
Faydra is offline   Quote this post in a PM   Nominate this post for this month's language award Copy a direct link to this post Reply With Quote Back to Top
Reply

International Skeptics Forum » General Topics » Computers and the Internet

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -7. The time now is 09:50 AM.
Powered by vBulletin. Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.

This forum began as part of the James Randi Education Foundation (JREF). However, the forum now exists as
an independent entity with no affiliation with or endorsement by the JREF, including the section in reference to "JREF" topics.

Disclaimer: Messages posted in the Forum are solely the opinion of their authors.