oracle10g

JDBC call to stored procedure which take array as parameter

流过昼夜 提交于 2019-12-02 16:33:06
问题 I am trying call the below procedure using java code but I am getting several errors(basically for type conversion) I thing I have messed up somewhere can somebody take a look at it. This is the first time i am doing it. A little help would be great. proc: DECLARE car__details_tab car__details_tab_type := NEW car__details_tab_type(); car_id number_tab_type; car_error_tab car__error_tab_type := new car__error_tab_type(); car_purchase_id NUMBER; BEGIN car__details_tab.extend; car__details_tab

What is the format of connection string that should be used while using ERWin tool for generating ERD for an Oracle database?

泪湿孤枕 提交于 2019-12-02 14:05:30
问题 I have been trying to generate an ERD for some oracle database. While I am doing this via 'Actions'->'Reverse Engineering' option, I get a section that asks me for a connection string. But I am unsure of the format about how we can specify the database and its details. Could someone please help me with this? Thanks Pradeep 回答1: I am using Erwin 7.3.8 to connect on a Oracle 11g schema. The connection works from me when I use the oracle tnsnames string format: For example: (DESCRIPTION =

How to open direct CSV file using TEXT_IO in oracle forms?

北战南征 提交于 2019-12-02 13:33:05
I applied this code in oracle forms 10g on trigger WHEN-BUTTON-PRESSED. This code only save the file on target location. CODE: PROCEDURE GEN_EXCEL IS IN_FILE TEXT_IO.FILE_TYPE; VC_HEAD Varchar2(32000); vc_file_path Varchar2(50) := 'C:\'; BEGIN IN_FILE := TEXT_IO.FOPEN(vc_file_path||'Test'||'.CSV','W'); TEXT_IO.PUT_LINE(IN_FILE,'YOUR_TITLE'||chr(10)); VC_HEAD := 'header1,header2,header3,header4'; TEXT_IO.PUT_LINE(IN_FILE,VC_HEAD); FOR C1 IN ( SELECT column1, column2, column3, column4 FROM Table_name) LOOP TEXT_IO.PUT_LINE(IN_FILE,C1.col1||','||C1.col2||','||C1.col3||','||C1.col4); END LOOP;

ORA 00918- Column ambiguosly defined error [duplicate]

£可爱£侵袭症+ 提交于 2019-12-02 13:12:41
This question already has an answer here: ORA-00918: column ambiguously defined in SELECT * 3 answers There are two tables in my Oracle database. First table is (customers)- customer_id Customer_name Customer_age Customer_address salary 103 Giriraj Rathi 22 Kolkata 12000 100 Subir Adhikari 22 Bolpur 10000 101 Rakesh Chatterjee 21 Tarkeshwar 8000 102 Jayanta Patra 20 Tarkeshwar 9000 104 Abhi Karmakar 22 Burdwan 8000 105 Mainak Manna 21 Burdwan 9000 106 Subho Gupta 20 Kolkata 10000 107 Aritra Das 23 Kolkata 7000 108 Pradip Paul 22 Kolkata 5000 109 Sourav Banerjee 22 Bolpur 9000 Second table is

invalid character error while executing immediate

三世轮回 提交于 2019-12-02 13:08:47
问题 BEGIN exception when others then sqltext2:='insert into ERROR_TABLE_SHREE select '||str||' from dual;'; EXECUTE IMMEDIATE sqltext2; end; COMMIT; I am getting the below error within Exception block ORA-00911: invalid character 回答1: You don't have a string there (I assume str is declared as a character of some description). If you wanted to insert a string you need extra quotes otherwise it'll be interpreted as a column in this instance. Something like: begin ... exception when others then

Why do C-style comments make insert statement run twice?

南楼画角 提交于 2019-12-02 12:43:46
问题 To make a long story short, I started getting ORA-00001 primary key violations and I tracked down the issue to the fact that some of my INSERT INTO statements were running twice. I then discovered that the offending commands had a C-style comment afterwards: WHENEVER SQLERROR EXIT FAILURE SET ECHO OFF SET HEADING OFF SET PAGESIZE 0 SET FEEDBACK OFF SET TIMING OFF SET TIME OFF SET TRIMSPOOL ON SET TRIMOUT ON SET LINESIZE 120 SET SQLBLANKLINES ON SET SERVEROUTPUT ON [...] INSERT INTO INF_FIELD

SQL to get distinct record for a combination of two column (Irrespective of order)

廉价感情. 提交于 2019-12-02 11:53:24
Consider the below Table structure and data CREATE TABLE Distance( source VARCHAR(20), destination VARCHAR(20), distance INTEGER ); Select * from Distance; source destination distance ======= =========== ====== Chennai Mumbai 500 Mumbai Chennai 500 Mumbai Bangalore 500 Bangalore Mumbai 500 Goa Mumbai 100 Mumbai Goa 100 Kolkata Goa 1000 I need the output to have single record for 2 cities if repeating, i,e, any one record among the below 2 is fine. Chennai Mumbai 500 Mumbai Chennai 500 Expected o/p: source destination distance ======= =========== ====== Chennai Mumbai 500 Mumbai Bangalore 500

Is there a way to add column at a specified position in Oracle table? [duplicate]

一世执手 提交于 2019-12-02 11:47:56
This question already has an answer here: How to insert a column in a specific position in oracle without dropping and recreating the table? 4 answers Consider this inital table I have created in Oracle 10G: ╔═════════════════════════════════╗ ║ CUSTOMER_ID ACC_NO ACC_BALANCE ║ ╠═════════════════════════════════╣ ║ 100 200 1000 ║ ║ 101 150 4000 ║ ║ 102 350 2000 ║ ║ 103 450 2500 ║ ║ 104 550 2200 ║ ╚═════════════════════════════════╝ Now I want to add another column customer_name into the table. I used: ALTER TABLE BANK_ACCOUNT ADD (CUSTOMER_NAME VARCHAR2(30)); and the column is being inserted

Special characters in Oracle NCLOB

北慕城南 提交于 2019-12-02 11:29:56
问题 I'm dealing with an Oracle 10g database and the following stored procedure is provided: procedure get_synopsis ( p_id in my_schema.products.p_id%type, p_synopses out sys_refcursor); -- cursor of - synopsis_type, synopsis_text In my Java code I prepare the statement in this way: String idForDb = fromIdUrlToIdDb(prodIdUrl); statement.registerOutParameter(1, OracleTypes.VARCHAR); statement.setString(1, idForDb ); statement.registerOutParameter(2, OracleTypes.CURSOR); And I get the data I need in

Need to trim blank space in oracle

谁说胖子不能爱 提交于 2019-12-02 11:04:28
Unable to trim blank space in below data in my table. column data type is VARCHAR2(650 CHAR). I tried trim function to eliminate blank space. but that is not working for me. DATA in my table: 'xxxxxxxxxx yyyyyyyyy - 12/7/14 - 12/13/14 ' 'xxxxxxxxxx yyyyyyyyy - 12/7/14 - 12/13/14 ' 'xxxxxxxxxx yyyyyyyyy - 12/7/14 - 12/13/14 ' I want trim the data like below 'xxxxxxxxxx yyyyyyyyy - 12/7/14 - 12/13/14' 'xxxxxxxxxx yyyyyyyyy - 12/7/14 - 12/13/14' 'xxxxxxxxxx yyyyyyyyy - 12/7/14 - 12/13/14' Could you please help me on this. Use Trim Function select Trim(trailing ' ' from 'xxxxxxxxxx yyyyyyyyy - 12