How to encode URL in UTF-8 Using PL/SQL
Hello,
Platform:Oracle 9i, Sun Solaris,
Using Oracle 0i XML/XDK Iam able to generate xml data and post it to url via HTTP POST. But the xml data need to be encoded in utf-8. Does anyone know how to encode the xml data within PL/sql ?
Thanks for your time
Seema
Thanks for the suggestion. I like this approach as Java is more familiar to me than other languages.
Our DBA is out of touch today, so I could not grant the javauserpriv to my database user. I tried to run the script anyway in the chance that my user had the privs, and it seemed to have hung. I am now combing Oracle's site for more documentation so I can write some tests to see if I can get a basic Java object working. Under what heading would I find this?
ajt
Similar Messages
-
How to encode URL parameters in pl/sql?
How to encode url and its paramters in PL/SQL to call a page using html GET method? Is there any equiavlent method of java's URLEncoder.encode() method in pl/sql (in any web packages) ?
Any help/pointers highly appreciated.
P.S. : URGENT PLEASE!!!http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:371959198986
-
How to upload files from a form using pl/sql ?
Hi
Is it possible to upload the physical files outside the database (under UNIX server)using pl/sql? I already know how to store the files inside the database(wwwdoc_documents$) but I didn't find any documentation about storing the physical files outside the database.
I have in my form the following component:
<input type="file" name="upload">
and I want to let the user browse for the file on his/her disc that he want to use. What I want to do next is to save a copy of that file on our file-server, and then use it in my application. How do I do that in pl/sql?
Any help will be appreciated.
Sebas.Thanks for the suggestion. I like this approach as Java is more familiar to me than other languages.
Our DBA is out of touch today, so I could not grant the javauserpriv to my database user. I tried to run the script anyway in the chance that my user had the privs, and it seemed to have hung. I am now combing Oracle's site for more documentation so I can write some tests to see if I can get a basic Java object working. Under what heading would I find this?
ajt -
How to update flag in multiple tables using custom sql DB adapter
hi all,
I have a scenario: I want to update flags in multiple tables in DB2. I have used toplink update only to update all tabless after creating relationships between them. But that approach is not working as it couldnot detect emmisions with DB2 and update the complete record with blank values in other columns.
So, i want to use custom sql now. Can anybody help in resolving the issue or in writing the custom sql.
Regards
RichaDear SeánMacGC thanks for reply,
But "a.changed" is not a field in GNMT_CUSTOMER_MASTER_CHG. what i am doing in this procedure is i am collecting bulck data and validating field by field from GNMT_CUSTOMER_MASTER_CHG with GNMT_CUSTOMER_MASTER table as their structure is same.. if v_name is not same as v_name_chg then i am setting changed flag to "Y" changed is "changed dbms_sql.varchar2_table" and updating GNMT_CUSTOMER_MASTER in bluck where changed flag ='Y'...
type custRec is record
n_cust_ref_no dbms_sql.number_table,
v_name dbms_sql.varchar2_table,
v_name_chg dbms_sql.varchar2_table,
rowid rowidArray,
*changed dbms_sql.varchar2_table*
i cannot use simple SQL as i need to validate field for each records with GNMT_CUSTOMER_MASTER_CHG and insert into log file as well.....
to run this procedure:
execute DO_DC_NAME_UPDATE_OTHER_TAB.DO_NAME_UPDATE_OTHER_TAB;
Thanks... -
Hi ,
My JDeveloper version is 11.1.1.6.0.
I get the following url string from the iframe.
url/*C14C5CCC2C1C3C%2528CC2%2529CC8C7C3C6C4C%2528CC5%2529CC%252510C6C9C7C%2528CC8%2529CCC9CC%252510*.gif
I want extract the text in the format as below .How can I decode it.
*C3(C1CC1)CCC(C2CC2)[C+]456C3(C)C4C5C6*
Any help is appreciated.Use URLDecoder in your backing bean
URLDecoder.decode( url, "UTF-8" );Or, decodeURI(string) in javascript. Read more here http://www.w3schools.com/jsref/jsref_decodeuri.asp -
How to add URLs in apage without using edit mode
Hello everybody.
We have Portal 9.0.4.1 under Solaris, and we are just beggining using it :-)
We created a section for links (to urls) in the home page of each user. We would like our users to add links to their most used pages (for example, metalink.oracle.com), but we do not want them to enter in edit mode, we would like some functionallity like the "add portlet" in the customize option.
Any help will be very apreciated.
Thanks in advance.
LisandroThe example is generic and not hardcoded to any region on the page ... but has the same "warning" that Mark mentioned about this example not working in future versions if Oracle changes the URL structure:
The Add Item example shows how to create a new item type ...adding an item of this type to any region allows you to add content to that region
The Edit Item example show how to show a edit link or icon next to the item in view mode.
Add Item
++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This code sample shows how to create an item allows the content contributor to add items to the page group/page/region that the sample item is placed in.
If you want your content contributor to add items to multiple regions on a page, add the sample item to all regions that you wish to expose this functionality in.
Step 1: Create a PL/SQL procedure
Create the following procedure:
Create or Replace Procedure <schema>.ADDITEM_URL
p_itemid IN VARCHAR2,
p_pageid IN VARCHAR2,
p_siteid IN VARCHAR2)
as
v_url varchar2(2000);
v_region varchar2(2000);
v_looplink varchar2(2000);
v_host varchar2(2000);
begin
select folder_region_id into v_region
from portal.wwsbr_all_items
where id = p_itemid and
caid = p_siteid;
if instr(portal.wwctx_api.get_host, ':') = 0 then
v_host := portal.wwctx_api.get_host;
else
v_host := substr(portal.wwctx_api.get_host,
1,
(instr(portal.wwctx_api.get_host, ':')-1))
|| '%3A'
|| substr(portal.wwctx_api.get_host,
(instr(portal.wwctx_api.get_host, ':')+1));
end if;
v_looplink := 'http%3A%2F%2F'
|| v_host
|| '%2Fportal%2Fpage%3F_pageid%3D'
|| p_siteid
|| '%2C'
|| p_pageid
|| '%26_dad%3D'
|| portal.wwctx_api.get_dad_name
|| '%26_schema%3D'
|| portal.wwctx_api.get_product_schema
|| '&p_containerpageid='
|| p_pageid;
v_url := portal.wwctx_api.get_base_url
|| 'portal.wwv_additem.selectitemtype?'
|| 'p_cornerid=' || p_pageid
|| '&p_siteid=' || p_siteid
|| '&p_regionid=' || v_region
|| '&p_looplink=' || v_looplink;
htp.p('<a href="' || v_url || "><img src="/images/additem.gif"</a>');
exception
when others then
htp.p('error');
end;
Once the procedure has been created, grant EXECUTE permission to PUBLIC.
Step 2: Create a custom item type
This custom item type will be associated with the PL/SQL procedure created above. Placing an item of this type on a page will give the content contributor something to click on while the page is in view mode to call the add item wizard.
Go to the Procedures tab of the new item type and associate with PL/SQL procedure.
Ensure the âDisplay Procedure Results With Itemâ checkbox is checked.
Step 3: Add item of type âAdd_Itemâ to a page.
1. Configure the Page Group to allow items of your new type to be added
2. Add an item of type âadd_itemâ to your page.
3. For the region containing your new item, in the properties, ensure the âAssociated Functionsâ attribute is in the Displayed Attributes list.
Edit Item
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This code sample draws an Edit icon for content contributors to click on while the page is in view mode to edit the item with the default Edit Item wizard.
Step 1: Create a PL/SQL procedure
Create or Replace Procedure <schema>.EDITITEM_URL
p_itemid IN VARCHAR2,
p_pageid IN VARCHAR2,
p_siteid IN VARCHAR2)
as
v_looplink varchar2(2000);
v_url varchar2(2000);
v_subtype varchar2(2000);
v_itemtype varchar2(2000);
v_catid varchar2(2000);
v_catcaid varchar2(2000);
v_parentid varchar2(2000);
v_host varchar2(2000);
begin
select subtype
,itemtype
,category_id
,category_caid
,parent_item_id
into v_subtype
,v_itemtype
,v_catid
,v_catcaid
,v_parentid
from portal.wwsbr_all_items
where id = p_itemid and
caid = p_siteid;
if instr(portal.wwctx_api.get_host, ':') = 0 then
v_host := portal.wwctx_api.get_host;
else
v_host := substr(portal.wwctx_api.get_host,
1,
(instr(portal.wwctx_api.get_host, ':')-1))
|| '%3A'
|| substr(portal.wwctx_api.get_host,
(instr(portal.wwctx_api.get_host, ':')+1));
end if;
v_looplink := 'http%3A%2F%2F'
|| v_host
|| '%2Fportal%2Fpage%3F_pageid%3D'
|| p_siteid
|| '%2C'
|| p_pageid
|| '%26_dad%3D'
|| portal.wwctx_api.get_dad_name
|| '%26_schema%3D'
|| portal.wwctx_api.get_product_schema
|| '&p_containerpageid='
|| p_pageid;
v_url := portal.wwctx_api.get_base_url
|| 'portal.wwv_edit_tab.edititem?'
|| 'p_thingid=' || p_itemid
|| '&p_cornerid=' || p_pageid
|| '&p_siteid=' || p_siteid
|| '&p_subtype=' || v_subtype
|| '&p_itemtype=' || v_itemtype
|| '&p_topicid=' || v_catid
|| '&p_topicsiteid=' || v_catcaid
|| '&p_cornerlinkid='
|| '&p_parentid=' || v_parentid
|| '&p_action=update'
|| '&p_currcornerid=' || p_pageid
|| '&p_language='
|| portal.wwctx_api.get_nls_language
|| '&p_looplink=' || v_looplink;
htp.p('<a href="' || v_url || "><img src="/images/ed-item.gif"</a>');
exception
when others then
null;
end;
Step 2: Associate Procedure with Item Types
For every item type that you wish to supply an edit icon to show while the page is in view mode, call the EDITITEM_URL procedure created in the step above.
Step 3: Show Associated Function attribute
In order for the procedure associated with the item type to execute, you must ensure the region properties are set on the Style/Attributes tab have the Associated Function listed as one of the Displayed Attributes. -
How to open url in acrobat reader using command line
Hi,
I need to open file from url using command line, but I'm still getting some error (wrong filename).
I've tried for example this command:
AcroRd32.exe http://www.adobe.com/devnet/acrobat/pdfs/pdf_open_parameters.pdf
Can anyone help me and tell me what's wrong?You can't use a URL as parameter for AcroRd32.exe.
-
How to encode URL for HttpSend activity?
Hi.
It looks like the below methods cannot be used in the SharePoint Workflow:
HttpUtility.UrlEncode
Uri.EscapeUriString
WebUtility.UrlEncode
Then how?http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:371959198986
-
How to create/delete files from filesystem using PL/SQL ? UTL_FILE?
Greetings,
I will start by explaining what i intend to do.
I have an application made in APEX. This application will have among other purposes the managment of pdf files which will reside in the filesystem.
I have questioned the person in charge to keep the pdf files in the database and not in the filesystem but without success.
So the pdf files reside in the filesystem and there is a record in a database table about them. A table keeps all info about the pdf, their location , size and name, creation date etc.
The APEX application will have a mecanism to allow the deletion of the pdf files if an administrator decides.
So it should be possible for an administrator to schedule the deletion of all pdf files whoe creation date is older than 2008 for example
So, how can i achieve that?
After some research i foudn about the UTL_FILE package which seems to have it takes to perform the task in issue.
My idea was to have a script in the operating system which runs nightly and reads a file containing all file names of the pdf to be erased.
The file which contains the names of the pdfs to be erased will be generated by the database a few minutes before.
If there are no pds files to be erased than the file containing the names will simply be empty
Are there any other viable solutions out there?
And as for opening/creating the file withn the pdf names, i use:
UTL_FILE.FOPEN (
location IN VARCHAR2,
filename IN VARCHAR2,
open_mode IN VARCHAR2,
max_linesize IN BINARY_INTEGER)
RETURN file_type;
And as for writing lines (a pdf name per line ), i use;
UTL_FILE.PUT_LINE (
file IN FILE_TYPE,
buffer IN VARCHAR2,
autoflush IN BOOLEAN DEFAULT FALSE);
is there a better solution?
thanks all.
-> My Homepage <-
Edited by: Igor Carrasco on Apr 14, 2009 3:11 PM
Edited by: Igor Carrasco on Apr 14, 2009 3:12 PMGreetings,
I have read that link above, some questions still though.
I will provide some more information.
-First the database is in a windows server.
The windows server has a virtual drive mounted as z:\ <-- this points to a directory in virtual machine, i can manually access/create/delete files manually,i tested.
-Second utl_file_dir is defined as * , in t that enough to cover mounted drives? ( i can't change the init.ora and reboot the db right now :( gotta wait.. )
Do i explicitly have to define utfl_file_dir = z: ?
-Third haven't had the chance to test it on linux or any other operating system, assuming a virtual unit is mounted successfully and that the issues above are solved i should be able to operate on any mounted drive whatever the os, right?
Best regards -
How to load the international characters by using the SQL*Loader(UNIX)?
Hi Everyone,
I am not able to load the international characters thru SQL*Loader which is calling from Unix. Whenever I load these characters , appears in DB such as Square box. Please help me how to resolve the issue.
Using version is:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.4.0 - Productio
NLSRTL Version 10.2.0.4.0 - Production
Thanks in advance.
Regards,
Vissu.....This may help
SQL> CREATE TABLE test_sqlldr_unicode (id INTEGER, name VARCHAR2(100 BYTE));
Table created.Now my data file.
1,"ABóCD"
2,"öXYZó"
3,"EFGÚHIJK"
4,"øøøøøøøøøøøøøøø"My control file.
LOAD DATA
CHARACTERSET WE8ISO8859P1
INFILE 'C:\test_sqlldr_unicode.txt'
REPLACE
INTO TABLE test_sqlldr_unicode
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(id INTEGER EXTERNAL , name )
{code}
Running the sqlldr
{code}
C:\>sqlldr USERID=hr/hr CONTROL=test_sqlldr_unicode.ctl LOG=test_sqlldr_unicode.
log
SQL*Loader: Release 10.2.0.1.0 - Production on Thu Dec 30 19:38:22 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 5
C:\>
{code}
The table
{code}
SQL> SELECT * FROM test_sqlldr_unicode;
ID NAME
1 ABóCD
2 öXYZó
3 EFGÚHIJK
4 øøøøøøøøøøøøøøø
SQL>
{code} -
How return parameter ref Cursor from procedure using dynamic SQL?
I sorry, but i very need help.
I using Oracle 8.0.6
I need to return parameter of type ref Cursor from procedure.
create or replace package PlanExp is
type cursortype is ref cursor;
procedure ShowPlan (cursorparam out
cursortype.............);
end PlanExp;
create or replace package body PlanExp is
procedure ShowPlan (cursorparam out cursortype,
.............) Is
sql_str varchar2(1000);
sql_str_select varchar2(100);
sql_str_from varchar2(100);
sql_str_where varchar2(500);
Return_Code integer;
Num_Rows integer;
cur_id_sel integer;
tSum_Plan DBMS_SQL.NUMBER_TABLE;
tSum_Plan_Ch DBMS_SQL.NUMBER_TABLE;
tSum_Plan_Day DBMS_SQL.NUMBER_TABLE;
begin
/* calculating string variables ........... /*
sql_str := 'select ' || sql_str_select ||
'from ' || sql_str_from ||
'where ' || sql_str_where ||
'group by ' || sql_str_select;
cur_id_sel := dbms_sql.open_cursor;
dbms_sql.parse(cur_id_sel, sql_str, dbms_sql.native);
dbms_sql.define_array(cur_id_sel, 1, tSum_Plan, 20, 1);
dbms_sql.define_array(cur_id_sel, 2, tSum_Plan_Ch, 20, 1);
dbms_sql.define_array(cur_id_sel, 3, tSum_Plan_Day, 20, 1);
Return_Code := dbms_sql.execute(cur_id_sel);
delete from TEMP_SHOWPLAN;
Loop
Num_Rows := dbms_sql.Fetch_Rows(cur_id_sel);
dbms_sql.column_value(cur_id_sel, 1, tSum_Plan);
dbms_sql.column_value(cur_id_sel, 2, tSum_Plan_Ch);
dbms_sql.column_value(cur_id_sel, 3, tSum_Plan_Day);
if Num_Rows = 0 then
exit;
end if;
Exit When Num_Rows < 20;
End Loop;
dbms_sql.close_cursor(cur_id_sel);
end;
end PlanExp;
How return cursor (cursorparam) from 3 dbms_sql.column_value-s ?I am using Oracle 8.1.7, so I don't know if this will work in
8.0.6 or not:
SQL> CREATE TABLE test
2 (col1 NUMBER,
3 col2 NUMBER,
4 col3 NUMBER)
5 /
Table created.
SQL> INSERT INTO test
2 VALUES (1,1,1)
3 /
1 row created.
SQL> INSERT INTO test
2 VALUES (2,2,2)
3 /
1 row created.
SQL> INSERT INTO test
2 VALUES (3,3,3)
3 /
1 row created.
SQL> CREATE TABLE temp_showplan
2 (tSum_Plan NUMBER,
3 tSum_Plan_Ch NUMBER,
4 tSum_Plan_Day NUMBER)
5 /
Table created.
SQL> EDIT planexp
CREATE OR REPLACE PACKAGE PlanExp
IS
TYPE CursorType IS REF CURSOR;
PROCEDURE ShowPlan
(cursorparam IN OUT CursorType,
sql_str_select IN VARCHAR2,
sql_str_from IN VARCHAR2,
sql_str_where IN VARCHAR2);
END PlanExp;
CREATE OR REPLACE PACKAGE BODY PlanExp
IS
PROCEDURE ShowPlan
(cursorparam IN OUT CursorType,
sql_str_select IN VARCHAR2,
sql_str_from IN VARCHAR2,
sql_str_where IN VARCHAR2)
IS
sql_str VARCHAR2 (1000);
cur_id_sel INTEGER;
return_code INTEGER;
BEGIN
DELETE FROM temp_showplan;
sql_str := 'INSERT INTO temp_showplan '
|| ' SELECT ' || sql_str_select
|| ' FROM ' || sql_str_from
|| ' WHERE ' || sql_str_where;
cur_id_sel := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE (cur_id_sel, sql_str, DBMS_SQL.NATIVE);
return_code := DBMS_SQL.EXECUTE (cur_id_sel);
DBMS_SQL.CLOSE_CURSOR (cur_id_sel);
OPEN cursorparam FOR SELECT * FROM temp_showplan;
END ShowPlan;
END PlanExp;
SQL> START planexp
Package created.
Package body created.
SQL> VARIABLE g_ref REFCURSOR
SQL> EXEC PlanExp.ShowPlan (:g_ref, 'col1, col2,
col3', 'test', ' 1 = 1 ')
PL/SQL procedure successfully completed.
SQL> PRINT g_ref
TSUM_PLAN TSUM_PLAN_CH TSUM_PLAN_DAY
1 1 1
2 2 2
3 3 3 -
How to pass parameter in "Filter By Using " Logical SQL
Hi
Newbie in BI Publisher and OBIEE.
I have the following requirement;
Generated the Logical SQL and added as New Dataset to BI Publisher Data Model.
The Logical SQL has statement as;
SELECT
0 s_0,
AGGREGATE(FILTER("BISubjectArea"."Comparative"."ME % - Account" USING ("BISubjectArea"."Common"."RPT_Date" = date '2011-10-31')) BY "BISubjectArea"."Classifications"."Country") s_1,
I want to parameterize the query by providing Data Model Parameters to the Filter By Statement. Example of what I want.
SELECT
0 s_0,
AGGREGATE(FILTER("BISubjectArea"."Comparative"."ME % - Account" USING ("BISubjectArea"."Common"."RPT_Date" =:Prior_date)) BY "BISubjectArea"."Classifications"."Country") s_1,
By providing this; it doesn't give any syntax error and accepts it. But when trying to run the Generate XML option, it gives out XML Tag error.
Please help to resolve this and thanks in advance
I am using OBIEE 11.1.1.5 version ...
Edited by: 908476 on Jan 17, 2012 1:12 AMI have not worked with 11g version but I believe that if you use Answers as a datasource then you can not have parameters on the BI publisher side. Not sure if that has changed. Please let me know if this is incorrect.
I guess you would have to use dashboard prompts and presentation variables and note that the Presentation variable MUST BE same as the parameters defined in the BI Publisher. Take a look at the following link for an example.
http://kirti-bi-solutions.blogspot.com/2009/06/passing-parameters-from-obiee.html
Thanks,
Bipuser -
How to access Oracle Mobile Server logs using PL/SQL?
I am starting to use Oracle solutions so I am a complete rookie.
I'm doing a project which requires to present the logs of mobile devices using the Oracle Mobile Server (integrated in Oracle Database Lite).
Does the mobile server have services I could use or do I have to parse the log files?
Thanks in advance for any support given!
Edited by: Hugo Zenha on 15-Apr-2009 07:40basic details for the sync history is MOBILEASDMIN.C$SYNC_HISTORY. This will give you the client id (name), start and end times, success or failure (and error if fail) plus the total data volumes uploaded and downloaded.
You can get further detail by joining c$sync_his_pub_items on session_id, and this gives the detail of each table uploaded (phase=UPLOAD) in terms of timings and records, and the same for the download. upload tends to be the full set of tables (records=0 for no activity), whilst download is only the active tables, and includes whether a complete refresh was done
You can get information for the MGP process using c$mgp_history and c$mgp_his_clients
As all the repository data is stored in the database, there is a lot of possibly interesting stuff if you look through.
We use SQL and PL/SQL to do reports on the different users having syncs within a period for cross charging and identifying clients having problems -
How do I create a binary file using PL/SQL
Hi
Can you help me with writing a binary file in PL/SQL? I like to load binary data from data file, process in database then write to a new binary file.
Thank you very much in advance.
regrds
YongdongDBMS_LOB won't help you write a BLOB to disk.
You need to an external procedure to do that. Eric K's java works great and he's helped me with his solution and probably about a thousand others.
Doing a search on this forum will yield many discussions on this often regurgitated topic. -
How to insert BLOB datatype image using PL/SQL Procedure and SQL Loader
Hi,
How to insert an image into database using PL/SQL Procedure and also how to insert using SQL Loader. Please help by giving sample code and process description.
Thanks,
Vijay Vhttp://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:232814159006
Maybe you are looking for
-
"Extend a Wireless Network" seems to be... broken?
Hey guys, Here's the scoop. I have one Airport Extreme 802.11n that's connected to a cable modem. It's set to "Create a Wireless Network". It's at 5 GHz, and "Allow this Network To Be Extended" is checked. It works fine! I have another Airport Extrem
-
Schedule lines are not in sink for PO
Hello Everyone, We are using ECS. So we create PO in SRM with some schedule lines and transfer it to the ECC system. But sometimes the schedule lines are not in sink on both the sides because buyer update the schedule lines on SRM side. So we need to
-
How do I import a camera video from iphoto to imovie? I went to file, import, camera archives and the video I want I am not able to select. I even tried dragging it from my desktop, but it will not allow me to do so. Please help?
-
Set default values for WSDL import?
When importing a WSDL, the default service package it sets is "services.servicename" and the Data type package is "valueObjects". Is it possible to configure these somewhere ,so that I do not have to retype what I want each time? We'd like the Serv
-
Distorted sound in Classic environment
I followed a thread about setting the speed to 41000Hz in order to resolve a problem I have with the "Chipmunk" sound while running older software in the Classic environment. The speed is set to 41000 Hz in the MIDI setup utility, but the problem sti