oracle10g

Invoking a function call in a string in an Oracle Procedure

家住魔仙堡 提交于 2020-01-01 19:00:11
问题 I writing an application using Oracle 10g. I am currently facing this problem. I take in "filename" as parameter of type varchar2. A sample value that filename may contain is: 'TEST || to_char(sysdate, 'DDD')'. In the procedure, I want to get the value of this file name as in TEST147. When i write: select filename into ffilename from dual; I get the value ffilename = TEST || to_char(sysdate, 'DDD') whick makes sense. But how can I get around this issue and invoke the function in the string

Oracle built-in functions metadata

烈酒焚心 提交于 2020-01-01 17:20:35
问题 Is there a way to get metadata for the Oracle built-in aggeregate and other functions such as AVG, STDDEV, SQRT, etc.? I need to know object id and arguments meta. In the SYS.ALL_OBJECTS view I couldn't find anything useful. I also tried to search in SYS.ALL_ARGUMENTS view by object_name. Is there views or tables with built-in functions with data similar to SYS.ALL_OBJECTS and SYS.ALL_ARGUMENTS ? 回答1: You have tagged Oracle 10g, but from what I can find, you'll need Oracle 11g r1 to find out

Oracle built-in functions metadata

邮差的信 提交于 2020-01-01 17:20:12
问题 Is there a way to get metadata for the Oracle built-in aggeregate and other functions such as AVG, STDDEV, SQRT, etc.? I need to know object id and arguments meta. In the SYS.ALL_OBJECTS view I couldn't find anything useful. I also tried to search in SYS.ALL_ARGUMENTS view by object_name. Is there views or tables with built-in functions with data similar to SYS.ALL_OBJECTS and SYS.ALL_ARGUMENTS ? 回答1: You have tagged Oracle 10g, but from what I can find, you'll need Oracle 11g r1 to find out

How can I configure my Oracle tnsnames file location? [closed]

别说谁变了你拦得住时间么 提交于 2020-01-01 14:38:31
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I have Oracle 10g installed on Windows. Currently, my tnsnames file is stored at %ORACLEHOME%\network\admin. However, I want to configure Oracle to look somewhere else for that file. How can I do this? Andrew L 回答1: You can use the TNS_ADMIN environment variable to specify a custom location of TNSNAMES.ORA file.

Deleting Duplicate Records in Oracle based on Maximum Date/Time

淺唱寂寞╮ 提交于 2020-01-01 05:53:33
问题 i have the following sample data with duplicate information: ID Date Emp_ID Name Keep --------------------------------------------------------- 1 17/11/2010 13:45:22 101 AB * 2 17/11/2010 13:44:10 101 AB 3 17/11/2010 12:45:22 102 SF * 4 17/11/2010 12:44:10 102 SF 5 17/11/2010 11:45:22 103 RD * 6 17/11/2010 11:44:10 103 RD Based on the above data set, how can I remove the duplicate Emp IDs and only keep the Emp IDs that have the maximum date/time specified? So based on the above, I would only

Oracle sequence caching

只谈情不闲聊 提交于 2020-01-01 05:00:07
问题 I am trying to implement a sequence in an Oracle database to act as a surrogate key creator for a table. For performance reasons, I want this sequence to be cached. I have read that there are potential pitfalls when using cached sequences since rollbacks and instance failures will result in missed values. This got me to thinking. Let's say I create a sequence with a cache size of 100. Then I make a 50 record insert to my table, with the sequence value as the primary surrogate key. After the

Script to disable all jobs in Oracle (DBMS_JOB package)?

末鹿安然 提交于 2020-01-01 03:03:32
问题 I'm looking for a script which disables all the jobs. Right now I highlight them all in Toad, click the take offline button and then commit changes. There has to be a way to do this in PL/SQL. 回答1: If you want to prevent all jobs from running, you can change the initialization parameter JOB_QUEUE_PROCESSES . If you set that to 0, Oracle won't run any jobs scheduled using DBMS_JOB . You could also mark the jobs broken BEGIN FOR x IN (SELECT * FROM user_jobs) LOOP dbms_job.broken( x.job, true )

How to drop list of table from a schema in Oracle?

一世执手 提交于 2019-12-31 04:52:07
问题 My Oracle scott schema contains table list like that 'prefix_A' 'prefix_B' 'prefix_C' 'A' 'B' 'C' Now i want to drop list of tables ,containing table prefix like that 'Prefix_',But others table A ,B ,C will be remain same. How it is possible ? Thanks in Advance. 回答1: Use dynamic SQL driving off the data dictionary. begin for trec in ( select table_name from user_tables where table_name like 'PREFIX\_%' escape `\' ) loop dbms_output.put_line('dropping table ' || trec.table_name); execute

Oracle 10g: parsing 2 columns merging duplicates

给你一囗甜甜゛ 提交于 2019-12-31 03:19:08
问题 I'm having a table with 3 columns: DATE_A , DATE_B and ISSUE DATE_A and DATE_B can be filled in 3 possible ways: either both have a value, or only one have, as shown here: DATE_A | DATE_B | ISSUE ----------+-----------+----------- 20130301 | 20140101 | bla 20150801 | null | foo null | 20180701 | bar I need to parse this table to populate a new table, with DATE_A and DATE_B populating both a single column DATE_M . If the DATE_A (or DATE_B ) value to insert into DATE_M already exists in DATE_M

Error when importing cx_Oracle module [Python]

﹥>﹥吖頭↗ 提交于 2019-12-31 01:46:14
问题 I use Windows 7 64 bit and Oracle 10g. I have installed python-2.7.2.amd64 and cx_Oracle-5.1-10g.win-amd64-py2.7. When I importing cx_Oracle module I get this error: Traceback (most recent call last): File "C:\Osebno\test.py", line 1, in import cx_oracle ImportError: No module named cx_oracle Can someone please tell me what is wrong? 回答1: Have you tried import cx_Oracle (upper-case O ) instead of import cx_oracle ? 回答2: I had this same issue under Windows. I used Dependency Walker to open up