oracle10g

Replacing varchar2 with bigger data type in oracle SP

主宰稳场 提交于 2019-12-02 07:50:55
问题 I am using oracle verion 10. There is stored procedure in PL/SQL using varchar2 variable. The code is constantly appending the varchar2 variable. When the varchar2 variable size exceeds 32767, it cannot append any more value. Now I want to change the data type to long or clob(in order to accomodate more characters), it does not work. How to modify the code here to have the same appending functionality with clob or long? sample appending x:= x || 'mydata'; 回答1: The long datatype is deprecated;

Cannot Deploy MVC 3 Project with Entity Framework 4.3.1 and Oracle ODAC

喜夏-厌秋 提交于 2019-12-02 07:41:57
I'm currently trying to deploy a MVC 3 application I've been working on to our test web server, and am running into a major problem with loading everything correctly. To try and give as much info about this as possible, I'm doing a bin deploy (I've sent all references to copy locally), and am doing a basic Publish on the web project via file system to the application directory on the server. The components I'm using are: Entity Framework 4.3.1 Oracle ODAC 11.2.0 (version 4.112.3.0) This application has 2 Entity Framework objects, one going to a SQL Server database and the other going to an

How Can I Make Oracle Query Sort Order Dynamic?

六眼飞鱼酱① 提交于 2019-12-02 06:51:44
I have a Oracle procedure inside a package like this PROCEDURE getEmployee ( pinLanguage IN VARCHAR2, pinPage IN NUMBER, pinPageSize IN NUMBER, pinSortColumn IN VARCHAR2, pinSortOrder IN VARCHAR2, poutEmployeeCursor OUT SYS_REFCURSOR ) AS BEGIN OPEN poutEmployeeCursor FOR SELECT * FROM ( SELECT EMPLOYEE_ID, USERNAME, FULL_NAME, DATE_OF_BIRTH, EMP.GENDER_ID, GEN_TR.GENDER, EMP.WORK_TYPE_ID, WT_TR.WORK_TYPE, SALARY, EMAIL, PROFILE_IMAGE, ROW_NUMBER() OVER (ORDER BY EMPLOYEE_ID ASC) RN FROM EMPLOYEES EMP INNER JOIN GENDERS GEN ON EMP.GENDER_ID = GEN.GENDER_ID LEFT JOIN GENDERS_MLD GEN_TR ON GEN

invalid character error while executing immediate

北城以北 提交于 2019-12-02 06:40:16
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 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 sqltext2 := 'insert into error_table_shree select '''||str||''' from dual'; execute immediate sqltext2; end;

Deleting duplicates rows from oracle

故事扮演 提交于 2019-12-02 06:19:23
I am using oracle database.I want to use duplicate rows from a table except one,which means that I want to delete all rows but atleast one row should be there. I have a table employee_id ---- department_id 1 10 2 10 1 20 3 30 2 30 Now i want to delete duplicate rows but at least one row should be there. select count(employee_id),employee_id from employee group by employee_id having count(employee_id) >1)); i had used this to find number of employees that are in more than one department but could not find a way to move further. If i use a delete there it will delete all duplicates,But i want to

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 06:07:47
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 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 = (ADDRESS = (PROTOCOL = TCP)(HOST = **database-server**)(PORT = **database-server-port**))(CONNECT_DATA = (SERVER =

Convert old Oracle outer join syntax (+) to JOIN

假如想象 提交于 2019-12-02 05:56:41
I have a query that was written for Oracle using the old (+) syntax and now I want to convert it to Access SQL. Here is my query: select BOOKCODE.BOOKCODEID,BOOKCODE.BOOKCODENAME from Application_bookcode, BookCode where BOOKCODE.BOOKCODEID (+) = HMISUnitTest.APPLICATION_BOOKCODE.BOOKCODEID and HMISUnitTest.APPLICATION_BOOKCODE.ApplicationId = 7 What is the equivalent in Access SQL? If I remember the old Oracle outer join syntax (and it's been a long time ), the corresponding query in Access should be SELECT BOOKCODE.BOOKCODEID, BOOKCODE.BOOKCODENAME FROM Application_bookcode LEFT JOIN

Replacing varchar2 with bigger data type in oracle SP

匆匆过客 提交于 2019-12-02 05:24:13
I am using oracle verion 10. There is stored procedure in PL/SQL using varchar2 variable. The code is constantly appending the varchar2 variable. When the varchar2 variable size exceeds 32767, it cannot append any more value. Now I want to change the data type to long or clob(in order to accomodate more characters), it does not work. How to modify the code here to have the same appending functionality with clob or long? sample appending x:= x || 'mydata'; The long datatype is deprecated; if you can you should seriously consider migrating your long column to a clob . If you were working with a

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

余生长醉 提交于 2019-12-02 05:10:59
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 (FIELD_ID, CATEGORY_ID, COLUMN_EXPRESSION, DISPLAY_NAME, SORT_ORDER) VALUES (17, 1, 'FOO.NAME', 'Name

ORA-01855: AM/A.M. or PM/P.M. required

跟風遠走 提交于 2019-12-02 05:09:11
问题 I get the error: ORA-01855: AM/A.M. or PM/P.M. required when I try to execute following query. INSERT INTO TBL(ID,START_DATE) values (123, TO_DATE ('3/13/2012 9:22:00 AM', 'MM/DD/YYYY HH:MI AM')) Where my START_DATE column is of type "Date". I have executed following query and it gave no errors, still not success yet in above issue: ALTER SESSION SET NLS_DATE_FORMAT = "MM/DD/YYYY HH:MI AM"; 回答1: Your format mask must match the format of the string you are converting. So you would either want