Print Thread
Stupid newb question, flame away
#65864 09/12/24 04:42 PM
Joined: Sep 2024
Posts: 1
S
Member
OP Offline
Member
S
Joined: Sep 2024
Posts: 1
I'm missing something obvious. I have to be.

I've been a SQL Server developer for 20 years, and this week I'm being flung into Oracle. I'm using PL/SQL Developer, which looks vaguely enough like SSMS that I figured it's got to work much the same. I'm trying to create a SQL script that does two things that, for the life of me, I am unable to figure out how to get done at the same time:

1. Uses variables
2. Outputs results to the grid

I can declare variables, use them the way I expect to be able to use them, and using DBMS_OUTPUT.PUT_LINE I can write things to the text-based output pane. Working this way is tedious. I'd like to be able to select my results into the grid, the way that I can out of the box with SSMS. I've spent way too long trying to figure out what I'm doing wrong, and I'm not finding any kind of "For SSMS developers" reference to explain what I'm missing, so here I am. Help? Somebody? What obvious and easy thing did I miss?

Re: Stupid newb question, flame away
Steve Smith #65865 09/13/24 08:39 AM
Joined: Aug 1999
Posts: 22,361
Member
Offline
Member
Joined: Aug 1999
Posts: 22,361
My guess you are using the Test Window? This window type is primarily intended for testing and debugging PL/SQL program units. You can still view a result set on the "SQL Output" tab page though.

For querying and result set manipulation you should use the SQL Window instead (File > New > SQL Window). Result sets will directly be displayed. It also supports substitution variables, prefixed with an ampersand. For example:

select * from employees where department_number = &dept;

This query will ask for a "dept" value, and will display all employees from this department.

See chapter 7 in the User's Guide for more information about the SQL Window.


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.055s Queries: 15 (0.034s) Memory: 2.4989 MB (Peak: 3.0397 MB) Data Comp: Off Server Time: 2024-10-14 10:22:46 UTC
Valid HTML 5 and Valid CSS