oracle10g

how to access an Oracle procedure's OUT parameter when calling it?

走远了吗. 提交于 2019-12-24 11:22:15
问题 If I write a simple function doSomething , I can get its result by executing : select doSomething() from dual; But, if I wish to call a procedure that has an OUT cursor being passed to it (along with another int parameter), how do I call that procedure inside a query and access the result of the cursor ? Calling it inside a query is not compulsory.. its just that I want to access the results of that procedure 回答1: You can create a procedure like CREATE OR REPLACE PROCEDURE your_procedure(out

insert .jpeg files to Oracle

狂风中的少年 提交于 2019-12-24 11:19:10
问题 hi I inserted into oracle database image file on delphi7 with OpenPictureDialog1. All files are .bmp I want to insert .jpeg(.jpg) files. How can I insert this? Thanks in advance. 回答1: Add jpeg to the uses clause. uses jpeg; 回答2: convert bmp to jpg function BMPtoJPG (var BMPpic, JPGpic: string):boolean; var Bitmap: TBitmap; JpegImg: TJpegImage; begin Result:=False; Bitmap := TBitmap.Create; try Bitmap.LoadFromFile(BMPpic) ; JpegImg := TJpegImage.Create; try JpegImg.Assign(Bitmap) ; JpegImg

Using ouput parameter of type SYS_refcursor

喜你入骨 提交于 2019-12-24 11:13:34
问题 In my database I have a stored procedure with an OUTPUT parameter of type SYS_REFCURSOR. The application side is wrtitten in C#. Can I assign this procedure's output parameter to a Datatable like: ............. OracleConnection con=new OracleConnection(......); OracleCommand cmd=new OracleCommand("MyStoredProc",con); cmd.CommandType=CommandType.StoredProcedure; cmd.Parameters.Add("REC_CUR",OracleType.Cursor).Direction=ParameterDirection.Output; con.Open(); cmd.ExecuteNonQuery(); DataTable dt=

How to refresh materialized view using trigger?

不羁的心 提交于 2019-12-24 11:13:03
问题 create or replace TRIGGER REFRESH_REST_VIEW AFTER INSERT OR UPDATE ON tbl_contract BEGIN execute DBMS_MVIEW.REFRESH('REST_VIEW'); END REFRESH_REST_VIEW; commit; This is my sql trigger i am using to refresh Materialized View. But it says.. Warning: execution completed with warning TRIGGER REFRESH_REST_VIEW Compiled. P.S. : The trigger will be executed when the data of table (used by Materialized View) takes any DML operation. I have googled enough, many post says it is possible but I am not

Add comma-separated value of grouped rows to existing query

大兔子大兔子 提交于 2019-12-24 10:54:02
问题 I've got a view for reports, that looks something like this: SELECT a.id, a.value1, a.value2, b.value1, /* (+50 more such columns)*/ FROM a JOIN b ON (b.id = a.b_id) JOIN c ON (c.id = b.c_id) LEFT JOIN d ON (d.id = b.d_id) LEFT JOIN e ON (e.id = d.e_id) /* (+10 more inner/left joins) */ It joins quite a few tables and returns lots of columns, but indexes are in place and performance is fine. Now I want to add another column to the result, showing comma-separated values ordered by value from

C#/Oracle: Connect

回眸只為那壹抹淺笑 提交于 2019-12-24 09:43:44
问题 i've been trying to find out how to connect a c# program with an oracle 10g db. all code examples i found always used either ado.net oracleclient of .net-framework (which is deprecated -> not good), or system.data.ado, which apparently uses a data source (odbc) -> not allowed to use, or the oracle developer tools odt (like odbc?), which support olny visual studio 2005 for 10g and only 11g for vs 2010... is there any way to connect, like it is possible with delphi (devart, odac), which ive

Alternative to dbms_output.putline

送分小仙女□ 提交于 2019-12-24 07:47:00
问题 I am creating a dynamic query in a procedure and now want to see it through dbms_output.putline , but my query contains more than 255 characters. How to view the query? What are the alternates of dbms_output.putline ? 回答1: There's a little bit of confusion going on. In Oracle 9i dbms_output.put_line is limited to 255 characters. This restriction was removed in 10g and is similarly not present in Oracle 11g. You have tagged your question oracle10g, which means that you're limited to 32,767

Exracting substring from given string

妖精的绣舞 提交于 2019-12-24 07:17:05
问题 I have data as following 1)MAXO_INSTR_INTERFACE 2)MAXIS_VENDOR_INTERFACE 3)MAXIMOS_EMPS_INTERFACE2 I need to extract String which is located between both underscores in PL/SQL as INPUT EXPECTED OUTPUT ------------------------ --------------- MAXO_INSTR_INTERFACE INSTR MAXIS_VENDOR_INTERFACE VENDOR MAXIMOS_EMPS_INTERFACE2 EMPS I have tried with substring function but i am unable to perform accurately. 回答1: A slightly easier regular expression: SQL> with t as 2 ( select 'maxo_instr_interface'

Stored Procedure with multiple IN Parameter

血红的双手。 提交于 2019-12-24 05:07:20
问题 I got the following Procedure: create or replace PROCEDURE create_indexes (tbl_name_index IN VARCHAR2, tbl_name_vehicle IN VARCHAR2, tbl_name_dealer IN VARCHAR2, tbl_name_hst IN VARCHAR2, tbl_name_dms IN VARCHAR2, tbl_name_usertype IN VARCHAR2, tbl_name_search IN VARCHAR2) as COUNT_INDEXES INTEGER; BEGIN SELECT COUNT(*) INTO COUNT_INDEXES FROM USER_INDEXES WHERE table_name = tbl_name_index and index_name not like '%UNIQUE%'; IF COUNT_INDEXES <= 0 THEN EXECUTE IMMEDIATE 'COMMAND'; end If; end;

ORA-01843: not a valid month

南楼画角 提交于 2019-12-24 03:49:35
问题 I am having an issue with my sql query. create table rental ( rental_id NUMBER(5) NOT NULL, rental_date timestamp NOT NULL, inventory_id NUMBER(5) NOT NULL, customer_id NUMBER(5) NOT NULL, return_date timestamp NOT NULL, staff_id NUMBER(5) NOT NULL, constraint rental_primary PRIMARY KEY (rental_id), constraint rental_foreign FOREIGN KEY (inventory_id) REFERENCES inventory(inventory_id), constraint rental_foreign2 FOREIGN KEY (customer_id) REFERENCES customer(customer_id), constraint rental