plsqldeveloper

Oracle UTL_HTTP POST encoding multipart/form-data

丶灬走出姿态 提交于 2019-12-11 03:16:07
问题 I would like to do a POST from PL/SQL, using as enctype "Multipart/form-data" in order to post a document contained in a LONG RAW to a servlet. This would simulate a typical "FILE UPLOAD" as if done by a browser. I was wondering if there is any example on how to do it.. I think something like that could work .. but a working example would be very much appreciated document long raw; env VARCHAR2(32767); mytable record of varchar2(32767); http_req utl_http.req; BEGIN http_req:=utl_http.begin

Getting First Occurred value from the XML using oracle parser

久未见 提交于 2019-12-10 16:28:14
问题 I am not expert of Oracle, but as per requirements I am using Oracle Parser for Parsing Xml. For listed below xml i.e. <?xml version="1.0" encoding="iso-8859-1" ?> <SearchOutput> <rowArray> <Row> <cellArray> <Cell> <columnId>1</columnId> <valueArray> <Value> <value>IR000024575453</value> </Value> </valueArray> </Cell> <Cell> <columnId>5</columnId> <valueArray> <Value> <value>AZ12604823-001</value> </Value> </valueArray> </Cell> <Cell> <columnId>2</columnId> <valueArray> <Value> <value>IT06686

display resultset from oracle 10g stored procedure

一笑奈何 提交于 2019-12-10 10:38:27
问题 I am using PL/SQL Developer and i have written a procedure to run a report and i need to procedure to output the resultset. The procedure accepts input parameters and needs to output the resultset. I cannot use a view because the procedure calls several APIs which accept the parameters i am passing into the procedure. I understand from alot of searching that it's possible using ref_cursor but i cannot get ti to work. A simplified version of the procedure is: CREATE OR REPLACE PROCEDURE

How to create cursor inside procedure body in plsql

独自空忆成欢 提交于 2019-12-10 07:33:07
问题 I want create cursor inside procedure body dynamically also i have to use for loop instead of below code. i did the dynamic cursor but i cannot use the for loop. PROCEDURE myprocedure AS LV_TEST_CUR SYS_REFCURSOR; LV_QUERY VARCHAR2(200); LV_DATE DATE; BEGIN LV_QUERY:='select sysdate as mydate from dual'; OPEN LV_TEST_CUR FOR LV_QUERY; /*FOR CUR_VAR IN LV_TEST_CUR LOOP dbms_output.put_line(CUR_VAR.mydate); end LOOP; */ LOOP FETCH LV_TEST_CUR INTO LV_DATE; EXIT WHEN LV_TEST_CUR%NOTFOUND; DBMS

How to use Oracle global temporary table?

吃可爱长大的小学妹 提交于 2019-12-09 00:44:02
问题 I am attempting to use an Oracle global temporary table without physically creating a table in the database. The following code is not working. Can someone please explain the proper way to use global temporary tables? declare global temporary table my_temp_table(column1 number) on commit preserve rows; begin insert into my_temp_table (column1) values (1); select * from my_temp_table; end; 回答1: Try the below using execute immediate: it uses exception handler to bypass if table already exists;

ORA-12170 TNS listener in oracle 11g

☆樱花仙子☆ 提交于 2019-12-08 12:56:06
问题 I have setup a Windows Server 2008R2 with an oracle server 11g (11.2) and a small database (MYDB) in amazon EC2. Now I want to connect from my computer to this database (I use PL/SQL developer but I don't mind using other tools) In server side I have: (where ec2-xx-xxx-xxx-xx.us-west-2.compute.amazonaws.com is the public DNS for my Win server.) tnsnames.ora: MYDB = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = ec2-xx-xxx-xxx-xx.us-west-2.compute.amazonaws.com)(PORT = 1521)) (CONNECT_DATA

Get only top row from SQL Query

我的梦境 提交于 2019-12-08 09:45:37
问题 Hello I'm having trouble with getting the Top 1 row using the below query. its in oracle, plsql. SELECT per.person_no, perbus.person_no, perbus.edit_dt, perbus.org_name, perbus.FIRST_NAME FROM users.persons per LEFT OUTER JOIN ( SELECT ASSOC.edit_dt,PER_CONTACTS.PERSON_NO, PER_CONTACTS.PERSON_ID AS PER_ID, PER.EXTERNAL_PERSON_ID AS EXT_PER_ID, PER_CONTACTS.LNAME||', '||PER_CONTACTS.FNAME AS NAME, PER_CONTACTS.FNAME AS FIRST_NAME, PER_CONTACTS.MNAME AS MIDDLE_NAME, PER_CONTACTS.LNAME AS LAST

Oracle: Paramterized Query with IN clause return null value

血红的双手。 提交于 2019-12-08 03:17:28
问题 The Paramterized Query with IN clause is not working; it not able to replace the value PROCEDURE p_getdata(A IN LONG,B IN LONG,C IN LONG, cur OUT c_data) AS l_query LONG; BEGIN IF C IS NULL THEN open cur for 'select firstname, lastname, streetname, city from mytable where zip IN(:A) AND streetnumber IN(:B) AND apt_num in(:C)' using A, B,C; END IF; END; here a ='202020'; b='12','13','10','92','02','02' c='A','B' In Db all datatype is varchar2. How to make it run and store the value is cursor?

Running a PL/SQL procedure in a Perl script

隐身守侯 提交于 2019-12-06 09:24:22
I have a Perl script which takes a file as input and has PL/SQL (for statements and DBMS_OUTPUT.PUT_LINE ) in it. I need to run make a database connection and run that file in Perl script.The pl/sql has Begin declare end section,with for statements on it which is writing data of 3 columns separated using commas(DBMS_OUTPUT.PUT_LINE) I have shown what I have tried below. Is it correct? my $dbh = DBI->connect( "dbi:Oracle:$db", $username, $passwd ) || die( $DBI::errstr . "\n" ); $dbh->{AutoCommit} = 0; $dbh->{PrintError} = 1; open FILE, $sql_file or die "Could not open file"; $query = ''; while(

Invoking a function call in a string in an Oracle Procedure

醉酒当歌 提交于 2019-12-06 07:53:42
I writing an application using Oracle 10g. I am currently facing this problem. I take in "filename" as parameter of type varchar2. A sample value that filename may contain is: 'TEST || to_char(sysdate, 'DDD')'. In the procedure, I want to get the value of this file name as in TEST147. When i write: select filename into ffilename from dual; I get the value ffilename = TEST || to_char(sysdate, 'DDD') whick makes sense. But how can I get around this issue and invoke the function in the string value? Help appreciated. Thanks. It's easy enough to dynamically execute a string ... create or replace