Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 76719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T20:43:03+00:00 2026-05-10T20:43:03+00:00

I have two SQL scripts which get called within a loop that accept a

  • 0

I have two SQL scripts which get called within a loop that accept a number parameter. Here is what I’m currently using:

for /l %%i in (1, 1, 51) do (     sqlplus u/p@name @script.sql a%%i.html %%i     sqlplus u/p@name @script.sql b%%i.html %%i ) 

Everything works fine, but it seems like a waste of time and resources to connect twice for each pass through. Is there a way I could simply log into sqlplus, run the for loop, then exit? I tried many alternatives such as putting

sqlplus u/p@name 

before the for loop, but then it would simply hang at the SQL> prompt without executing any of my two scripts.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T20:43:04+00:00Added an answer on May 10, 2026 at 8:43 pm

    You can create a masterscript.sql that contains your two script.sql statements. The only thing I’m not sure about is if it will pass in your variables.

    MasterScript.sql would contain:

    @@script1.sql @@script2.sql 

    and neither of your sub-scripts should contain an exit.

    Differences between ‘@’ and ‘@@’:

    http://www.orafaq.com/wiki/SQL*Plus_FAQ#What_is_the_difference_between_.40_and_.40.40.3F

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 78k
  • Answers 78k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You don't need the Delegate declaration or the WriteMessage method.… May 11, 2026 at 3:45 pm
  • added an answer Will this do the trick? <Border Background='#80FF0000'> <TextBlock Text='TextBlok'/> </Border>… May 11, 2026 at 3:45 pm
  • added an answer My guess is you're forgetting to turn the notes off… May 11, 2026 at 3:45 pm

Related Questions

I have a SQL script that inserts data (via INSERT statements currently numbering in
I'm writing some DB routines and I'm using prepared statements. My environment is PDO
I need to copy some records from our SQLServer 2005 test server to our
I have a content based, read-only iPhone app. Users can select favorite topics, which

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.