Problem with PLSQL dbms job in apex
Hi,
I am completely new to apex, and am facing a issue which i feel is strange.
There is a button on the apex page and a process is associated with that button. Some tables are being updated in the code written in that process and a db procedure is called which creates some files on the unix box(utl_file). The type of that process is PLSQL DBMS job.
Now its been observed that the code written on that button is executed at odd times i.e no one made any action on the button.
So my questions are,
Is this PLSQL DBMS job same as that of the database dbms_job?? but the logs have no entry.
Is there a case when the button might be pressed earlier but the job executed late because of resources not being available?
Any logs created by apex so that i can track the job??
Any idea if i can replace this plsql dbms job with any other process type??
Secondly, there are 4 files being generated out of which 3 are generated with 644 permission and 1 file is generated with 600. Why does this happen?
Apex version :3.1
db version: 10.2.0.4
Regards,
Ankit
Looks like it's still a database bug. In 10.1.0.4, I get the correct results in sqlplus from the query but I get incorrect results in sqlplus if I do it like this:set serveroutput on
declare
l_cursor integer := DBMS_SQL.OPEN_CURSOR;
l_desc_tbl DBMS_SQL.DESC_TAB2;
l_ignore number;
l_col_cnt integer;
l_col_val varchar2(32767);
BEGIN
DBMS_SQL.PARSE(l_cursor,
'select connect_by_isleaf LEAF,DESCRIPTION,PLACE from test_tab start with id = 1 connect by prior id = id_master',
DBMS_SQL.NATIVE);
l_ignore := DBMS_SQL.EXECUTE(l_cursor);
DBMS_SQL.DESCRIBE_COLUMNS2(l_cursor, l_col_cnt, l_desc_tbl );
for i in 1 .. l_col_cnt loop
DBMS_SQL.DEFINE_COLUMN(l_cursor, i, l_col_val, 32767 );
end loop;
while (DBMS_SQL.FETCH_ROWS(l_cursor) > 0)
loop
for i in 1 .. l_col_cnt loop
DBMS_SQL.COLUMN_VALUE(l_cursor, i, l_col_val);
-- print the column value
dbms_output.put_line(l_col_val);
end loop;
dbms_output.put_line(chr(10));
END LOOP;
if DBMS_SQL.IS_OPEN(l_cursor) then
DBMS_SQL.CLOSE_CURSOR(l_cursor);
end if;
END;
/Scott
Similar Messages
-
APEX_PLSQL_JOB.SUBMIT_PROCESS / Process Type "PLSQL DBMS JOB"
Has anyone got APEX_PLSQL_JOB.SUBMIT_PROCESS to work? I've seen several threads which my exact problem but am unsure if anyone has got it to work.
Here is my process:
declare
jobnumber number;
begin
IF apex_plsql_job.jobs_are_enabled THEN
jobnumber := apex_plsql_job.submit_process(
p_sql => 'insert into temp_jobtest
values (''APEX PLSQL Job'',sysdate);
commit;');
END IF;
end;Process runs and APEX_PLSQL_JOBS shows SYSTEM_STATUS as "COMPLETE" but no rows are ever added to the temp_jobtest table. I tried submitting directly using dbms_job and it worked as expected.
I have read: Background jobs
I really wish we could still create a process type of (PLSQL DBMS JOB). If this functionality has been deprecated then why is it still referenced in the User Guide?
From the APEX User Guide, Release 2.2, B28550-01, July 2006; page 13-15; heading - "Using a Process to Implement Background PL/SQL"
The simplest way to implement the APEX_PLSQL_JOB package is to create a page
process that specifies the process type PLSQL DBMS JOB. By selecting this process
type, Application Builder will submit the PL/SQL code you specify as a job."Ok, I do see it.....if I was still working in a version pre 2.0"
Which is exactly what I have done. I had access to a HTMLDB 1.5 environment.
--I create a new application in 1.5 with 1 page.
--Added a page process with a process type of "PL/SQL DBMS JOB".
--Exported the application.
--Import the application into APEX 2.2 environment
--copy page from imported application to my application
--copied the process from my copied page to the page in my application where I want the process
So far it is working just as I expected.
Thanks Jeleeb! I present you with a silver medal. -
PLSQL DBMS JOB - how to schedule ?
Hi, I came across the process type "PLSQL DBMS JOB" - how can I schedule it within APEX?
I understood using PLSQL DBMS JOB it just executes once and thats it.
I like to use the process PLSQL DBMS JOB to execute once a day and call a procedure I have defined already. A code example wud be v.m. appreciated.
TIA
BernhardFirst you need to make sure your init.ora has the following things defined<br><br>
job_queue_processes=2<br>
job_queue_interval=10<br>
<br>the value above are recommended by Oracle<br><br>when I did this and restarted the database with the new init.ora (or pfile) it said something was no longer used so what I am suggesting above may not be entirely required but it seems to have worked for me...
<br><br>
then its just a case of executing the following<br><br>
declare<br>
jobno number;<br>
BEGIN<br>
dbms_job.submit(JobNo, 'begin my_thing_to_execute; end;', SYSDATE,
'SYSDATE + 1/24');<br>
COMMIT;<br>
dbms_output.put_line(jobno);<br>
END;<br>
<br>
the first sysdate is when to run next, the second sysdate+1/24 is how often to run so this is saying run hourly. if you want daily then it would be just +1.<br><br>that should get ya going to start with anyway. it can pay to put a little insert into a dummy table in your code that you want the dbmsjob to execute so then you know for sure that its working.<br><br>if you are talking about a dbms job thing in APEX then this is probably irrelevant as this is a dbmsjob in the database, not through APEX -
Problem with Crystal Report Job Server Destinations
I am using Crystal Reports XI Server and I am having problems with scheduling. I believe that the problem is that I have not enabled any destinations under the Crystal Reports Job Server. The following is an observation list:
-Enabled and set up all destinations for other servers, such as the Destination Server.
-Have been able to use Infoview to directly email, inbox, and file save reports in different formats (I believe the Destination Server controls this, right?)
-All servers are enabled in the Central Configuration Manager
-Have been able to go into the Crystal Reports Job Server within the CMC, but I DO NOT FIND ANY destinations to enable (why is this?)
-Have not been able to schedule an instance of any report (neither email, nor inbox, nor file, ...nothing)
Could somebody please help me with this? Is this a limitation to the Crystal Reports XI Server vs the Enterprise edition? Is there something else I am missing? I have never been able to successfully schedule a report.Thank you for the input, but I have not yet solved my problem. Please allow me to provide some additional information which may give more hints:
I have Crystal Reports XI Server R2 installed as 5 named user license (version that comes with developer)
The following servers are enabled in CMC (which is all of them)
-Input.DomainNameSQL
-DomainNameSQL.cacheserver
-DomainNameSQL.cms
-DomainNameSQL.destinationjobserver (has all destinations enabled)
-DomainNameSQL.eventserver
-DomainNameSQL.ListofValuesJobServer (no destination tab)
-DomainNameSQL.pageserver
-DomainNameSQL.programjobserver (has all destinations enabled)
-DomainNameSQL.RAS
-DomainNameSQL.reportjobserver (has destinations tab, but there are no destination entries to enable! Object type is: CrystalEnterprise.Report and detail: IDL:omg.org/CORBA/UserException:1.0
. Details: %2.'
These are the ONLY two event IDs that appear after I schedule the report instance. No other events occur.
Are there any other logs that I can check? How do I look up what event ID 45387 and 45385 are?
Thanks! -
Problem with EXPORT IMPORT PROCESS in ApEx 3.1
Hi all:
I'm having a problem with the EXPORT IMPORT PROCESS in ApEx 3.1
When I export an application, and try to import it again. I get this error message
ORA-20001: GET_BLOCK Error. ORA-20001: Execution of the statement was unsuccessful. ORA-06550: line 16, column 28: PLS-00103: Encountered the symbol &quot;牃慥整㈰㈯⼴〲㐰〠㨷㐵㈺′䵐&quot; when expecting one of the following: ( - + case mod new not null &lt;an identifier&gt; &lt;a double-quoted delimited-identifier&gt; &lt;a bind variable&gt; avg count current exists max min prior sql stddev sum variance execute forall merge time timestamp in
As a workaround, I check the exported file and found this
wwv_flow_api.create_flow
p_documentation_banner=> '牃慥整⠤㈰㈯⼴〲㠰〠㨷㠵㈺′äµ
And when I replace with this
p_documentation_banner=> ' ',
I can import the application without the error.
somebody knows why I have to do this??
Thank you all.
Nicolas.Hi,
This issue seems to have been around for a while:
Re: Error importing file
I've had similar issues and made manual changes to the file to get it to install correctly. In my case, I got:
ORA-20001: GET_BLOCK Error. ORA-20001: Execution of the statement was unsuccessful.<br>ORA-02047: cannot join the distributed transaction in progress<br>begin execute immediate 'alter session set nls_numeric_characters='''||wwv_flow_api.g_nls_numeric_chars||'''';end;There are several suggestions, if you follow that thread, about character sets or reviewing some of the line breaks within pl/sql code within your processes etc. Not sure what would work for you. -
Problem with german special characters in APEX
Hi,
we have a problem with all the special characters in german language in our Application.
APEX version 3.1.0.00.32 is installed on a oracle database 9.2.0.6.0
The nls_characterset of the database is: American_America.WE8ISO8859P1
We have modified the wdbsvr.app file on our HTTP-Server like it's shown in the installationguide for APEX and have set the nls_lang parameter to American_America.AL32UTF8.
If I look at the source code of the html-pages of our application, there are already the following settings in the header of every page:
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
With this settings all the german special characters like ä ö ü are not shown correctly in the browser.
What can I do that the pages are shown correctly?
Thanks for help!Hi Petra,
ok, so my guess was correct. So the solution is to set the charset attribute in the HTML header to "charset=UTF-8". This is actually the way it should be. But I'm wondering why it is not in your case? Are you using a custom template for the page(s) in question where the charset attribute is set to a custom value? The meta tags in the HTML header are usually set by/through the #HEAD# substitution string in the header definition section of the page template, cp. one of the page templates in Shared Components --> Templates. And as far as I know you are not able to change this substitution string, you can only switch the inclusion on/off with the option "Include Standard CSS and JavaScript" in each page definition. (I might be mistaken, though, I'm quite new to APEX...)
Regards
Frank -
Problem with importing decimal numbers in Apex
Hi,
I have a ascii data file which I load into db tables calling a procedure in a db package.
Executing the procedure by SQL Plus everything works fine.
Calling the procedure by Apex button I get a "ORA-01722: invalid number; Error inserting subject" because of the decimal numbers in the data file. Taking the decimal numbers out of the file it works.
- I tried with different formats in the data file like: 4.40 4,40 4.4 4,4: Makes no difference.
- In Apex I tried column formatting in the report attribute: 999G999G999G999G990D00: Makes no difference, it's obviously only formatting the display.
- Debug mode just shows there is an error..
- The db column is of format NUMBER(10,2)
As I mentioned, with SQL Plus it works no matter of the number format in the data file.
Anybody has an idea where the problem might be?
Help is greatly appreciated,
RogerHi Joel,
Thanks for your reply. You were right, the NLS setting for the decimal separator in SQL*Plus is a , (komma) and in Application Express a . (point).
I suspected a NLS problem that's why I tested with different formats in the data file (4.40 4,40). Shouldn't that make a difference?
Now, to fix it: I didn't see in Apex any NLS settings, I checked in utilities and shared components. So, the way to do that is to directly write into SQL Workshop / Apex?
ALTER SESSION SET NLS_NUMERIC_CHARACTERS=",' "
Cheers,
Roger -
A problem with plsql trigger in my form
i created two text field and a button(insert) to take the value of the text feild at run time and insert it in the table
this is my procedure
CREATE OR REPLACE PROCEDURE insert_value
(brn_id_in_p IN branch.brn_id%TYPE,
brn_name_in_p IN branch.brn_name%TYPE)
IS
BEGIN
INSERT INTO branch (brn_id,brn_name)
VALUES (brn_id_in_p, brn_name_in_p);
END insert_value;
and in the form button trigger (when button pressed ) i wrote this
EXECUTE insert_value(:BRANCH.BRN_ID_TF,:BRANCH.BRN_NAME_TF);
but it gave me plsql error but i dont know why?
note BRANCH is the datablock name and BRN_ID_TF,BRN_NAME_TF is the name of the itemsOnly write
insert_value(:BRANCH.BRN_ID_TF,:BRANCH.BRN_NAME_TF);
and then give me the error which is prompted...
another problem may occur with the data type which you declared in the properties of the text items
:BRANCH.BRN_ID_TF and :BRANCH.BRN_NAME_TF
in your forms. -
Problem with EXEC services Job
Hi,
We are facing problem in Solution Manager 3.0 with EWA report generation. For the scheduled date of EWA , the job RDSMOPBACK_AUTOSESSIONS failed with an error CONNE_ILLEGAL_TRANSPORT_HEADER.
Can anybody , faced or have an solution for the same.
Regards,
NarenderHi Narender,
usually, this kind of dump is related to a corrupted data collection for the EWA session.
I recommend to delete the download (run DSA, enter the 13 digits session number, choose display and click on the truck symbol, there should be possibility to delete the data). The processing job will run again. You may collect the data in SDCCN again or just create a new EWA session in Solution Manager.
Best regards
Ruediger Stoecker -
Hello All,
I have a sql query which i am trying to put it in plsql block.It throws me an error saying i cannot have group function as my two select strings gives me more than one row. How to tackle this??
declare
uuid varchar;
stat_date date;
begin
select 'I'||Lower(docfamily_uuid) into uuid, max(status_date) into stat_date from document_status where status_code=303 or status_code=305 group by docfamily_uuid;
end;
ThanksIn addition to being mal-formed it is likely your problem stems from the fact that your query is returning more than one row. Now perhaps you are expecting only one row and your GROUP BY might be getting in the way. Try changing your GROUP BY to include the LOWER function that is in your SELECT statement. But realize that this in itself will not guarentee one row returning from the SELECT statement.
WITH document_status AS
SELECT 'xxx' docfamily_uuid, sysdate status_date, 303 status_code from dual
UNION ALL
SELECT 'XXX' docfamily_uuid, sysdate status_date, 303 status_code from dual
SELECT 'I'||Lower(docfamily_uuid), max(status_date)
FROM document_status
WHERE status_code=303 or status_code=305
GROUP BY docfamily_uuid;
Ixxx 05-FEB-09
Ixxx 05-FEB-09
WITH document_status AS
SELECT 'xxx' docfamily_uuid, sysdate status_date, 303 status_code from dual
UNION ALL
SELECT 'XXX' docfamily_uuid, sysdate status_date, 303 status_code from dual
SELECT 'I'||Lower(docfamily_uuid), max(status_date)
FROM document_status
WHERE status_code=303 or status_code=305
GROUP BY LOWER(docfamily_uuid);
Ixxx 05-FEB-09Greg -
Problem with Collections after Upgrade to Apex 4.02
Hi,
We are using oracle 10g with Apex 4.02.
I installed Jari's application for data import from excel.
http://dbswh.webhop.net/apex/f?p=BLOG:READ:0::::ARTICLE:126300346812330
It is working fine in our test environment but in production environment it is showing no data when I press the submit button. Am I missing some user privillege? Any help?
Thanks,
ZahidI have a HTML page with a browse file item. I select my csv file and press the upload button. The button submits the page and executes the following procedure.
BEGIN
DECLARE
v_blob_data BLOB;
v_blob_len NUMBER;
v_position NUMBER;
v_raw_chunk RAW(10000);
v_char CHAR(1);
c_chunk_len number := 1;
v_line VARCHAR2 (32767) := NULL;
v_data_array wwv_flow_global.vc_arr2;
v_rows number;
v_sr_no number := 1;
v_rows_loaded NUMBER;
BEGIN
-- Read data from wwv_flow_files</span>
select blob_content into v_blob_data
from wwv_flow_files
where last_updated = (select max(last_updated) from wwv_flow_files where UPDATED_BY = :APP_USER)
and id = (select max(id) from wwv_flow_files where updated_by = :APP_USER);
v_blob_len := dbms_lob.getlength(v_blob_data);
v_position := 1;
-- Read and convert binary to char</span>
WHILE ( v_position <= v_blob_len ) LOOP
v_raw_chunk := dbms_lob.substr(v_blob_data,c_chunk_len,v_position);
v_char := chr(hex_to_decimal(rawtohex(v_raw_chunk)));
v_line := v_line || v_char;
v_position := v_position + c_chunk_len;
-- When a whole line is retrieved </span>
IF v_char = CHR(10) THEN
-- Convert comma to : to use wwv_flow_utilities </span>
v_line := REPLACE (v_line, ',', ':');
-- Convert each column separated by : into array of data </span>
v_data_array := wwv_flow_utilities.string_to_table (v_line);
--DELETE OLD DATA
-- Insert data into target table </span>
IF v_sr_no >1 THEN
EXECUTE IMMEDIATE 'INSERT INTO EMP(EMPNO, ENAME, SAL, COMM, DEPTNO)
VALUES (:1, :2, :3, :4, :5)'
USING
-- v_sr_no,
v_data_array(1),
v_data_array(2),
v_data_array(3),
v_data_array(4),
v_data_array(5);
END IF;
-- Clear out
v_line := NULL;
v_sr_no := v_sr_no + 1;
END IF;
END LOOP;
END;
COMMIT;
END;Pressing button gives me "ORA-01403: no data found" error message. This has been working before we upgraded from Apex 3.2 to Apex 4.02.
I hope that the above detail may give you better idea of the problem.
Thanks. -
Problems with saving after Migration on ApEx 2.2
Hi,
we migrated from HTMLDB 2.0 to ApEx 2.2.
Now our end-users have problems.
They want to save their changes and after pressing the change button an empty page appears.
So they go back with the internet explorer back-button and press the save button again. Now the changes are saved in the database.
Does anybody have the same problem?
Is there a solution to fix this problem?
Thank you in advance
UlrikeYes thank you very much. This is the solution.
But it's a pitty that we have to change the CSV endcoding option for all our applications after migration manually.
Kind regards Ulrike -
Problem with Acrobat print job being stuck in queue
I have Acrobat 7.0 Pro and I do a lot of print to Acrobat PDF 7.0 from web pages. When I go to print from Safari and pick the printer Acrobat PDF 7.0,
the pages will process and bring the PDF up in Acrobat.
However, if I then want to print another page, I have a problem. Many times, the previous print job has a status of printing in the queue even though it is complete.
If I delete the job, the next job will complete.
Something is not completing or deleting completed jobs in my queue.
Any help would be great.Thank you for the response. This has always worked for me in the past. I can print a web page to acrobat, then even print another one and the next file (pdf) is created no problem. In the past, the print job has gone away as soon as the file was created.
I will try the permissions fix and see what happens.
Shane
Hi there,
With the page that has opened in Acrobat, do you save
this document before you try to print the next
document. I am thinking that maybe the spooler is
expecting you to do something with the file that has
printed before it releases it from the queue.
I would also try running a Repair Disk Permissions.
This is located in Applications > Utilities > Disk
Utility. This can resolve permissions on files that
may be stopping the spooler from finishing.
Regards,
Paul -
I just installed oracle 10g and all works fine.... except the web server i made a simple web procedure called hello
when i tried to execute it:
127.0.0.1:7777/app/hello
returned this message on the browser:
"Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Oracle-HTTP-Server/1.3.28 Server at oraunix Port 7777"
My dad is:
"<Location /app/mio>
SetHandler pls_handler
Order deny,allow
Allow from all
AllowOverride None
PlsqlDatabaseConnectString 127.0.0.1:1521:tsh1
PlsqlAuthenticationMode Basic
</Location>"
any ideas?????This is how I configured my dad
# ============================================================================
# mod_plsql DAD Configuration File
# ============================================================================
# 1. Please refer to dads.README for a description of this file
# ============================================================================
# Note: This file should typically be included in your plsql.conf file with
# the "include" directive.
# Hint: You can look at some sample DADs in the dads.README file
# ============================================================================
<Location /pls/chukws>
SetHandler pls_handler
Order deny,allow
Allow from all
AllowOverride None
PlsqlDatabaseUsername chukws
PlsqlDatabasePassword ikechi
PlsqlDatabaseConnectString chiana.kymp.net:1521:orcl ServiceNameFormat
PlsqlDefaultPage htmldb
PlsqlDocumentTablename wwv_flow_file_objects$
PlsqlDocumentPath docs
PlsqlDocumentProcedure wwv_flow_file_manager.process_download
PlsqlAuthenticationMode Basic
PlsqlNLSLanguage AMERICAN_AMERICA.WE8MSWIN1252
</Location>
And it worked fine. -
Hello experts,
I have one background job which generates a text file and place it in a FTP folder.
When one user runs this job its working fine. But,
When two users run <b>the same background job at same time,</b> then i get trouble with my output file as the data is mixed up.
How to avoid this! Appreciate quick response.Have each run of the job create a unique file OR when a user starts a job, create a "marker" file that prevents all other runs of the same prg from executing until the marker file is deleted.
The deletion of the marker file would need to be the last step of the prog then. This would allow the second user to run the prog later (after the first user is done).
Maybe you are looking for
-
How do I get possession of an iCloud email address?
At some point in the not too distant past, I remember having to create an iCloud email address. It will be associated with my apple ID, but I cant use it. I know noone else has it because the email server gives a bounceback. How do I get in touch w
-
Layer break solution for a single 2 hour continuous timeline (DVD-9 DL) in GEAR?
Having a single 2 hour continuous timeline in Encore project. When the project is exported there isn't any non-seamless cells in the layer break window that GEAR is providing. According to DVD specification the layer break should be set to a non-seam
-
this phone is absolutely fantastic. i'd like to buy it 'cause now the price is lower (something like 150 euro) than before but... there's no bluetooth; memory is only 4 mb; VGA camera is surely worst than one of 2 or 3 megapixel but (even if it's not
-
My photos from iPhone 6 appear in PNG format instead of JPG. How can that be changed?
-
I am trying to capture something and use the system audio, but that option is not available for me. I have tried recording many different ways, and it never seems to be available to me. What am I missing?