oracle10g

How to increase dbms_output buffer?

僤鯓⒐⒋嵵緔 提交于 2019-12-09 14:14:33
问题 I tried to debug my dynamic query via dbms_output but seems like the query string is too long for dbms_output buffer. I got : ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at "SYS.DBMS_OUTPUT", line 148 ORA-06512: at line 1 Any idea how to increase the buffer size ? 回答1: You can Enable DBMS_OUTPUT and set the buffer size. The buffer size can be between 1 and 1,000,000. dbms_output.enable(buffer_size IN INTEGER DEFAULT 20000); exec dbms_output.enable

Error System.Data.OracleClient requires Oracle client software version 8.1.7 or greater when installs setup

橙三吉。 提交于 2019-12-09 10:51:34
问题 I have made a desktop app Setup that connects with remote Oracle 10g Database. When I install Setup on remote machine and run my application then I get following error: system.data.oracleclient requires oracle client software version 8.1.7 or greater It works well on my Development machine. 回答1: The error message is pretty self-explanatory: your application needs the Oracle Client installed on the machine it's running on. Your development PC already has it. Make sure your target PC has it,

TransactionScope - The underlying provider failed on EnlistTransaction. MSDTC being aborted

China☆狼群 提交于 2019-12-09 08:15:46
问题 Our team have got a problem that manifests as: The underlying provider failed on EnlistTransaction; Cannot access a disposed object.Object name: 'Transaction'. which seemed to appear as soon as we began using TransactionScope to handle our applications' transactions. The top part of the stacktrace is captured as: at System.Data.EntityClient.EntityConnection.EnlistTransaction(Transaction transaction) at System.Data.Objects.ObjectContext.EnsureConnection() at System.Data.Objects.ObjectContext

How to select records grouped by the hour of the day including hours that have no records

∥☆過路亽.° 提交于 2019-12-09 06:52:26
I have a table in an Oracle database that contains actions performed by users in one of our systems. It's used for statistical analysis and I need to display the number of actions performed for a given date, grouped by hour of the day. I have a query that does that fine, however, it does not display the hours of the day that contain no actions (obviously because there are no records to display for that hour). For example, the query: SELECT TO_CHAR(event_date, 'HH24') AS during_hour, COUNT(*) FROM user_activity WHERE event_date BETWEEN to_date('15-JUN-2010 14:00:00', 'DD-MON-YYYY HH24:MI:SS')

Python: How to determine subprocess children have all finished running

戏子无情 提交于 2019-12-09 06:20:28
问题 I am trying to detect when an installation program finishes executing from within a Python script. Specifically, the application is the Oracle 10gR2 Database. Currently I am using the subprocess module with Popen. Ideally, I would simply use the wait() method to wait for the installation to finish executing, however, the documented command actually spawns child processes to handle the actual installation. Here is some sample code of the failing code: import subprocess OUI_DATABASE_10GR2

Get total count of rows in pagination query

谁说我不能喝 提交于 2019-12-09 06:02:52
问题 I have the following query for record pagination SELECT * FROM (SELECT e.*, ROWNUM row_num FROM (SELECT emp_no, emp_name, dob from emp) outr WHERE ROWNUM < ( (pagenum * row_size) + 1)) WHERE row_num >= ( ( (pagenum - 1) * row_size) + 1) I would like to get the count of rows as well in same query and for this I have tried using COUNT(*) OVER () however I am not getting accurate results when I am paginating to next set of page and rows. How can I use COUNT(*) OVER () efficiently? 回答1: A typical

ROWNUM IN ORACLE

拜拜、爱过 提交于 2019-12-09 03:56:43
问题 I want to retrive record at 4th position in ORACLE 9i. Can I compare ROWNUM=4 in the WHERE clause?? 回答1: No, ROWNUM is assigned after the WHERE clause is evaluated, so it cannot "skip" rownum one to three. Furthermore, it is assigned BEFORE sorting. This is the most annoying "feature" of Oracle. They really need to implement LIMIT/OFFSET. You need to do something like select * from ( select a.*, rownum rn from ( select the_data from the_table order by the_order ) a where rownum < 5 ) where rn

How to schedule a job in pl/sql?

旧巷老猫 提交于 2019-12-09 03:26:26
问题 I have created one stored procedure with name traffic_details_temp_send_mail; How to make this procedure to run everyday at 10AM? Please help with block of code. Thanks in advance. 回答1: you can create a scheduler job: begin dbms_scheduler.create_job(job_name => 'TRAFFIC_DETAILS_JOB', job_type => 'STORED_PROCEDURE', job_action => 'traffic_details_temp_send_mail', start_date => systimestamp, end_date => null, repeat_interval => 'freq=daily; byhour=10; byminute=0; bysecond=0;', enabled => true,

Why we can't execute stored procedure in select statement in oracle? is there any strong reason?

自古美人都是妖i 提交于 2019-12-09 01:54:16
问题 create or replace procedure pr is v_date date; begin select sysdate into v_date from dual; DBMS_output.put_line(v_date); end pr; 回答1: Procedures are not allowed in SQL statements because mixing declarative and imperative programming styles is confusing. A SQL statement is a list of conditions - it's up to Oracle to decide how to produce the result set that matches those conditions. A PL/SQL stored procedure is a set of instructions that change things in a very predictable way. In the below

How to use Oracle global temporary table?

吃可爱长大的小学妹 提交于 2019-12-09 00:44:02
问题 I am attempting to use an Oracle global temporary table without physically creating a table in the database. The following code is not working. Can someone please explain the proper way to use global temporary tables? declare global temporary table my_temp_table(column1 number) on commit preserve rows; begin insert into my_temp_table (column1) values (1); select * from my_temp_table; end; 回答1: Try the below using execute immediate: it uses exception handler to bypass if table already exists;