oracle10g

CASE expressions with MAX aggregate functions Oracle

倖福魔咒の 提交于 2019-12-13 02:24:09
问题 Using Oracle, I have selected the title_id with its the associated month of publication with: SELECT title_id, CASE EXTRACT(month FROM pubdate) WHEN 1 THEN 'Jan' WHEN 2 THEN 'Feb' WHEN 3 THEN 'Mar' WHEN 4 THEN 'Apr' WHEN 5 THEN 'May' WHEN 6 THEN 'Jun' WHEN 7 THEN 'Jul' WHEN 8 THEN 'Aug' WHEN 9 THEN 'Sep' WHEN 10 THEN 'Oct' WHEN 11 THEN 'Nov' ELSE 'Dec' END MONTH FROM TITLES; Using the statement: SELECT MAX(Most_Titles) FROM (SELECT count(title_id) Most_Titles, month FROM (SELECT title_id,

Count the number of rows in many to many relationships in Hibernate

对着背影说爱祢 提交于 2019-12-13 01:08:22
问题 I have three of many tables in Oracle (10g) database as listed below. I'm using Hibernate Tools 3.2.1.GA with Spring version 3.0.2. Product - parent table Colour - parent table ProductColour - join table - references colourId and prodId of Colour and Product tables respectively Where the ProductColour is a join table between Product and Colour . As the table names imply, there is a many-to-many relationship between Product and ProductColour . I think, the relationship in the database can

How to get maximum for a field based on a date and get other fields also?

家住魔仙堡 提交于 2019-12-13 01:03:00
问题 I know my question is bit confusing but if I show you data it will make more sense what I am trying to achieve. I am reading everything from one table T only. I am reading 6 fields from that table T. StartKey Name Min LName MName ID Top Table is data, and bottom table is what I am trying to achieve. I need to get for each startkey get max(minutes) FORGOT TO INCLUDE 20130221 in output. Here is what I tried so far select startkey, name, min, lname, mname, id from T where startkey >= '20130118'

Not able to connect Oracle 10g XE to Eclipse [duplicate]

痞子三分冷 提交于 2019-12-13 00:37:19
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Eclipse cannot connect oracle 10g XE on windows 7 I am getting this error when i try to test the connection.. java.sql.SQLException: Io exception: The Network Adapter could not establish the connection" What to do now? I have downloaded the ojdbc14.jar from site also but still i am getting this error. 回答1: Do this Steps as below Check First with Sql plus : SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 29

ORA-02070: database does not support in this context

南楼画角 提交于 2019-12-13 00:28:16
问题 I'm trying to insert data from a VIEW in one DB to a table in another DB. insert into schema.dummy_table@LINK SELECT v1.coulmn1, v1.cloumn2, v1.clolumn5, v1.cloumn7, v1.column3 FROM user.view1 v1, user.view2 v2 WHERE v1.column8 = v2.column1; But this doesn't seem to work. I get ORA-02070: database does not support in this context Does that mean, this is not permitted on views? 回答1: Based on names of the columns I guess that user.view1 or user.view2 selects data from one of system views like v

Microsoft.NET and Oracle data access: Conversion from type OracleDecimal to type String is not valid

青春壹個敷衍的年華 提交于 2019-12-13 00:11:30
问题 I have the following ASP.NET program, which calls an Oracle stored procedure: Dim objDBCon As New OracleConnection(strCon) Try objDBCon.Open() Dim objDBCmd As New OracleCommand("Person.DeletePerson", objDBCon) objDBCmd.CommandType = CommandType.StoredProcedure Dim objParam As New OracleParameter objParam.ParameterName = "PersonID" objParam.OracleDbType = OracleDbType.Varchar2 objParam.Direction = ParameterDirection.Input objParam.Value = PersonID objDBCmd.Parameters.Add(objParam) objParam =

Java Class for retrieving Large String from Oracle_db of LOB dataType

夙愿已清 提交于 2019-12-12 19:46:13
问题 At my new/first job We have an oracle database with one of its fields set to LOB(large objects) data type. When I run a select statement , I get this issue, which gives me an error as following. ERROR: ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 10228, maximum: 4000) This size of the string(which are logs) inside each tuble is 10228 more than the Max capacity of the buffer . Now my boss has asked me to write a java class that will make us able to retrieve

Materialized view with trigger?

女生的网名这么多〃 提交于 2019-12-12 19:16:05
问题 Can i create trigger on materialized view? I'm using oracle 10g. 回答1: Yes, you can. Just be careful. This is what Oracle documentation says: If you create a trigger on a base table of a materialized view, then you must ensure that the trigger does not fire during a refresh of the materialized view. During refresh, the DBMS_MVIEW procedure I_AM_A_REFRESH returns TRUE. 来源: https://stackoverflow.com/questions/5037139/materialized-view-with-trigger

how to trigger when multiple columns are updated

允我心安 提交于 2019-12-12 19:15:31
问题 here I want to trigger the update query if any one of the columns are updated. But I am getting error table table is mutating, trigger/function may not see it. create or replace TRIGGER TRIGGER1 AFTER UPDATE OF HOST_ID,ENABLED_FLAG,ACTIVE_FLAG,AGENT_COUNTER,USER_WAIT_FLAG ON MONITOR_AGENT_STATUS FOR EACH ROW BEGIN update monitor_agent_status set active_flag='Y', enabled_flag='Y', agent_counter=0, user_flag='N'; END; 回答1: You should set the values like this in a BEFORE row trigger: create or

oci8, php7 and Oracle 10.1 compatibility

风格不统一 提交于 2019-12-12 19:15:26
问题 I have to upgrade a system from php5.6 to php7.2 . The system uses an oracle 10.1 database. Now I tried to collect all infos but am still confused about the compatibility between php , oci8 , instant client and the database. I read, that with php7 I have to at least install oci8 2.1 , but this doesn't work with oracle 10.1 . Is that correct? Or is it possible to run php7 with oracle 10.1 ? Please enlighten me :) 回答1: I read, that with php7 I have to at least install oci8 2.1, but this doesn't