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

  • Home
  • SEARCH
  • 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 868393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:07:58+00:00 2026-05-15T10:07:58+00:00

I am working on a rather large SQL script to be used with Oracle,

  • 0

I am working on a rather large SQL script to be used with Oracle, but I’m running into an issue. First, let me outline how the script operates.

  1. Declare variables
    • `CUSTOMERID NUMBER;`
    • `SERVERID NUMBER;`
  2. Create a customer if it doesn’t exist
  3. `SELECT ID INTO CUSTOMERID FROM CUSTOMER WHERE NAME = ‘The Customer I just Inserted’;`
  4. Create the server if it doesn’t exist, using the `CUSTOMERID` value to relate the server to the customer.
  5. `SELECT ID INTO SERVERID WHERE HOSTNAME = ‘the.server.i.just.created’;`
  6. For each service belonging to this server, insert the service using the `SERVERID` value to relate the service to the server.
  7. Go to 2

Now this process seems to work well for just one customer with 15 servers, each having 6 services. But as soon as the next customer is introduced, I receive prompts for variable substitution. The way I’m using the variables on my insert is pretty straightforward:

INSERT INTO SERVERS(CUSTOMER_ID, HOSTNAME)
SELECT CUSTOMERID, 'the.server.i.just.created' FROM DUAL
WHERE NOT EXISTS (
    SELECT *
    FROM SERVERS
    WHERE HOSTNAME = 'the.server.i.just.created'
);

I have also attempted using the DECLARE ... BEGIN ... END; method, but I receive the same general results. Some examples I’ve seen suggest to use the :CUSTOMERID style variables, but those don’t seem to work at all, where they are ending up with null values, which shouldn’t be happening given the previous queries.

What I am needing help with is in understanding how to achieve this. I have very limited access to the production environment, so anything I do needs to be kept basic (e.g., no new functions, types, or procedures).

  • 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. Editorial Team
    Editorial Team
    2026-05-15T10:07:59+00:00Added an answer on May 15, 2026 at 10:07 am

    I actually stumbled across the answer after beating my head on the desk repeatedly.

    Basically, what was happening was some of the customer names had ampersands in them, and the word immediately following the ampersand was attempting to bind as a variable. The solution was to SET DEFINE OFF; and all was well after that.

    Thank you all for your time and consideration.

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

Sidebar

Ask A Question

Stats

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

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

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

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

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use: SELECT p.id as a, p.url as b, t.id as… May 17, 2026 at 3:22 am
  • Editorial Team
    Editorial Team added an answer There are two parts to the problem First Issue You… May 17, 2026 at 3:19 am
  • Editorial Team
    Editorial Team added an answer I thought I'd show the regex approach, too. It doesn't… May 17, 2026 at 3:18 am

Trending Tags

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

Top Members

Related Questions

I'm working on a project with a rather large Oracle database (although my question
We're a distributed team of 5 developers working on rather large integrations project. We
I'm working on a rather large project, and its unlikely will catch everything. I've
After working with .NET's HttpWebRequest / Response objects, I'd rather shoot myself than use
I'm working with an incorrectly built spring application. Rather than use IOC, objects that
I'm working on porting a large vb6 application to .NET. The current app is
I'm working on a problem that requires caching paginated search results: Paginating very large
We are using CMake to manage our builds and have a rather large project
Working with dates in ruby and rails on windows, I'm having problems with pre-epoch
Working with a SqlCommand in C# I've created a query that contains a IN

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.