Apex - dbms_job.submit (Oracle) in SQL commands
I have connected to oracle apex (version 4.2.5.00.08) at the URL https://apex.oracle.com/pls/apex/f?p=4550:1:0:
I am trying to execute the procedure of dbms_job.submit through SQL Workshop-> SQL commands)
The code is as shown below
*************************************************************************************************************************
declare
-jobno number;
jobno varchar2 (20);
Start
dbms_job. Submit (work = >: jobno,)
This = > ' START
emp_pack.remove_dept (16);
END;',
next_date = > trunc (sysdate + 1).
interval = > 'trunc(sysdate+1) '.
);
-dbms_output.put_line ('Job No. :'||: jobno);
commit;
dbms_output.put_line ('Job No. :'|| is jobno);
end;
*************************************************************************************************************************
The procedure of package I'm talking in the parameter 'WHAT' is defined as shown below
create or replace package emp_pack is
process remove_emp()emp_id in NUMBER)
process remove_dept()dept_id in NUMBER)
end emp_pack ;
create or replace package body emp_pack
is
process remove_emp()emp_id in NUMBER( )
is
begin
delete from EMP
where EMP .EmpNo = emp_id ;
end remove_emp;
process remove_dept()dept_id in NUMBER( )
is
begin
delete from dept
where Dept .DeptNo = dept_id ;
end remove_dept
end emp_pack ;
*************************************************************************************************************************
while trying to run the piece of code (I'm passing avlaue from 35 to the jobno to the RUN time parameter) is the error I get
ORA-06502: PL/SQL: digital or value error: character string buffer too small
I tried to know everything, I have, but have not been able to determine what is causing the error. Help, please
Super weird... I just ran the following on apex.oracle.com and got "1 row (s) deleted', not 'treated statement."
declare l_job int; begin /* dbms_job.submit( l_job, 'begin delete from emp; end;' ); */ rollback; end;
Tags: Database
Similar Questions
-
IKM Oracle incremental vs. IKM SQL command Append
We will charge a lot of files at the same TIME (asynchronous mode) on a daily basis. We develop interfaces to load these files in the Oracle database. Data can be sometimes important. What IKM (IKM Oracle incremental update vs. IKM SQL command Append) is best to use in interfaces? If we use IKM SQL append, it a problem if load us several files at the same time (asynchronous mode) this charge table IKM target mode replace. I don't know what is this mode of replace? It truncates the temporary tables for each load?
I would be grateful if someone clarifies and suggest what is the best way to use one of these IKMs in interfaces design.
Thank you
RPHi, PR,
Good to know that your issue has been clarified.
Please close the message if you feel.
Thank you
Guru -
ETG assess "in order to" in the APEX SQL command window?
I need to recreate my table in order to change the order of the columns. When I use the SQL command window and run the SQL, it runs successfully, creates the table, but is not rearrange the columns.
This is expected behavior?
user648567 wrote:
Please update your forum profile with a real handle instead of 'user648567 '.
I need to recreate my table in order to change the order of the columns. When I use the SQL command window and run the SQL, it runs successfully, creates the table, but is not rearrange the columns.
What do you mean by "in order to"?
A clause using "ORDER BY" in a DEC (in SUMMIT or other anywhare) has no effect on the order of the columns , which is determined by the order in which the columns appear in the projection. It will affect the order in which the rows are returned from this query, and it will not determine the order in which lines will be returned by querying the new table in the future.
To change the order of columns, the columns in the SELECT of the ETG clause must be in a different order than the original table,
-
LOV query fails, but works in SQL commands
I am trying to create a type with semi-automatic item text field, but the query I fill in the definition of LOV returns an error:
Impossible to analyze the query SQL LOV!
ORA-00942: table or view does not exist
Although when I try the same query in the form of SQL commands, it works without any problem. No idea what I am doing wrong?
The query is as follows, where v_prt_gem_t is a view and prt_gem is a table.
SELECT PG.POST_CODE||' '||PT.NAAM FROM V_PRT_GEM_T PT INNER JOIN PRT_GEM PG ON PT.NR = PG.NR WHERE LAN_NR = 4
Julijan wrote:
I am trying to create a type with semi-automatic item text field, but the query I fill in the definition of LOV returns an error:
Impossible to analyze the query SQL LOV!
ORA-00942: table or view does not exist
Although when I try the same query in the form of SQL commands, it works without any problem. No idea what I am doing wrong?
The query is as follows, where v_prt_gem_t is a view and prt_gem is a table.
- SELECT
- PG. POST_CODE | » '|| PT. NAAM
- Of
- PT V_PRT_GEM_T
- JOIN IN-HOUSE
- PG PRT_GEM
- WE
- PT. NR = PG. NR
- WHERE
- LAN_NR = 4
It is likely that CERTAIN privileges on one or two tables/views used are granted for the scheme of the analysis of the application through a role, not directly to the schema. Role-based privileges will be observed in the workshop of SQL in the latest versions of database, but not for running applications. See (YABAOAE) yet another Blog about Oracle Application Express: Application Express and SQL Analysis for detailed information.
That's why you always have to give the full APEX and the database version numbers when you ask a question: implementations and features change over time. If we know exactly which versions are used so we can determine what behavior is expected, and what bugs exist or have been corrected...
-
ORA-00911 during addition of comment in the SQL command.
I work within the ORACLE Database Express Edition page "SQL Command".
The following query works fine for me:
SELECT *.
CUSTOMERS
As soon as I add comments, I get an error ORA-00911:
-It is a comment.
--
SELECT *.
CUSTOMERS
ORA-00911: invalid characterHello
Apex SQL worksheet don't like comments. What is reason you like add comments when you run the query?
You can trySELECT * /*This is a comment.*/ FROM CUSTOMERS
Kind regards
Jari -
ORA-00900 - the SQL commands: invalid SQL statement
Hello world
I installed Oracle Xe on a Centos 5.5 host yesteday.
Installation was Ok, I can connect to the web interface on "http://127.0.0.1:8080 / apex / '.
But when I want to use sql commands, regardless of the input control, I have the "ORA-00900: invalid SQL statement" message.
I can enter the command "Show all", for example, in a terminal after SQL > command prompt, it works... but not in the web interface...
I tried to import the .sql, script trought the web interface, no much result, no display in the window.
Can someone help me,
Thank youShow all is NOT a SQL command is a command that I think, not a command from pl/sql, sql more... Why not try to do a select on a table is know YOU the schema...
Thank you
Tony Miller
Webster, TX -
GET with multiple PL/SQL commands
Hello!
I m try to load a file into sqlplus using the GET command. I can't use or BEGIN (if you want to know why:
)The problem is that this file has more than one command, like this:
drop table teste_cardia; create table teste_cardia ( id number, nome varchar2(255) );
When I run the loaded file (with /). I got this error:
C:\Cardia>sqlplus /NOLOG @aaaa.sql SQL*Plus: Release 11.1.0.7.0 - Production on Qua Fev 4 10:42:16 2015 Copyright (c) 1982, 2008, Oracle. All rights reserved. SQL> CONNECT SATIR/XPTO11TB@IDEV10G Conectado. SQL> SET SQLPROMPT "SQL>" SQL>SET SERVEROUTPUT OFF SQL>SET LINESIZE 255 SQL>SET SCAN OFF SQL>SET DEFINE OFF SQL>SET SERVEROUTPUT ON SQL>SET SQLBLANKLINES ON SQL>SET VERIFY OFF SQL>SET ESCAPE ON SQL>GET teste4.sql 1 drop table teste_cardia; 2 create table teste_cardia ( 3 id number, 4 nome varchar2(255) 5* ); 6 / drop table teste_cardia; * ERRO na linha 1: ORA-00911: invalid character
If I run a file with a single command without «;» This works.
I tried to replace ';' by ' / '. Didn t work. Tried using sqlterminador, cmdsep and none of it worked.
It s possible to have multiple commands in a file and run with GET and /?
Hi Mario,.
In my view, that the GET command has no for this.
The documentation says https://docs.oracle.com/cd/B10501_01/server.920/a90842/ch13.htm
GET loads a host operating system file in the SQL buffer.
And in the SQL buffer, you can execute only one statement at a time.
You can not do this
< verdi_takt:op56 > select user from dual; select sysdate from dual; select user from dual; select sysdate from dual * ERROR at line 1: ORA-00911: invalid character < verdi_takt:op56 > select user from dual 2 select sysdate from dual; select sysdate from dual * ERROR at line 2: ORA-00933: SQL command not properly ended
So your file with the command of 2 or more must fail.
concerning
Kay -
SP2-0309: SQL * command procedures can only be nested to a depth of 20
HELLO EVERYONE
HAVE THIS CODE:
clear the screen
prompt ***********************************************
prompt * *
prompt * *
Guest * CHOOSE ONE OF THE OPTIONS: *.
prompt * *
Guest * 1. Create the role *.
Guest * 2. Privilege to grant to a role *.
Guest * 3. Create user *.
Guest * 4. Role of granting a user *.
prompt * *
prompt * *
prompt ***********************************************
accept the choice prompt "enter choice:
fixed term off
column virt_col new_value by v_choice
Select
case '& choice '.
When '1', then 'C:\PLSQLII\mid_lab\script1.sql '.
When '2' then 'C:\PLSQLII\mid_lab\script2.sql '.
When '3' then 'C:\PLSQLII\mid_lab\script3.sql '.
When '4' then 'C:\PLSQLII\mid_lab\script4.sql '.
end
as virt_col
Double;
Set term on
@& v_choice
SO WHEN I GET 1 I CALL THIS CODE:
set verify off
Set serveroutput on
clear the screen
prompt ***********************************************
prompt * *
prompt * *
Guest * CREATE ROLE *.
prompt * *
prompt * *
prompt ***********************************************
accept invites role "Enter role to create:
declare
Report number;
Start
CREATE_ROLE ('& role ', status);
If (status = 1) then
dbms_output.put_line ("' this role already exists!");
on the other
dbms_output.put_line ('role created.');
end if;
end;
prompt *********************************************************
accept invites of choice «Press any key to return to the main menu...» »
@ "C:\PLSQLII\mid_lab\menu.sql".
BUT WHEN I ENTER A NAME FOR A ROLE, HE ME GIVES THIS ERROR:
SP2-0309: SQL * command procedures can only be nested to a depth of 20...
COULD YOU PLEASE HELP?
Thank you!
Who executes the PL/SQL block in your second script, then you'll want to add it to your script.
See: http://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_twelve037.htm
Furthermore, your caps-lock key seems to be broken...
-
FLASHBACK Database: rman vs. sql command differences
I am new to Oracle and want to understand the difference and that is the correct way of rear turn signals to the database?
RMAN command vs SQL command on the use of FLASHBACK DATABASE
RMAN > run {}SQL> FLASHBACK DATABASE TO RESTORE POINT BEFORE_ONLINE_TEST; {CODE} Vs
flashback database to restore the BEFORE_TEST_320130313 point;
SQL ' alter database open resetlogs; }Referring this article on http://docs.oracle.com/cd/E11882_01/backup.112/e10642/rcmflash.htm#BGBDCAFA it says we can use both RMAN and SQL command for database flashback. Questions: 1. Difference between using RMAN and SQL command on database flashback? 2. When to use RMAN or SQL on the database flashback? 3. Which is the Oracle recommended or best way ? Edited by: Sivaprasad S on Mar 15, 2013 7:26 PM Edited by: Sivaprasad S on Mar 15, 2013 7:26 PM Edited by: Sivaprasad S on Mar 15, 2013 7:27 PM Edited by: Sivaprasad S on Mar 15, 2013 7:27 PM Edited by: Sivaprasad S on Mar 15, 2013 7:28 PM Edited by: Sivaprasad S on Mar 15, 2013 7:29 PM
So when you run your SQLPlus flashback, you get the following error:
ORA-38761: redo log sequence 1 in thread 1, incarnation 3 could not be found
This means so that the sequence 1 has probably been removed from the disk and is necessary.
When you run the RMAN command look at the log what RMAN:
* journal archived for thread 1 sequence 2 is already on the disc in the file +DG_PERF_FLASH_02/TestDB/archivelog/2013_03_14/thread_1_seq_2.3612.810054205*
* journal archived for thread 1 with sequence 3 is already on the disc in the file +DG_PERF_FLASH_02/TestDB/archivelog/2013_03_14/thread_1_seq_3.1588.810054205*So sequence 2 and 3 are already on record according to the above message.
Then you get this message:
channel dev_2: restoration of archives Journal
Archives journal thread = 1 sequence = 1So RMAN knows he needs 1 thus sequence and restores this newspaper archive she needs for recovery.
In a Word while running SQLPlus she communicate with RMAN and restore the log file for you, however with RMAN, it won't.
You can restore the newspaper archive manually, and then run in SQLPlus that will then work.
Published by: Freddie Essex on March 18, 2013 12:46
-
SQL command not properly ended.
Hello
I have connected the aplication to the oracle database in developer j. I used the Insert buttons and validation included.
For debugging application it runs correctly. but sometimes it gives error sql command not completed successfully.
I checked the requests when it runs successfully, it runs the query ' insert into Schema_name.table_name (column names) values (?)'.
but when it gives an error it runs the query ' insert into Schema_name. Schema_name. Schema_name. Schema_name. Schema_Name.table_name(column names) VALUES (?) e
Can someone tell me what is the reason of it?
Thank you.Can you try to change your query of
SELECT CD_ID, Data_Type, Data_Value, Misc1, Misc2 FROM Sample_ADF_FinIQ_Common.Common_data
TO
SELECT CD_ID, Data_Type, Data_Value, Misc1, Misc2 FROM Common_data
Note that I deleted the schema name of the query. Specific no reason why you use in front of the table schema name (I assume that you have created the connection to the schema on which you perform these operations).
Arun-
-
creation of database using the SQL command * more
Hello
This isn't a matter of urgency.
I learn the Oracle DBA. I have installed Oracle 9.2 in my windows system. And I'm trying to create a database using the SQL command.
OracleVersion: 9.2
Windows XP operating system
I get the error like below when executing the CREATE DATABASE command.CREATE DATABASE suri USER SYS identified by manager USER system identified by surendra LOGFILE GROUP 1 ('F:\Oracle\oradata\suri\redo01.log') SIZE 100M, GROUP 2 ('F:\Oracle\oradata\suri\redo02.log') SIZE 100M, GROUP 3 ('F:\Oracle\oradata\suri\redo03.log') SIZE 100M MAXLOGFILES 5 MAXLOGMEMBERS 5 MAXLOGHISTORY 1 MAXDATAFILES 100 MAXINSTANCES 1 CHARACTER SET US7ASCII NATIONAL CHARACTER SET AL16UTF16 DATAFILE 'F:\Oracle\oradata\suri\system01.dbf' size 200M EXTENT MANAGEMENT LOCAL UNDO tablespace undots datafile 'F:\Oracle\oradata\suri\undots01.dbf' size 200M DEFAULT TEMPORARY TABLESPACE tempts1 DATAFILE 'F:\Oracle\oradata\suri\temp01.dbf' SIZE 100M EXTENT MANAGEMENT LOCAL
I have validated the syntax but not able to find where is the error.ERROR at line 16: ORA-25139: invalid option for CREATE TEMPORARY TABLESPACE
Please let me know if you need more details.
Thanks in advance for your help.
Kind regards
SuriOracleVersion: 9.2
Why a so old version (and desupported)? In any case...
TEMPORARY TABLESPACE tempts1 DATAFILE 'F:\Oracle\oradata\suri\temp01.dbf' SIZE 100 M EXTENT MANAGEMENT LOCAL default
.. try change DATAFILE with TEMPFILE.
-
Oracle 10 g 2 64 bit odbc to oracle to sql server Win 2008 EE 64 bit
Hi, I have a problem with a creation of 64-bit 10 g oracle to sql server odbc 2, I have several instructions with no luck at all. My OS is windows 2008 EE 64 bit on the server oracle and sql server.
That's what I did
1. in the directory of $oracle_home/hs/admin
inithsodbc.ora
# HS init parameters
#
HS_FDS_CONNECT_INFO = hsodbc
HS_FDS_TRACE_LEVEL = off
2. in the $oracle_home/network/admin
listener.ora # Network Configuration file: C:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = C:\oracle\product\10.2.0\db_1)
(= Extproc PROGRAM)
)
(SID_DESC =
(SID_NAME = hsodbc)
(ORACLE_HOME=C:\oracle\product\10.2.0\db_1)
(PROGRAM=C:\oracle\product\10.2.0\db_1\hs\hsodbc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = xx.xx.xx.xx) (PORT = 1521))
(ADDRESS = (PROTOCOL = CIP)(KEY = EXTPROC0))
)
)
And the tnsname.ora
tnsnames.ora # Network Configuration file: C:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
PRUEBA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = xx.xx.xx.xx) (PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = test)
)
)
hsodbc =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = tcp)(HOST=xx.xx.xx.xx) (PORT = 1521))
(CONNECT_DATA = (SID = hsodbc))
(HS = OK)
)
I create the connection odbc test, the result is TEST PASSED
4. the i create a database on my database link
CREATE THE DATABASE LINK XYZ PUBLIC
CONNECT to 'sysdba' IDENTIFIED BY 'masterkey '.
Using "hsodbc."
5. run a select
SQL > select * from dual@XYZ;
Select * from dual@XYZ
*
ERROR on line 1:
ORA-28545: error diagnosed by Net8 when connecting to an agent
Cannot retrieve the text of the message NETWORK/NCR 65535
ORA-02063: preceding 2 lines of XYZ
6. when I check the log of the listener, I get this error
March 25, 2011 11:48:40 * (CONNECT_DATA = (CID = (PROGRAM =)(HOST=) (USER = Administrator)) (COMMAND = status)(ARGUMENTS=64) (SERVICE = LISTENER) (VERSION = 169870592)) * status * 0
March 25, 2011 11:48:47 * (CONNECT_DATA = (SID = hsodbc) (CID = (PROGRAM =) (HOST =)(USER=PRO\Administrator) PRO)) * (ADDRESS = (PROTOCOL = tcp (PORT = 49329))(HOST=xx.xx.xx.xx)) * establish * hsodbc * 12518
TNS-12518: TNS:listener could not hand off client connection
AMT-12560: TNS:protocol adapter error
AMT-00530: Protocol adapter error
Published by: user626125 on March 26, 2011 11:39
Published by: user626125 on April 12, 2011 14:49I guess the point of the answer above was to close and move this thread to the appropriate forum.
-
SUPERIOR service... ORA-00921: unexpected end of SQL command
Hello
get the below error.
SQL > @c:\test_user.sql;
Enter the user name value: mapple
old 1: DROP USER UPPER(&&USERNAME) CASE
new 1: DROP USER UPPER (mapple) WATERFALL
DROP USER UPPER (mapple) WATERFALL
*
ERROR on line 1:
ORA-00921: unexpected end of SQL command
you want to convert to uppercase in user input.
cant we use UPPER() function here?
How can we do?
RegardingNo, you can use the UPPER part.
Or do you need it. Oracle will automatically translate all identifiers (table names, column names, etc.) in uppercase, except if you wrap them in double quotes.
If you insist on the use of capital letters:Set sqlcase higher
send all your statements translated into letters on the server.
-------------
Sybrand Bakker
Senior Oracle DBA -
New to Oracle, different SQL
Hello
This is my first post on this forum, but I know I'll be here very often. I'm taking my first class on Oracle to complete my technical certification db (local certification).
Anyway, my instructor seems to test my wits sometimes and is not very good with questions. I spent the last week doing trial and error just trying to create a table in an Oracle db. I was told that this is exactly the same as the sql commands in access, regarding the creation of a table and insert commands are concerned. This appeared to be the case at all (or there is something I'm doing wrong)
So my first question here is just that. Can you really create a table and insert data by using the same exact SQL commands as you would in Access?
Thank you, and I expect to learn a lot from this forum.Hello
When I pasted your code in my text editor, something that resembled an Armenian character appeared at the end of line 2 and also at the end of the line 4 ("CELEB_FNAME varchar2 (10)," "). When I deleted these two characters, the instruction worked perfectly.
ORA-00907 is a very generic syntax error. Most of the time, it is not a case of missing a closing parenthesis. Often, it is not yet "additional information was included in parentheses; It may be a missing comma, a word misspelled or any number of other things. Usually, the location of the error is correct, however.
user12458625 wrote:
... What annoys me is the possibility that I could lose my time and must learn to enter SQL more like this (just an example), which is obviously very different in effectSQL >
SQL >-using a CREATE TABLE statement
SQL >
SQL > CREATE TABLE supplier
2 (supplier_id numeric (10) not null,)
3 supplier_name varchar2 (50) not null,
4 contact_name varchar2 (50).
5 CONSTRAINT PRIMARY KEY supplier_pk (supplier_id)
(6);Are you talking about the PRIMARY KEY and NOT NULL constraints?
If they are right, by all means use them. The example you posted has almost everything you need to know about how to apply them.
If supplier_id is the primary key, which implies that supplier_id cannot be NULL, but it is not bad to say explicitly. -
execute sql commands in the browser
I use Oracle 10 g standard edition in the windows platform.
I am getting SQL prompt, but I want to run the SQL commands in the browser. But I'm not.
Please help me!You must start the iSQL * Plus service. Check starting the iSQL * Plus Application Server.
Maybe you are looking for
-
How to remove AOL Toolbar?
How do I remove this from my Mac OSX 10.9.5It's a real pain in the rear and I deleted Firefox three times to try to get rid of the AOL toolbar that comes with it. I try it and if I can't fix the problem I have is looking for another browser to use af
-
Satellite A300 - cannot access the Internet more
I would like to re - open this thread because I am facing a similar problem.I have a Toshiba Satellite A300 and I installed Windwos 7 two months ago. Yesterday, his suddenly, my laptop could not access the internet more, but the wireless lan connecti
-
Mirco SD blackBerry Smartphone problem
I'm trying to get us a 4 GB micro sd hc card in my Curve 8310. I've updated the software on my curve to v4.5. I don't have another computer to format the card. My curve recognizes the card, but will not format the card. I have a mac with pocketma
-
Disable certain value in the Radio button group
HelloIs it possible to have a group of radio buttons but have certain values with disabilities while they are displayed but cannot be selected while other values in the Group of radio buttons are selectable.I know that I could have two groups of radi
-
'Install' is corrupted and cannot be opened.
I'm working on my new Mac. I tried to download CS5 four times and get the same error when I try to install it. Any ideas how I can get on that?