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 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 501k
  • Answers 501k
  • 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
  • Editorial Team
    Editorial Team added an answer set.seed(1) ( tbl <- table(round(runif(100, 1, 5))) ) ## 1… May 16, 2026 at 2:25 pm
  • Editorial Team
    Editorial Team added an answer If you have a transactional filesystem (transaction ntfs), I think… May 16, 2026 at 2:25 pm
  • Editorial Team
    Editorial Team added an answer Judging from the MPLAB C guide, the largest integer data… May 16, 2026 at 2:25 pm

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 rather large classic asp / SQL Server application. A new
I'm building a rather large database - which has around 6.9 million records. A
I am working on a data driven web application that uses a SQL 2005
I'm working on porting a large vb6 application to .NET. The current app is
I'm using LINQ to SQL to search a fairly large database and am unsure
I am working on a GUI application that will be used to perform manual
A rather simple question really. I'm working on a project where I need to
I am having to use triggers in MSSQL for the first time, well triggers
I am using Oracle 11.1.0.6.0 and ADO.NET (System.Data.OracleClient) to run a query that works
I have a large amount of data stored in an XML file, 173 MB

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.