I need to add a dot in two strings of numbers. (example “88188741478”). I need to add it 8 characters before the end. The result should look like this “881.88741478”. I need …
Tag: sqlplus
LOOP/FOR statement on oracle script
I’m running an ansible playbook that runs an sqlplus script to an Oracle DB. Basically the script creates a CSV file with some server info. The query is pretty much autogenerated, so it will be difficult change it. The problem is that this query brings all the 5000 server and I need only 200. I want to add a LOOP/FOR
SQL Plus Columns getting overflowed to next row
The DeptNo column when using SQLPlus in Oracle 11g XE is getting pushed down to the next row, despite having sufficient space in the window in Ubuntu 20.04 Terminal.
Error: ORA-12154: TNS:could not resolve the connect identifier specified when entering username and password in sql plus
I’m trying to login to my oracle database using sql plus. But such error out ORA-12154: TNS:could not resolve the connect identifier specified here is my tnsnames.ora file, sqlnet.ora file and …
Conditionally calling sql scripts in sql plus
I have two scripts which needs to be executed depending on whether a table exists or not in my database. So I created a 3rd script as below which checks the condition and calls the respective script. [Because my installer cannot reach db and it can only call one script while installation] END; I get the below error – ERROR
How to check if hotel room is booked using Oracle SQL constraints
I am an absolute beginner when it comes to SQL, and I’m trying to figure out how to do a simple integrity check. I am modelling a hotel registration system with four tables: Hotel, Room, Booking and …
How to output row count calculations in Oracle’s SQL*Plus
I am using SQL*Plus with Oracle 11.2 and I know how to output the count of rows adhering to some condition, e.g.: Also it is easy to output all rows in MY_TABLE: However, how can I output in SQL*Plus the ratio of the two counts, i.e. how can I do in SQL*Plus a calculation on the output from SQL commands?.
How do I display my query results as part of a string?
My database is for a school project and handles various jobs/contracts which are ran by consultants. Apologies if the context is vague, we haven’t really been given much either. My current code does …
How do I solve this (SQL) query? [closed]
This is probably one of the simplest queries ever, and I’m probably just making it harder than it has to be, but I need it done. So, there’s three tables: TABLE AGENT ( A_ID INTEGER PRIMARY KEY, …
Running sqlplus in background in Unix
I am trying to run an .sql file from sqlplus in Unix environment as a background process. I am connecting to Unix using Tectia or Putty, and I want sqlplus to continue running in background even if my terminal closes. This command works but when trying to start it in background it fails What is the right command/script? Answer &