[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1488
  • Last Modified:

SQL Plus settings

I am using SQL Plus to run my SQL commands, and I was wondering is there any way to make it so that when i run a command over several lines i can go back up a line to correct an error?

For example, if this was my command:

SELECT colA, colB
FROM tblTable
WHERE colA = 100;

Say when I was done with this that I wanted to add "colC" to my SELECT.  When I am using SQL Plus right now I cannot use my mouse or directional keys to go back up to my select statement.  Is there a way to do this other than writing everything in notepad and copy/pasting?

Thanks.
Jeff
0
js_vaughan
Asked:
js_vaughan
  • 4
  • 3
  • 2
  • +1
2 Solutions
 
JimBrandleyCommented:
You cannot do that with SQL Plus, but you can with SQL Developer, which is a free download from Oracle.
0
 
JimBrandleyCommented:
If you want to try it, download links are here:

http://www.oracle.com/technology/software/products/sql/index.html

Jim
0
 
sathyagiriCommented:
Enter the line number you want to change

For example, if you want to correct line 1.

Type 1 and enter.Then the 1st line of the sql will be displayed.

Then you could type C/"old string"/"new string".

Then enter "/" to run the modified query.

Or else you could type 'ed" and the whole sql will be opened up in your notepad automatically, make any changes required
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
js_vaughanAuthor Commented:
Jim,

I tried using that software but keep getting the error "The network Adapter could not establish the connection"

I have already created a loopback adapter (reference: http://www.experts-exchange.com/Databases/Oracle/Q_21580537.html) with the exception I do not have a domain or DNS, so I am just using my hostname (without domain) I set in the hosts file for 10.10.10.10.  I used CMD-> ping <hostname> and it pings fine.  Not sure why I am still getting this error.  SID is the install default (orcl).

Any other thoughts?
0
 
js_vaughanAuthor Commented:
sathyagiri,

That worked well, but not the most efficient in my mind.  I have increased the points to 500 to see if I can get any further help with my connection problem in SQL Developer.  If I cannot get SQL Developer to work, then I will stick with your solution.
0
 
JimBrandleyCommented:
js_vaughn - I did not have to do anything special to get it to work. Just downloaded it and it ran. Here's what my TNSNames entry looks like:
JRBVEL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = brandleys)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = JRBVEL)
    )
  )

And this is all I have in SQLNet.ora:
SQLNET.AUTHENTICATION_SERVICES = (NONE)

Note that brandleys is the name of my computer - Has Oracle 10G server running locally and all my development and testing stuff. JRBVEL is my SID (now SERVICE NAME in 10g.

One (small?) difference is that I am on a local domain through my router.

Jim

0
 
sathyagiriCommented:
Could be a firewall issue.

Check out this link
http://forums.oracle.com/forums/thread.jspa?messageID=1155347�
0
 
JimBrandleyCommented:
I was just crawling aroud Metalink, and found references to problems in TNSNames causing this issue. sathygiri brings up one other possible difference between yours and mine - My router is my firewall, so I do not have one running on my server.

Jim
0
 
slightwv (䄆 Netminder) Commented:
Another possibility with the TNS issue is that Oracle isn't all that smart when it comes to picking the correct NIC when there are multiple on the machine.

2 Options:
Make the loopback adapter the 'first' in the list.
or
Change the tnsnames file to IP address and not hostname.
  (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
0
 
js_vaughanAuthor Commented:
Thank you both for all your help.  I split the points evenly, but will use sathyagiri's solution for now.  I still have yet to get SQL Developer working, but will not make you two wait for your points as my SQL Plus question was indeed answered.  I will do some more research on the network adapter when I have more time, and if i have to open a new question i will leave a pointer here.  Thanks again
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now