Displays the output of PL/SQL
The PL/SQL output below would not be dilsplay. Can anyone in this Council through my code and tell me what I am doing wrong that I can't see the result of the code.I only get 'anonymous block' as the view-only. I want to see
Set serveroutput on
declare
cursor obj_cursor is
Select
object_name,
object_type,
owner
Of
DBA_OBJECTS
where
owner = 'ITA '.
and object_type in ('TABLE', 'SEE')
and object_name like 'JOB_;
wk_job VARCHAR2 (500);
WK_SQL VARCHAR2 (500);
WK_JOBSTR VARCHAR2 (500);
out_f utl_file.file_type;
BEGIN
wk_jobstr: = 'JOB_ | LTRIM (to_char (wk_job)). '%';
for wk_rec loop obj_cursor
If wk_rec.object_type = 'TABLE' then
wk_sql: = 'drop table ' | wk_rec.object_name;
dbms_output.put_line (wk_sql);
end if;
end loop;
end;
/
And if the rans above successfully, how I put the following code in the code above?
Select ownerid, starttime, endtime in ita.tpis32_job_status jobid where starttime < sysdate - 60 and num_lines > 1000000;
The idea is to use the jobid five-digit and add it to the job_ variable.
Hello
first of all, I'll try to run only SQL, so the selection from your cursor in SQLPLUS. If it returns no rows, your problem is in the SQL code.
I think the problem is because of your where clause:
and object_name like 'JOB_';
It will be all the lines where there are 4 characters, nothing more. I think you need to replace the '_' % or add the tot % string. This will also give you the results of more than 4 characters.
So:
and object_name like 'JOB_%';
BTW: The underscore is a wild-card character to like. It replaces a single character. The % stands for 0 or more characters.
Herald tiomela
Superconsult.nl
Tags: Database
Similar Questions
-
How to display the output of PL/SQL and difficulty package below error (please help)
-PACKAGE SPECIFICATION AND met with success, but I see no way out, an error is also here... Please help. How do I solve this problem
-with the code
CREATE OR REPLACE PACKAGE package_variables
-Declare the components of a package.
Established PROCEDURE (VARCHAR2 value);
Public FUNCTION get RETURN VARCHAR2;
END package_variables;
/
CREATE OR REPLACE PACKAGE BODY package_variables
-Declare the package-scoped variable.
variable VARCHAR2 (20): = "initial value";
-Define the function
Get function RETURN VARCHAR2 IS
BEGIN
RETURN variable;
END get;
-Define the procedure.
PROCEDURE set(value VARCHAR2) IS
BEGIN
variable: = value;
The END value;
END package_variables;
/
Result VARIABLE VARCHAR2 (20)
CALL package_variables.get () IN: result;
SELECT: result AS result FROM dual;
RUN package_variables.set ("new value '");
CALL package_variables.get () IN: result;
SELECT: result AS result FROM dual;
/*
OUTPUT
PACKAGE compiled package_variables.
PACKAGE compiled package_variables BODY.
Error at startup on line 2 of the command:
CALL package_variables.get () IN: results
Error report:
SQL error: ORA-01008: not all variables
01008 00000 - "not all variables.
* Cause:
* Action:
RESULTS
--------------------------------
1 selected lines
anonymous block filled
Error at startup on line 2 of the command:
CALL package_variables.get () IN: results
Error report:
SQL error: ORA-01008: not all variables
01008 00000 - "not all variables.
* Cause:
* Action:
RESULTS
--------------------------------
1 selected lines
*/The package name is package_variables (note the 's'. Plural.) But using package_variable (in the singular) in your call.
Also select in as a SQL statement seems to be not valid. You encapsulate a begin - end around her block.SQL> begin 2 select package_variables.get into :outcome from dual; 3 end; 4 / PL/SQL procedure successfully completed outcome --------- Initial Value
-
concatenate the output of two sqls.
Hi all
I'm trying to concatenate the output of two sqls
It should be fairly simple, but somehow I find it hard today.
Here's the sql code.
< code >
Select (select to_char (sysdate, 'YYYYMMDD') of double) | "| (select the CHILD_SEQ.nextval of the double) of the double
< code >
I'm working on Oracle 11 g.
Kindly help.
use
What's the problem with just doing...
SQL > create the sequence child_seq;
Order of creation.
SQL > ed
A written file afiedt.buf1 * select to_char (sysdate, 'YYYYMMDD') | The double CHILD_SEQ.nextval
SQL > /.TO_CHAR (SYSDATE, 'YYYYMMDD') | CHILD_SEQ. NEXTVAL
------------------------------------------------
201408131SQL >
I hope you're not uing a primary touch well and trying to 'reset' the sequence every day. This is not recommended and not scalable; keep primary keys simple by simply using a sequence and treat sysdate as a piece of data and other data. If you need to get "sequences" for a particular day you can create them on the fly using row_number() over (partition by primarykeycolumn order datecolumn) where your datecolumn is the cut off date (trunc (sysdate)) and the primary key column is just the value of sequence assigned to the record.
-
the two equii join and natural join are equall.will both display the output of the same
the two equii join and natural join are equall.will both display even
output?Hello
It keeps you a little test and check yourself?See the link below.
http://psoug.org/reference/joins.html
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> CREATE TABLE parents ( 2 person_id NUMBER(5), 3 adult_name VARCHAR2(20), 4 comments VARCHAR2(40)) 5 PCTFREE 0; Table created. SQL> SQL> CREATE TABLE children ( 2 parent_id NUMBER(5), 3 person_id NUMBER(5), 4 child_name VARCHAR2(20), 5 comments VARCHAR2(40)) 6 PCTFREE 0; Table created. SQL> SQL> INSERT INTO parents VALUES (1, 'Dan', 'So What'); 1 row created. SQL> INSERT INTO parents VALUES (2, 'Jack', 'Who Cares'); 1 row created. SQL> INSERT INTO children VALUES (1, 2, 'Anne', 'Who Cares'); 1 row created. SQL> INSERT INTO children VALUES (1, 1, 'Julia', 'Yeah Right'); 1 row created. SQL> INSERT INTO children VALUES (2, 1, 'Marcella', 'So What'); 1 row created. SQL> COMMIT; Commit complete. SQL> SQL> SELECT adult_name, child_name 2 FROM parents NATURAL JOIN children; ADULT_NAME CHILD_NAME -------------------- -------------------- Jack Anne Dan Marcella SQL> select adult_name,child_name from parents a, children b 2 where a.person_id=b.person_id; ADULT_NAME CHILD_NAME -------------------- -------------------- Jack Anne Dan Julia Dan Marcella SQL> ed Wrote file afiedt.buf 1 select adult_name,child_name from parents a, children b 2* where a.person_id=b.parent_id SQL> / ADULT_NAME CHILD_NAME -------------------- -------------------- Dan Anne Dan Julia Jack Marcella SQL>
Kind regards
Avinash -
How to display the error messages from sql/pls call
Hello
How can I display error messages from pl/sql calls on application pages?
Current situation:
If I specify "Error message" in the process - well, that's what I'm going to get on the page.
What I want:
I would like to have the specified aka "user friendly" message with the actual pl/sql routine. so it helps me to understand where the error occurred.
Hi AZZ.
AZZ says:
How can I display error messages from pl/sql calls on application pages?
Current situation:
If I specify "Error message" in the process - well, that's what I'm going to get on the page.
What I want:
I would like to have the specified aka "user friendly" message with the actual pl/sql routine. so it helps me to understand where the error occurred.
Yes, agree with orpheus4192. Use the APEX_ERROR. ADD_ERROR API.
Reference:
- Re: Re: error in the processing of the page management
- https://docs.Oracle.com/CD/E59726_01/doc.50/e39149/apex_error.htm#AEAPI2217 (APEX 5.0)
- http://docs.Oracle.com/CD/E37097_01/doc.42/e35127/apex_error.htm#AEAPI2217 (APEX 4.2)
Kind regards
Kiran
-
How to format the output of a .sql script that has select statements.
Hello
I have a .sql script which is having several select statements. Each Select statement is to have hundreds of Table columns.
When we run the .sql script, we are unable to read the output.
Please let know us the commands that we include for better readable output format.
You work with the lin standard set 80.
Increase this setting to set lin 3000 or more. -
Unable to display the output of a concurrent program
Dear members,
I use Oracle R12.1.3 Vision Instance.
I ran the program create accounting. When I click on the button to display output, the browser gets displayed and gets immediately closed. I'm unable to view the output.
Can someone help me please to solve this issue?
Thanks in advance.
Kind regards.I faced this problem once. That's the problem with the settings of Internet Explorer.
Check in the settings of IE-> tools - > Internet Options-> Security tab-> the zone (Intranet, for the most part)-> enable downloads.By
VAMSi -
How to display the output of query clause?
Hello. I use Forms Developer 10g. I have a datablock that uses a from_clause_query. In my from_clause_query, I used a WITH AS SELECT.
I try to view the output of this query in my forms but the first column, V_CUTOFF_TO not displayed, probably because it is not a database element. It was a result of my initial query WITH AS SELECT month. How can I view this with the release of my from_clause_query. Thanks in advance for the help. Moreover, I am trying to post the contents of my from_clause_query here, but it says sorry, this content is not allowed. I don't know why?I was able to solve the problem by creating a stored procedure. I insert the records in a table in the procedure, and then I query the table. Thanks for your help.
-
Unable to display the output in the next block
Hello
I tried the next block... But unable to see the output
Could you suggest me in this...
Although made setserverout0-----) PL/SQL procedure successfully completed.
but of no use
Please help me
Published by: josh1612 on April 5, 2010 12:14 AMHello
Check if the script given below will print something...
DECLARE .. BEGIN DBMS_OUTPUT.PUT_LINE('START OF ANONYMOUS BLOCK'); .. DBMS_OUTPUT.PUT_LINE('END OF ANONYMOUS BLOCK'); END;
If so, check your logic for the results expected, if not... Check the settings of sqlplus
* 009 *.
Edited to take off your real script :) forums
Published by: 009 April 5, 2010 12:18 AM
-
Able to display the output but cannot send and entry on powerconnect 5424
Hello
I am configuring a PowerConnect 5424 switch to connect to my network as one of the distribution switch. When I explain on my network. its very basic as we do not have to any VLAN managed or any other complex implementation.
When I boot the switch connection with putty via a cable series, I can see the output of the switch where I can't enter anything. I tried three different emulators of terminal that did not work at all.
What can be the reason, how can I do this because I just want to set up an IP address so that I can connect to switch and monitor ports... etc?
Hello!
Thanks for the reply. Well, he had no problem with the cable or unit, it is the laptop that I used. It's no wonder that my previous Dell switch has failed. I tried it on another laptop and it worked like charm. I managed to configure the switch too.
Thank you!
-
Flash Player plugin that displays the output window?
Hey there,
I remember reading about a Flash Player plugin that shows the output window when mistakes happen, but don't remember the link or where I read about it.
Does it exist or did I did it upward? I would use it if it can be useful when testing on Flash you can hear it on the web. If someone has a link to find out where to download it from the adobe site that would be of great stuff.
http://www.Adobe.com/support/flashplayer/downloads.html
Download a debugger player. they get a bit of a nuisance, because when you install it in your browser it takes on errors for everyone and you told about it in a popup. eBay banners seem to be particularly mounted bug.
-
A hierarchical report query SQL formatting to display the output as a tree
4.2.1
THM:2
Hello world
I have a simple request which when I run it should show in a tree like structure as seen in this link
Hierarchical queries in Oracle SQL
Any ideas on how I can get this output show upward in an area of report page apex? I tried to put it in a classic report, and it shows just all in one line given the length and spacing. I don't want to use the tree for this.
Thank you!
Ryansun-Oracle wrote:
I have a simple request which when I run it should show in a tree like structure as seen in this link
Hierarchical queries in Oracle SQL
Any ideas on how I can get this output show upward in an area of report page apex? I tried to put it in a classic report, and it shows just all in one line given the length and spacing. I don't want to use the tree for this.
I found that the standard reports and report templates are not really useful in this situation.
According to exactly how it should be used, you might want to watch a dynamic list using one of the models of hierarchical list, but I tend to use this Tyler Muth & Rob Van Wijk. This can be used in a region in connection with a column named custom report template.
-
How to display the output as 'error' in this program
DECLARE
C_ID employees.sno%type: = 2;
employees.name%type c_name;
c_addr employees.country%type;
BEGIN
SELECT name, c_name, c_addr FROM Employees WHERE sno country is c_id;
DBMS_OUTPUT. Put_line (' name: ' | c_name);
DBMS_OUTPUT. Put_line (' address: ' | c_addr);
EXCEPTION WHEN no_data_found THEN
dbms_output.put_line ('no such customer!');
WHILE others
THEN dbms_output.put_line ('Error!');
END;
If I have 2 give her no customer display
and what I need to do to print error when you exit?
Because you manage the no_data_found error in your exception block there is no error for when others block to manage. If you want to hit him when another fishing your code available, you can either remove the handler no_data_found, or introduce a different error condition, such as:
SQL > select * from employees;
SNO NAME NECK
---------- --------------- ---
1 John CAN
1 John CAN
SQL > DECLARE
2 c_id employees.sno%type: = 1;
3 employees.name%type c_name;
4 c_addr employees.country%type;
5 BEGIN
6. SELECT name, country IN c_name, c_addr
7 FROM employees
8. WHERE the sno = c_id;
9 DBMS_OUTPUT. Put_line (' name: ' | c_name);
10 DBMS_OUTPUT. Put_line (' address: ' | c_addr);
EXCEPTION 11
12. WHEN no_data_found THEN
13 dbms_output.put_line ('no such customer!');
14 SO that others THEN
15 dbms_output.put_line ('Error!');
16 END;
17.
Error!
PL/SQL procedure successfully completed.
The too_many_rows error introduced by the lines in the flow of the table to the when of other Manager. Note the procedure message passed to PL/SQL. Because the other handler handled the error, when more an error in the code block. If it's a stored procedure, the appellant would never know that something had gone wrong, one of the reasons why when another Manager without a raise is a bad idea.
John
-
JavaScript to display the output if multiple check boxes are selected
Hello
My PDF form has a number of questions about this, some of which are multiselect.
for example
Identify the colors of our company logo (there are three)
Blue
Red
Green
Orange
Yellow
Purple
If they choose the good ones (blue, red and yellow), the script should display a 'Correct' output, if they look for something else, it should show incorrect. I have worked out how to do it for a collection of radio button, but may not know of check boxes.
Any help would be greatly appreciated.
Concerning
I don't know, but see if it works for you: http://acroscript.net/pdf/demos/Adobe_Forums_1993380.pdf
-
Displaying the output in a workflow in a provisioned VM
I try to determine a way to show return the content of a variable of an entity of the VM once the machine is built, preferably in the tab 'Machine' of the details of the article. I don't seem to be able to find a way to do it (I tried to update the value of "__Notes", but appears not to pass to the Portal). Basically, we generate a temporary password for the end user, and we want to show in the portal, rather than by e-mail.
Can someone tell me if there is a way to display data in the portal once commissioning is complete, outside the person a Manager and viewing the properties directly? If not, is it possible to display data by using a custom action of resource?
Thanks for all the ideas.
Thus, the easiest way (I think) would update the description field of the virtual machine. Who is be a property of the entity of the virtual machine within the IaaS API, so that you'd run the workflow of update a vCAC model entity under library-vCloud Automation Center-> Infrastructure Management >. This workflow must have two specific entries:
(1) the entity: that can be gained when the heel is launched as an entry in the heel
(2) the input properties to update... This one gets a little more fun. You can do this with a very simple action / scriptable job. The task / action will have an entry (for this example) passwordattribute, which is the temporary password configured and an output for an attribute properties in the workflow called (for this example) vCACModelProperties. The code block, you would use would look like this:
var p = new Properties (); if (password) { p.put("Notes","The password for your virtual machine is: ".concat(password)); } vCACModelProperties = p;
After this scriptable task / action outputs Properties, you should be able to feed in the workflow of update, and the value appears in the item once it is filled with the completion of the workflow state.
Maybe you are looking for
-
Problems with emails in Outlook Express
When sending e-mail with Outlook Express, they are moved to the sent items, but have not been sent. After that, I get a Mailer Daemon message saying that there were too many recipients and in fact there is only ONE!
-
I have disabled the Bing toolbar, I want to uninstall it from my laptop more old.
After upgrading to IE 9 I have been trying to compress as much space on my laptop. I just want to know how to get this great program, (24.4 M) uninstalled. I was able to uninstall any other toolbar.
-
The SAR values lower blackBerry 10->; BB phones sold!
Dear community, Dear BB smartphone antenna developers, I would like to highlight the fact that the lowest values of SAR (specific absorption rate) of mobile phones have been achieved by Samsung in the last six years. Models Samsung Galaxy have extrem
-
How can I change the drive on which my library is located in Windows 7?
It seems that 'Library' in Win7 is what was used to be called "My Documents" in XP, right? It used to be %HomeDrive% on Windows XP would determine where the "My Documents". I have built a Windows 7 computer and created two volumes on my boot disk...
-
How encrypt security remove, copy, install & move any file in Windows?
Hey all,. Can Windows 7 offer the same policies and security that XP provides the encryption? If yes that indicate them below...