How to user HTMLDB_COLLECTIONS in a PL/SQL function?
Hi!
I am trying to validate/check that an item from an updateable report is not in a collection before I add the item. I wrote a PL/SQL function to do this. It appears that a "normal" PL/SQL function cannot correctly see the HTMLDB_COLLLECTIONS view. The idea for this was posted to the forum about using a decode statement and a function to detemine whether to display the link value or not for each row. If an item has been added to the collection I want to not display the link. If the item is removed from the collection I need to redisplay the link.
I have tried validations but they depend on the page being resumbitted. And I tried to force that using a branch where the request was = 'ADD'. However everytime I set it up as a redirect to a URL it kept resetting the branch to a 'branch to a page within this application'.
Any suggestions on how to check the HTMLDB_COLLECTIONS before it is updated?
This is V2.0.
Thanks! Dave Venus
Hi!
Yes things work much better when run from within the "application". I had been trying to test the code from both SQL*Plus and from the SQL WorkShop.
The problem I was having even within the application was that I was getting back NULL return values. So I put some exception handling into the code and trapped the
data_not_found and others exceptions. I also had SQL%NOTFOUND code in my function. It appears the SQL%NOTFOUND was not being processed and the exception code was. I can paste the code I was using here if you want.
I went another way around the problem and rewrote the query (esp. the where clause) for the report and it seems to be doing what I need now. I would love to get the function working and understand how it should have worked so that I can use that functionallity in other applications.
Thanks!
Dave Venus
Similar Messages
-
How many users can login to Microsoft SQL Server 2012 standard?
I searched around the forum but didn't find anything specific.
I downloaded Microsoft SQL Server Standard 2012. How many users can login into it?Hi Texastig,
Welcome to forum. I guess Sean/Vaibhav aptly answered your question can you please mark there reply as answer. An OP does not marks his own comment as answer which actually is thank you comment or unless he himself found an answer
Thanks for understanding
Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
My Technet Wiki Article
MVP -
How to user jdbc visit oracle object type function?
1ãcreate oracle object
create type cocotestparam1 as object
(id number,
name varchar(10)
2ãadd function to object
alter type cocotestparam1 add member function test1(t number) return member;
3ãcreate object body
create type body cocotestparam1 as
memeber function test1(t number)
return number
is
begin
return t;
end;
end;
how can I visit the object cocotestparam1's function?
and how can I user jdbc visit the function?CallableStatement =
"DECLARE
a person_type;
BEGIN
a.load_object(4);
? := a;
END;"
And register as an out parameter.
Edited by: michael76 on 14.07.2010 05:01 -
How display result set of a PL/ SQL function call in a dialog box
Hello,
I am calling a PL/ SQL function from Apex, which returns - List of varchar.
In Apex, it should show this list of varchar and "Yes" and "No" buttons on a message window.
Can you please suggest a way to achieve the same.
Thanks,
GirishHello,
This application process "vrl_popup" is to get the values from PL/ SQL function. For popup window - confirm(). Also declared the LV_list as Application Item.
Which is coded in the region part of the button. After pressing this button popup window should come with the list.
<script type="text/javascript">
<!--
function doAjaxRequestParam( process, parameter)
var ajaxRequest = new htmldb_Get(null,&APP_ID.,'vrl_popup='+process,0);
ajaxRequest.add('lv_list', parameter );
var jsonResult = eval('('+ ajaxRequest.get() +')');
return jsonResult;
var answer = confirm ("can try this?")
alert (v_list)
if (answer)
alert ("done")
else
alert ("Unsuccessful")
// -->
</script>
In apex I created following Application process by name = vrl_popup,
declare
lv_List varchar2(2000) := '';
begin
begin
lv_List := select vrl_type_process_pkg.get_regd_reg_lste() from dual;
exception when no_data_found then null;
end;
htp.prn(lv_List);
end;
Kindly help in fixing this.
Edited by: Girish on Jun 17, 2010 12:57 AM -
How to user ORACLE as username in SQL Developer
Hi,
I am new to sql developer. Could you please tell me how do I connect as "ORACLE" user in SQL developer?
I have full privileges using sys & oracle. I tried using sql as sysdba too but it is not accepting it in spite of providing correct password.>
When I tried connecting to the database as " username - sys as sysdba" in spite of providing correct password, it says, logon denied, incorrect username/password. The oracle database version is 10.2.0.4 & sql developer is 3.5.
>
Are you sure you are using Oracle's sql developer?
This is the official product page
http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html
IT shows the current latest version is 3.1.07.42 so Oracle doesn't have a version 3.5 yet.
And the official product does not have a " username - sys as sysdba" selection anywhere that I can find. There is a role selection dropdown that includes a SYSDBA choice.
So you provided information that can't possibly be correct and you did not respond to any of the questions that I asked other than DB version.
If you want help you need to provide SPECIFIC information about what steps you have taken and what results you got.
What steps did you take, specifically, to create a user called "ORACLE"? What user was used to create the "ORACLE" user? What grants (roles & privileges) were granted to the user named "ORACLE"?
As for me, since you are not willing to provide information about the other questions that were ask I can't help you so I wish you luck. -
How to get currency format using pl sql function
Hi all,
I am a newbee on the forum. currently i am facing an issue with the Format of Currency in an rdf report. This is a field of tax amount & i need to make some conditional formatting on this like if the tax amount is Zero then some static note is to be added before this field.
I have tried a lot of functions on it like the one as below:
IF :cp_org_id = 102
AND :invoice_currency_code <> 'CAD'
AND TO_CHAR (NVL (:cf_tax_amount, 0)) = 0
THEN
RETURN (TRUE);
ELSE
RETURN (FALSE);
This is working fine in case of Zero tax amount But gets error out when there some Tax amount exists. It gives a VALUE ERROR in this format Trigger.
Kindly suggest me how to solve this issue with right function. If possible then write the pseudo Code also.
Thanks in advance
D_VermaIn addition to Satyaki:
It might be a 'Reports Thing'.
It works in SQL*Plus (although relying on implicit conversions is a bad idea, as mentioned):
MHO%xe> begin
2 IF 102 = 102
3 AND 'DAC' != 'CAD'
4 AND TO_CHAR (NVL (null, 0)) = 0
5 THEN
6 dbms_output.put_line('TRUE');
7 ELSE
8 dbms_output.put_line('FALSE');
9 end if;
10 end;
11 /
TRUE
PL/SQL-procedure is geslaagd.
MHO%xe> begin
2 IF 102 = 102
3 AND 'DAC' != 'CAD'
4 AND TO_CHAR (NVL (0, 0)) = 0
5 THEN
6 dbms_output.put_line('TRUE');
7 ELSE
8 dbms_output.put_line('FALSE');
9 end if;
10 end;
11 /
TRUE
PL/SQL-procedure is geslaagd.
MHO%xe> begin
2 IF 102 = 102
3 AND 'DAC' != 'CAD'
4 AND TO_CHAR (NVL ('0', '0')) = '0'
5 THEN
6 dbms_output.put_line('TRUE');
7 ELSE
8 dbms_output.put_line('FALSE');
9 end if;
10 end;
11 /
TRUE
PL/SQL-procedure is geslaagd. -
How to define a parallel, deterministic pl/sql function in OWB 11.2?
Hi,
at my customer site, we are starting with the new development work after upgrading from OWB 10.2 to 11.2 and we can't find the configuration parameter to define a parallel and deterministic function within a new package. The "old" function dialog in 10.2 had some checkboxes for those two features ...
Thanks in advance
MichaelThanks for the advice, the Cut & Copy idea from MccM is working fine, however is not really a solution for the problem. But we are using it as a workaround for the moment.
Just for documentation: There already exists a bugfix, addressing the issue of lost parrallel and deterministic information during an upgrade from OWB10.2 to 11.2 (see bug 14673399 and patch 16082939)
And for at least some of us with access to Oracle Support: Our onsite Oracle consultant opened a service request for this issue: 3-6773545351 (You will not be able to see the request unless You are an Oracle employee, but maybe the reference is helpful for You.) -
How to print a messages inside pl/sql functions
I have this function whihc is very similar to a number of my other functions:
DECLARE
check_if_set VARCHAR2 (50);
BEGIN
FOR c IN (SELECT proposal_id
FROM student_current_project
WHERE student_id = :p4_student_id
AND second_reader_type != 'Confirmed')
LOOP
check_if_set := c.proposal_id;
END LOOP;
IF check_if_set IS NOT NULL
THEN
UPDATE student_current_project
SET second_reader_id = :p4_request_reader, second_reader_type = 'Request'
WHERE student_id = :p4_student_id;
HTP.print ('Request Reader sent.');
ELSE
HTP.print ('Reader Already Confirmed.');
END IF;
END;
The problem is with the printing to the screen. I basically want it to print like the process sucess message does but obviously there is two out comes listed above that it can print so i cant use the process sucess message. What is missing from the HTP.print statments above?
Thanks for your helpHey Dan,
I think you can do this with the Display-Only-Items.
So when you have a Display-Only-Item :P4_Message then your Process can be:
DECLARE
check_if_set VARCHAR2 (50);
BEGIN
FOR c IN (SELECT proposal_id
FROM student_current_project
WHERE student_id = :p4_student_id
AND second_reader_type != 'Confirmed')
LOOP
check_if_set := c.proposal_id;
END LOOP;
IF check_if_set IS NOT NULL
THEN
UPDATE student_current_project
SET second_reader_id = :p4_request_reader, second_reader_type = 'Request'
WHERE student_id = :p4_student_id;
:P4_Message := 'Request Reader sent.';
ELSE
:P4_Message := 'Reader Already Confirmed.';
END IF;
END;
Regards,
Tim -
How to use SQL function in Tabular Form
Edited by: JuniorNewbi on 03-Nov-2009 08:15
Hi
I want to have a Tabular Form in which the Report Source sql statement is retrieved via an SQL function, so that the resulting report can show a variable number of columns and column names.
The following great web site shows just the kind of thing i'm trying to do (Tabular Form Dynamic):
http://htmldb.oracle.com/pls/otn/f?p=31517:195:518536699796436::NO:::
However, as an Apex newbie, i don't know how to invoke the SQL function from within the page. The "Report Source" appears to only allow a static "select...." style of entry.
I don't have access to the Denes Kubicek's workspace so don't know how he would have invoked his PL/SQL Function.
Can anyone help?
Thanks in advance!
Edited by: JuniorNewbi on 03-Nov-2009 08:46 -
How to determine logged in user and responsibility in pl/sql?
I created a procedure that uses owa_util.redirect_url to lauch a web application. This function is lauched by a function on an EBS menu.
Before calling the redirect I use owa_cookie.send to pass the name of the user and the responsibility using a cookie. When I refer to fnd_global.resp_id or fnd_global.user_id they are always null.
Does anyone know how I can capture the logged in user/responsibility and pass it to the web application?
Thanks,
-- JohnnieFound a hit on metalink, not good news the Fnd_Global values are not set when calling sswa pl/sql function:
Doc ID: 726560.992
https://metalink.oracle.com/metalink/plsql/f?p=200:27:8705377808354107614::::p27_id,p27_show_header,p27_show_help:726560.992,1,1
Message was edited by:
johnniebillings -
How many users from an application can connect to a SQL server at a time?
HI,
I need to know , How many users from an application can connect to a SQL server at a time? Do we have any settings for this in SQL server for limiting the users?This is a difficult question, since it is both technical and legal.
The absolute maximum number of connections is around 32700, but unless your server is very beefy, it will choke long before that. A connection is not a user - an application can have many connections for the same user. Depending on your license
model, you may be legally limited to a certain number of users, but this number is not enforced technially.
Erland Sommarskog, SQL Server MVP, [email protected] -
How many users are working on EBS
is it possible to find out how many users are currenlty at the same time working on EBS.
Like how many payable users, mfg uers OTL users.Hi,
Below sql will find how many users are currently working on EBS,
SELECT distinct icx.session_id, icx.user_id, fu.user_name, fu.description
FROM icx_sessions icx, fnd_user fu
WHERE disabled_flag != 'Y'
AND icx.pseudo_flag = 'N'
AND ( last_connect + DECODE (fnd_profile.VALUE ('ICX_SESSION_TIMEOUT'),
NULL, limit_time, 0, limit_time, fnd_profile.VALUE ('ICX_SESSION_TIMEOUT') / 60 ) / 24) > SYSDATE
AND icx.counter < limit_connects
AND icx.user_id = fu.user_id
order by 4;
Thanks,
Amogh -
How many users/ schemas can we create in an oracle database?
How many users can we create in an oracle database? Or how many users can oracle handle?
Problem-
I have to store information of ontologies (I will use countries instead) in db.
I have to store information regarding countries.
I have 13 tables in all to maintain for each country.
Now there are two approaches:
1) keep only 13 tables. Have an extra column in each table to indicate that a particular
row stores information for which country.
2) create a new user/ schema for each country. So we can get rid of the extra column
needed in 1st approach.
I have used the second approach. This is because number of entries in each table for a
given country will be large.
So initially when the s/w is installed I create a central-user. Each time data for new
country has to be entered central-user creates a user/ schema, and creates tables for
this user/ schema. The central user can access the tables of all the countries by
country_name.table_name. By this approach I believe searching would be easy.
If there is any flaw in my approach kindly mention it.
Thank youThere is no (practical at least) limit to the number of users & schemas you can have in Oracle.
Your approach, however, is not going to scale nearly as well as the first option you outlined (adding a column). You are going to end up caching every possible variation of the various queries you're going to be executing because you will be referring to so many different tables, which is going to mean that you are doing a lot more work to parsing statements and generally churning through the shared pool. If you create enough users, you're liable to start hitting ORA-04030 errors because your shared pool is so fragmented.
Additionally, you're likely going to end up with a whole lot of dynamically generated SQL to accommodate new schemas getting added over time which is going to cause you even more pain. Figuring out dynamically what table to join in is a heck of a lot more difficult for the programmer to write and for the database to handle than simply passing in a different country code.
If you're concerned about having too much data, you can have your cake and eat it to by adding the country column and partitioning the tables based on country.
Justin
One other item I forgot to mention is maintainability. Having dozens or hundreds of "identical" schemas makes maintenance a huge pain because something like adding a new column now requires dozens or hundreds of separate DDL statements. You're almost guaranteed that some schema isn't going to be in sync-- it's going to miss a column or miss an index, etc.
Message was edited by:
Justin Cave -
How to create a counter using Oracle SQL Developer?
Is there any way to create a counter using Oracle SQL Developer to create the below scenario. Meaning it will recorded down the name of user and ID and time and the date they login.
Library portal home statistics shows how many users (outside and within the campus) visit the library portal.
Page Access statistics is recorded on an hourly basis. Users may select the statistics by
yearly (statistics displayed by all months in the selected year)
monthly (statistics displayed by all days in the selected month)
daily (statistics displayed by all hours in the selected day)I'm giving here one basic post - hope this will solve your problem --
SQL>
SQL>
SQL> create table audit_info
2 (
3 usr varchar2(50),
4 log_time timestamp(6)
5 );
Table created.
SQL>
SQL>
SQL> create table err_log
2 (
3 log_cd varchar2(20),
4 log_desc varchar2(500)
5 );
Table created.
SQL>
SQL>
SQL> create or replace procedure ins_err(errcd in varchar2,
2 errnm in varchar2)
3 is
4 pragma autonomous_transaction;
5 begin
6 insert into err_log values(errcd,errnm);
7 commit;
8 end;
9 /
Procedure created.
SQL>
SQL>
SQL> create or replace procedure ins_aud(ud in varchar2,
2 unm in varchar2)
3 is
4 pragma autonomous_transaction;
5 begin
6 insert into audit_info values(ud,unm);
7 commit;
8 exception
9 when others then
10 ins_err(sqlcode,sqlerrm);
11 end;
12 /
Procedure created.
SQL>
SQL>
SQL>
SQL> create or replace trigger log_odsuser1
2 after logon on odsuser1.schema
3 begin
4 ins_aud('ODSUSER1',sysdate);
5 exception
6 when others then
7 ins_err(sqlcode,sqlerrm);
8 end;
9 /
Trigger created.
SQL>
SQL*Plus: Release 9.2.0.1.0 - Production on Tue Jun 12 12:21:09 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
SQL>
SQL>
SQL>
SQL> set serveroutput on
SQL>
SQL>
SQL> select * from audit_info;
USR
LOG_TIME
ODSUSER1
12-JUN-07 12.00.00.00000000 AMHope this will solve your purpose.
Regards.
Satyaki De. -
PL/SQL Function in an infinite Loop, how to destroy?
Hi,
My Apex is using a PL/SQL function and there is an infinite loop. How can I stop it so I can recompile the PL/SQL again? Thanks.the less obvious is whos session exactly.
I had the same problem - wrong thinking, wrong loop , visible effects of infinitive loop (statistics of the db) . I was trying to kill sessions of the : user , who owns DAD and a user in who's schema runs nasty plsql code - without efect. Kill was confirmed but there was no change. I was made to reboot my server. Probably there is more efective way to do solve this (in my case - I have solved loop-problem after reebot).
Would it be better to kill apache session under OS ? (restart it)
Restart oracle's listner under OS ?
Some ideas ?
Maybe you are looking for
-
How can I get all the values of a String array profile property using javascript?
I am trying to build functionality into our site that records all products added to the basket against a user's profile. I have so far been able to store the product codes against the profile as a property using Ajax: var dataString = ":formid
-
Hi all, We are facing an unusual problem. We transported one IDoc to file scenario to another XI System . The scenario contains one BPM. Now the problem is that the IDoc is coming from R/3 Business System but not going to BPM. We couldn't find any er
-
Hi Folks, I have list library with 2 columns. where as 1 column is people picker control and it is not mandatory filed . When the user open newform.aspx and fill all the column values and submit it should show error message if user not enter any data
-
Remove Line feed at the end of the file while using file adapter
Hi All, I have a requirement. We are sending a file from SAP to FTP using file adapter. we are successful in sending the file to FTP but at the end of the file a extra blank line is created . Can anyone please suggest how to remove the extra line fee
-
ITunes gets frozen when connecting Ipod to Dell Laptop! Help!!!
Whenever I connect my Ipod Nano to my Dell Laptop, the iTunes appears and gets frozen. When I disconnect it, the iTunes works normally. I connect the Ipod, the iTunes does not work. What do I do????