oracle11g

Error ORA-12154 on DBI->connect to Oracle database with Oracle Instant Client in Solaris 10

大兔子大兔子 提交于 2021-02-10 18:42:56
问题 I've been pulling my hair out over this problem for two days now: I'm trying to get a perl script to interface with an Oracle database. I have a new server I'd like to deploy my application on. This script previously worked. Here's what I've done so far: Placed my tnsnames.ora file in instantclient/network/admin: ls -la network/admin/ total 8 drwxrwxrwx 2 m staff 512 Apr 19 09:54 . drwxrwxrwx 3 m staff 512 Mar 28 15:56 .. -rwxrwxrwx 1 m staff 777 Apr 19 09:54 tnsnames.ora My Perl script looks

How can I replace multiple words “globally” using regexp_replace in Oracle?

一曲冷凌霜 提交于 2021-02-10 16:02:30
问题 I need to replace multiple words such as (dog|cat|bird) with nothing in a string where there may be multiple consecutive occurrences of a word. The actual code is to remove salutations and suffixes from a name. Unfortunately the garbage data I get sometimes contains "SNERD JR JR." I was able to create a regular expression pattern that accomplishes my goal but only for the first occurrence. I implemented a stupid hack to get rid of the second occurrence, but I believe there has to be a better

Is there a way to display dynamic columns in Oracle apex

≡放荡痞女 提交于 2021-02-08 11:15:25
问题 Long story short, I can't use pivot for this task due to the long elements that I need to include in the columns. Although I tried to create a Classic Report based on function in Oracle Apex. The query it's generated correctly but it's not working in the Classic Report. 回答1: A general hint first: Output your variable l_sql to your console using dbms_output.put_line or use some kind of debugging table where you can insert it into. Also be careful about the data type of that variable. If you

Why PLS-00382: expression is of wrong type?

半世苍凉 提交于 2021-02-08 10:59:55
问题 I have the following custom RECORD TYPE : TYPE TB48_RECTYPE IS RECORD ( codpo varchar2(5 BYTE), codco varchar2(5 BYTE), quadr varchar2(5 BYTE), espec varchar2(5 BYTE), aperf varchar2(5 BYTE), subes varchar2(5 BYTE), datin date); And now a function that returns the exact same type. function retorna_infos_tabela_48(i_nip in varchar2) return TB48_RECTYPE is retorno_REC TB48_RECTYPE; begin select m.CODPO, m.CODCO, m.QUADR, m.ESPEC, m.APERF, m.SUBES, m.DATIN into retorno_REC from TB48_M m where m

Why PLS-00382: expression is of wrong type?

*爱你&永不变心* 提交于 2021-02-08 10:57:17
问题 I have the following custom RECORD TYPE : TYPE TB48_RECTYPE IS RECORD ( codpo varchar2(5 BYTE), codco varchar2(5 BYTE), quadr varchar2(5 BYTE), espec varchar2(5 BYTE), aperf varchar2(5 BYTE), subes varchar2(5 BYTE), datin date); And now a function that returns the exact same type. function retorna_infos_tabela_48(i_nip in varchar2) return TB48_RECTYPE is retorno_REC TB48_RECTYPE; begin select m.CODPO, m.CODCO, m.QUADR, m.ESPEC, m.APERF, m.SUBES, m.DATIN into retorno_REC from TB48_M m where m

Migrating trigger from Oracle 11g to Postgresql 8.4

我是研究僧i 提交于 2021-02-08 09:27:11
问题 My trigger in Oracle looks like this… CREATE OR REPLACE TRIGGER example$example BEFORE UPDATE OR DELETE ON example FOR EACH ROW BEGIN INSERT INTO example$ VALUES ( :old.key, :old.name, :old.describe seq.nextVal ); END; I thought I could simply translate to Postgresql with this… CREATE OR REPLACE TRIGGER example$example BEFORE UPDATE OR DELETE ON example FOR EACH ROW BEGIN INSERT INTO example$ VALUES ( OLD.key, OLD.name, OLD.describe, NEXTVAL('seq') ); END; I'm getting an error at the end of

Oracle SQL Cross Tab Query

左心房为你撑大大i 提交于 2021-02-08 07:28:41
问题 I have a table which has the following structure and sample data: ITEM LOC STOCK 0001 KS5 10 0001 KS6 30 0002 KS5 10 0002 KS6 20 I need to query cross tab so that I get ITEM KS5 KS6 0001 10 30 0002 10 20 The LOC (KS5 and KS6) can vary and new locations can be added. How can I get the desired result? 回答1: For dynamically generated results you need some dynamic PLSQL solution, something like this procedure creating view v_list_loc : create or replace procedure p_list_loc is v_sql varchar2(32000

dbms_scheduler Create Job Not running Job

大兔子大兔子 提交于 2021-02-07 19:55:18
问题 I am trying to run a procedure through a dbms_scheduler but it is just getting created but not running. DataBase Version Used Oracle 11.2.x Procedure create or replace procedure count_comp as Total_count number; begin select count(*) into Total_count from user_tables; dbms_output.put_line('Number '|| Total_count); end; Create Job BEGIN DBMS_SCHEDULER.CREATE_JOB ( job_name => 'My_Count_Job', job_type => 'STORED_PROCEDURE', job_action => 'count_comp', start_date => '28-APR-08 07.00.00 PM Asia

dbms_scheduler Create Job Not running Job

痞子三分冷 提交于 2021-02-07 19:53:12
问题 I am trying to run a procedure through a dbms_scheduler but it is just getting created but not running. DataBase Version Used Oracle 11.2.x Procedure create or replace procedure count_comp as Total_count number; begin select count(*) into Total_count from user_tables; dbms_output.put_line('Number '|| Total_count); end; Create Job BEGIN DBMS_SCHEDULER.CREATE_JOB ( job_name => 'My_Count_Job', job_type => 'STORED_PROCEDURE', job_action => 'count_comp', start_date => '28-APR-08 07.00.00 PM Asia

Are nested parentheses in the FROM clause valid Oracle SQL syntax?

别来无恙 提交于 2021-02-07 14:40:48
问题 Does this query use correct Oracle syntax? select * from ( ( ( dual a) ) ) where a.dummy = 'X'; It works in 11g and 12c but is it truly valid syntax? Or is this is just a compiler "mistake" that might be fixed in the future, causing the code the fail? I doubt this is the correct syntax for the following reasons: It doesn't seem to do anything other than add extra parentheses. Expressions like ((1+2)*3) can obviously benefit from nested parentheses but I don't see how they would ever help the