oracle9i

Convert columns to rows in oracle 9i [duplicate]

最后都变了- 提交于 2019-12-12 06:57:30
问题 This question already has answers here : Oracle SQL pivot query (2 answers) Closed 2 years ago . Please help me to the SQL Oracle 9i , convert columns to rows in group by ID. I can't convert using UNPIVOT in oracle 9i. And I will not use UNION ALL, it's too much code to use later. From this list: Table: Employees ID | DATA 1 | DATA 2 | DATA 3 | DATA 4 | ---------------------------------------------------------- 1 | 0 | 1 | 3 | 2 | 2 | 1 | 0 | 3 | 0 | Result ID | SOURCE | DATA | --------------

Tablespaces in Oracle

守給你的承諾、 提交于 2019-12-12 05:37:55
问题 Is adding tablespaces to a database decrease the performance of an Oracle 9 database? We consider that the number of request remains constant. Thx, Eric 回答1: No, tablespaces allow you to logically separate objects, and adding more makes no difference - you have the same amount of data stored on the same amount of disk. How tables and indexes are organised across tablespaces can make a difference; particularly having indexes in different tablespaces to their tables, though that's really to do

using MERGE in 9i

可紊 提交于 2019-12-12 04:27:41
问题 I want to do something like this in 9i MERGE INTO SAT_DEMANDS D USING (SELECT DISTINCT d1.PRODUCT_ID AS product_id, CA.CUST_ID as allocated_cust FROM CDP_MPS_ALLOCATION CA, sat_demands d1 WHERE substr(d1.product_id,1,instr(d1.product_id,'_VIRTUAL',1)-1) = ca.prod_id(+)) MC ON (D.PRODUCT_ID = MC.product_id AND D.CUSTOMER_ID = MC.allocated_cust) WHEN matched then Update set D.alloc_cust_id_s = CASE WHEN mc.allocated_cust IS NULL THEN 'FREE' ELSE mc.allocated_cust||':'||'FREE' END; Please help!

Use Oracle Cursor in Proc and Return it?

守給你的承諾、 提交于 2019-12-11 12:49:18
问题 I am working on a package that will return two cursors. One cursor is a list of items with a numeric primary key. The other cursor is a list of files associated with the items Code so far: procedure get_items_with_files( o_results out sys_refcursor, o_files out sys_refcursor ) is begin begin open o_results for select item_id, item_name from items; end; begin open o_files for select item_id item_file_name from item_files if where if.item_id in (select item_id from TABLE(CAST(o_results))); end;

Oracle - PLS-00103: Encountered the symbol “END” when try to create JOB

ぐ巨炮叔叔 提交于 2019-12-11 08:39:39
问题 i have a problem here, i already have a Stored Procedure called "SP_DEL_TOKEN" and i wanna make a job to run the Stored procedure automatically everyday.. this is my script to make the job VAR jobno NUMBER; BEGIN DBMS_JOB.SUBMIT(:jobno, 'SP_DEL_TOKEN', SYSDATE, 'SYSDATE+1'); COMMIT; END; / but when i do that script, i encountered with this error ERROR at line 1: ORA-06550: line 1, column 106: PLS-00103: Encountered the symbol "END" when expecting one of the following: := . ( @ % ; The symbol

ORACLE Convert the long millisecond into Date

百般思念 提交于 2019-12-11 06:17:38
问题 I have a Field in ORACLE as CREATED (NUMBER). It stores the time in MILLISECONDS or you can say long format. Now the requirement is to find the data between two dates using the Field CREATED. I have the following below query which is working for where condition, but not for between condition: SELECT date'1970-01-01' + TIMECREATED / 1000 / 60 / 60 / 24 as timet FROM XXX_TABLE WHERE ITBD='829993'; Can someone provide me the SQL to get the data between two dates? 回答1: Playing with Oracle Date

Exception while calling stored procedure :Bigger type length than Maximum

寵の児 提交于 2019-12-11 06:00:12
问题 HI I am getting this exception when I am calling any stored procedure from my J2EE app. Exception while calling stored procedure :Bigger type length than Maximum I am having Oracle 9.1.0.7, JDK1.4 and using ojdbc14.jar running on Weblogic 8.1 Please advise what could be the root cause ? Below is the manifest of my ojdbc14.jar Manifest-Version: 1.0 Implementation-Version: "Oracle JDBC Driver version - 10.1.0.2.0" Specification-Title: "Oracle JDBC driver classes for use with JDK1.4"

Oracle ODP.NET problems calling package procedure with parameters

一世执手 提交于 2019-12-10 17:29:01
问题 Problem: Trying to call a packaged stored procedure, but the call is failing depending on the values of the parameters. ORA-06502: PL/SQL: numeric or value error ORA-06512: at line 1 Procedure Definition: procedure DUP_EXACT ( SSN in VARCHAR2, LASTNAME in VARCHAR2, FIRSTNAME in VARCHAR2, MASTERRECORD IN VARCHAR2 DEFAULT NULL, C_Table out sp_cursor) Parameter Creation: For Each SearchParameter In SearchParameters ValueParameter = New OracleParameter ValueParameter.Direction =

Oracle Event Count Query

◇◆丶佛笑我妖孽 提交于 2019-12-10 11:42:31
问题 My SAMPLE table has the following five columns: sample_id (PK) (NUMBER) sampled_on (DATE) received_on (DATE) completed_on (DATE) authorized_on (DATE) I would like a query with one row per hour (constrained by a given date range) and five columns: The hour YYYY-MM-DD HH24 Number of samples sampled during that hour Number of samples received during that hour Number of samples completed during that hour Number of samples authorized during that hour Please provide a query or at least a point in

Finding the datatype of a cursor or table column in a block

女生的网名这么多〃 提交于 2019-12-10 09:04:07
问题 Is is possible to find out the datatype of a column of a cursor or variable within block without using system tables? While I understand that I can use the system tables to find out this information it would be a lot slower. Something like, declare my_column_data_type varchar2(30); begin my_column_data_type := all_tables.table_name%type; dbms_output.put_line(my_column_data_type); end; I can't find any way of doing it without resorting to dbms_sql , which would be overkill for my eventual