Bulk Replacements using Replace function in oracle 8i
Hi All,
Iam using oracle 8i version and i need to use Replace function for bulf replacements i mean i need to replace around 250 rows. So please anyone suggest me how to proceed
on this request as iam using oracle 8i version.
Thanks!
Srini
Write one update statement.
The where condition is the filter what rows need to be touched.
The SET condition will do the data change. For example it could use the REPLACE function if that is what it is needed.
One single update statement over 20 rows would mean the task is done in BULK. 20 single updates that each handle one row would mean it is row by row = slow by slow processing.
Similar Messages
-
Using FILTER function in oracle answers
Gurus,
I have a question related to using Filter function in oracle answers.
When trying to insert a Filter (expr) Using (expr) clause in the formula area of a fact table field, It errored out with msg saying about using a wrong measure.
I know this can be done with a case expression but I tried filter clause since this is available in oracle answers.
Please help me figuring out this scenario.
Thanks.David / Raghu - Thanks for u'r replies and apologizes for not posting question with proper material.
Am posting my code and the error message from the screen.
Code :
IFNULL(FILTER("Fact - MBS Loan Transactions"."OUTSTANDING PRINCIPAL" USING "Dim - MBS Loan"."LOAN TYPE HPD/HDC/BNK" = 'HDC'),0)
Error :
nQSError: 10058] A general error has occurred. [nQSError: 22032] Function FILTER requires at least one measure attribute in its first argument. (HY000)
SQL Issued: SELECT "Dim - MBS Loan"."LOAN AMOUNT", "Dim - MBS Loan"."LOAN TYPE HPD/HDC/BNK", "Dim - MBS Loan"."LOAN TYPE SEN/SUB", "Dim - MBS Project"."PROJECT NAME", "Dim - MBS Project"."PROJECT NUMBER", "Fact - MBS Loan Transactions"."AR BALANCE INTEREST", "Fact - MBS Loan Transactions"."GL BALANCE INTEREST", IFNULL(FILTER("Fact - MBS Loan Transactions"."OUTSTANDING PRINCIPAL" USING "Dim - MBS Loan"."LOAN TYPE HPD/HDC/BNK" = 'HDC'),0) FROM "Financials - MBS"
OK (Ignore Error)
Please continue answering my queries. Since am a newbie your answers won't be just a reply but it's actually learning for me.
Thanks. -
Problem to Use C function in oracle
Hi Friends,
i m trying to use c funciton in oracle
as per oralce documentation its working fine when i used the demo example
but in demo example thr are only interger data type used
i need to use the char data type from c
and while calling that function in c when i tried to call char as parameters data type
its giving following error :
SQL> CREATE OR REPLACE FUNCTION endecrypt(
2 x Varchar2,
3 y BINARY_INTEGER)
4 RETURN Varchar2 AS
5 EXTERNAL LIBRARY pass
6 NAME "crypt" -- Name of function call. Quotes preserve lower case.
7 LANGUAGE C
8 PARAMETERS (x Char, y short);
9 /
Warning: Function created with compilation errors
SQL> show err
Errors for FUNCTION PRIME.ENDECRYPT:
LINE/COL ERROR
8/16 PLS-00235: the external type is not appropriate for the parameter
0/0 PL/SQL: Compilation unit analysis terminated
the bold part (x char) at line number 8 is having problem
how can i solve it ?????If you had read the documentation as you claim to have done so you would know that STRING is probably what you want.
Cheers, APC -
How to find exception occured while using LOGON function in oracle 10g
Hi,
I am using LOGON function to login with a different user name in oracle 10g forms.
LOGON ( User, Pass@tns, FALSE)
The third parameter is passed as 'FALSE' to avoid the login screen to be opened. If any of the other parameter ( User Name, Password, TNS) is passed wrong, connection is not established but no exception is occurred. The value for 'FORM_FAILURE' is set to 'TRUE'.
What i need is the ORA error for connection failure. The error message related to user name/password (ORA-01017) or connection identifier (ORA-12155).
How i can get this error code if connection is failed. Is there any other way to login in oracle forms other than 'LOGON'.
HabibHabib Ahmad wrote:
Hi,
I am using LOGON function to login with a different user name in oracle 10g forms.
LOGON ( User, Pass@tns, FALSE)
The third parameter is passed as 'FALSE' to avoid the login screen to be opened. If any of the other parameter ( User Name, Password, TNS) is passed wrong, connection is not established but no exception is occurred. The value for 'FORM_FAILURE' is set to 'TRUE'.
What i need is the ORA error for connection failure. The error message related to user name/password (ORA-01017) or connection identifier (ORA-12155).
How i can get this error code if connection is failed. Is there any other way to login in oracle forms other than 'LOGON'.As salamu alikum, Habib
If you pass FALSE in login you can't catch anything. Want to catch the error ?
Then change
LOGON ( User, Pass@tns, FALSE)
to
LOGON ( User, Pass@tns, TRUE) Now Create On-Error trigger at form level
and try the following code
if error_code=01017 then
message('invalid user name or password');
message('invalid user name or password');
raise form_trigger_failure;
elsif error_code=12154 or error_code=1215 then
message('invalid connection string');
message('invalid connection string');
raise form_trigger_failure;
end if;Hopes this helps
If someone's response is helpful or correct, please mark it accordingly. -
Using R function on Oracle data base
for using R, I only can use Oracle data mining algorithms or I can use R function like social network in Oracle data base?
Oracle Advanced Analytics provides multiple language (SQL, R and if we include GUIs, Oracle Data Miner workflow UI) support to the in-DB analytics. Using SQL, R or the ODM'r GUI, you can access a library of simple descriptive, summary and coparative statistics that have been implemented in the Oracle Database + a dozen hi-perf in-DB data mining algorithms (e.g. regression, decision trees, text mining, clustering, associations, anomaly detection, etc.) and solve a wide range of business and technical problems.
Should you require additional techniques e.g. R CRAN packages, then Oracle Advanced Analytics supports that through R to SQL transparancy where it "pushes down" R language intentions to matching in-DB SQL functions e.g. ETL, stats and data mining OR it can make a callout to R via "embedded R mode" and have the Database manage the flow of data and the process.
There is an OTN Discussion Forum that focuses entirely on the "R" aspects of the Oracle Advanced Analytics Option. I suggest that you re-post your questiion here R Technologies for additional discusssions and for the benefit of that Oracle Advanced Analytics/Oracle R Enterprise OTN forum/community.
cb -
How to use "Rank" function in Oracle?
I need to display Top 15 records by using rank function.
Here is my query...I need to pull top 15 FAQ's using the below query.. How can I use RANK function to display the Top 15 FAQ"s in the list.
Select distinct SUb1.FAQ,Sub1.FAQ_Hits,GU.display_Name_FMLS as displayname,ev.ParentLinkrecordid,ev.userid from User GU
Join Event ev
ON LOWER (ev.userid) IN (LOWER (GU.lanid), LOWER (Gu.racfid))
Join (Select distinct sm.stem as FAQ,Sum(ev.Eventresults) as FAQ_Hits,ev.ParentLinkrecordid as Topic_ID from Event ev
Join SubjectMatter sm
ON (TO_CHAR (sm.smrecordid) = ev.eventdetail1) AND ev.eventdetail1 IS NOT NULL AND sm.smtype = 1
Where (Upper(ev.eventsubtype) in (Upper('FAQ'),Upper('OPENFAQ')))
AND TO_DATE (eventdatetime, 'yyyy-mm-dd hh24:mi:ss') >= TO_DATE ('20100601', 'yyyymmdd')
and TO_DATE (eventdatetime, 'yyyy-mm-dd hh24:mi:ss') <= TO_DATE ('20100831', 'yyyymmdd')
Group by sm.stem,ev.Parentlinkrecordid
order by FAQ )sub1
ON Sub1.Topic_ID = ev.ParentLinkrecordid)A few bits that I noticed in the query ...
in (Upper('FAQ'),Upper('OPENFAQ'))1) Do you really a upper for a string which is already in upper case.
Select distinct sm.stem as FAQ,Sum(ev.Eventresults) as FAQ_Hits,ev.ParentLinkrecordid as Topic_ID2) Do you need a distinct when you are using a GROUP function viz. SUM ?
You rank query is as follows, I am not very good at the ANSI style JOIN so changed it slightly ... :-)
Also notice the usage rank function in the "sub1" query.
select distinct sub1.faq,
sub1.faq_hits,
gu.display_name_fmls as displayname,
ev.parentlinkrecordid,
ev.userid
from user gu, event ev,
(select rank() over (order by sum(ev.eventresults) desc) rnk,
sum(ev.eventresults) as faq_hits,
sm.stem as faq,
ev.parentlinkrecordid as topic_id
from event ev, subjectmatter sm
where (to_char(sm.smrecordid) = ev.eventdetail1)
and ev.eventdetail1 is not null
and sm.smtype = 1
AND upper(ev.eventsubtype) in ('FAQ', 'OPENFAQ')
and to_date(eventdatetime, 'yyyy-mm-dd hh24:mi:ss') >= to_date('20100601', 'yyyymmdd')
and to_date(eventdatetime, 'yyyy-mm-dd hh24:mi:ss') <= to_date('20100831', 'yyyymmdd')
group by sm.stem, ev.parentlinkrecordid
order by faq) sub1
where lower(ev.userid) in (lower(gu.lanid), lower(gu.racfid))
and sub1.topic_id = ev.parentlinkrecordid)
and sub1.rnk <= 15;Like mentioned above, some sample data would have helped. -
Using SYS_EXTRACT_UTC function in Oracle forms version 9
Hi,
I would like to use the function SYS_EXTRACT_UTC in forms but I get an error 201:
identifier 'SYS_EXTRACT_UTC' must be declared.
How can I use this function? do I need any library or something?
ThanksYou can try creating a wrapper database procedure for this and call the procedure
from forms. It should work
Rajesh -
How to use decode function in oracle apex 3.2.1
Hello Friends,
how to use decode
var_decode := 'decode'||'('|| var1 ||','|| -800000000000000||','||'.A'||','||
appreciate your help.
regards/kumar
Edited by: kumar73 on Apr 23, 2010 12:25 PM
Edited by: kumar73 on Apr 23, 2010 12:27 PMHey just on this particular point, there's a handy PL/SQL method for escaping quotation characters which may reduce the complexity of the string.
For example, if I had a string:
I can't understand why quoting my 'quote' characters never seems to "work"!and I wanted to pass that into a variable, I could do this:
vc_foo:= 'I can''t understand why my ''quote'' characters never seems to "work"!';or I could use the q function, whereby you enclose your string within a quote delimiter of your choice, like so:
vc_foo:= q'^I can't understand why quoting my 'quote' characters never seems to "work"!^';
note: I used the caret (^) character by convention but any valid character will do
...all of which leaves your original string more or less unadulterated.
I find this particularly useful for generating dynamic SQL and dynamic PL/SQL, as it leave the query looking a tad more readable, although if you are chaining together multiple strings with double-pipes, it can make it a little muddier. I find it particularly useful if I'm going to deal with string data from, for example, a field with Irish-derived surnames such as "O'Reilly"...
Give it a go! -
How do we use "streams" functionality in Oracle 8i?
Hello Gurus,
Oracle Streams is only available as of Oracle 9i. I need to replicate data from an Oracle 8i database to another database. The tables don't match exactly and i want a solution that can mimic streams. How can that be done? Is there any sample code available to do this type of streaming between Oracle 8i dbs?
Thanks.You can use Materialized views (used to be called Snapshot) or Advanced Replication. But I think AR is an extra option not included in Enterprise Edition.
You could also develop trigger based replication using database link. But I advice you don't go that way. Don't reinvent the wheel. Think of what happens when one db goes down - you don't want the other to sink with it...
You should give Snapshot a try. Look for fast snapshot refresh. It uses incremental log, so it is a lot faster in most cases.
You need at least 9i R2 to use Streams, but you're better off with 10.2.0.3. -
Using Sum Function in Oracle(on 24 th)
Hi all i wrote the following query.
SELECT RESPONSER_ID,SUM(SUM(DISTINCT WORK_SPACE)) AS SCORE,COUNT(DISTINCT QUESTION_ID) AS QCOUNT FROM TQDB_LEARNER_RESPONSE WHERE RESPONSER_ID=328
GROUP BY RESPONSER_ID
I am getting the following error.
ORA-00937: not a single-group group function
Any body Pls help me.why use sum(sum()
SUM(SUM(DISTINCT WORK_SPACE)) AS SCORE,
SELECT
RESPONSER_ID,
SUM(DISTINCT WORK_SPACE) AS SCORE,
COUNT(DISTINCT QUESTION_ID) AS QCOUNT
FROM
TQDB_LEARNER_RESPONSE
WHERE
RESPONSER_ID=328
GROUP BY
RESPONSER_ID Regards
Singh -
How I can use use_exit function in oracle forms
Hi,
I will appreacite if Somebody can help me , how I can configure the user_exit function for our Oracle Forms 10g development environment (Windows 32 ).
With regards
Satheesh Kumarhi,
in order to find out the user exits for any tcode,
1. get the developement class of the tcode from SE93.
2. Now goto transaction SMOD and press F4,
3. give in the Deve class in the dev class and Press ENTER
this will show u the exits for any tcode.
or execute this report
http://www.erpgenie.com/sap/abap/code/abap26.htm
which gives the list of exits for a tcode
http://help.sap.com/saphelp_nw04/helpdata/en/bf/ec079f5db911d295ae0000e82de14a/frameset.htm
For information on Exits, check these links
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sapgenie.com/abap/code/abap26.htm
http://www.sap-img.com/abap/what-is-user-exits.htm
http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
http://www.easymarketplace.de/userexit.php
http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
http://www.sappoint.com/abap/userexit.pdfUser-Exit
Regards
Anver -
How to use DLL function in Oracle Forms 5.0?
for instance, the FindWindowA function in "user32.dll"
please advise, thanksTake a look at ORA_FFI package.
-
Using aggregate functions in Oracle DBAdapter of Oracle BPEL
Hi All,
Need some info on the following:
1) Is it possible to configure a DBAdapter in line with a query like in Oracle BPEL 10.1.2
select * from emp where ROWNUM<500
The problem I am facing is that when in the process of configuring the DBAdapter , during building of the where clause I am restricted to select only the explicit feilds of EMP like first name and the last name .If this is the case then how do i select an implicit feild like ROWNUM .
It is possible to build a query like above, only if we can select ROWNUM as the first argument in the expression building wizard.
Please suggest various ways to handle the above.
Thanks
Saii think it is possible to specify the sql explicitly, but don't know how at the moment. if you know toplink, you may be able to do this.
Toby -
Using sql functions (min, max, avg) on varray or table collection
Hi,
I would like to know if there is a way to use sql function or oracle sql function like Min,Max, Avg or percentile_cont on varray or table collection ?
Does anyone encountered this type of problem ?
ThanksYes you can apply Min,Max, Avg... if varray or table collection type is SQL (created in the databaase) UDF, not PL/SQL declared type:
SQL> set serveroutput on
SQL> declare
2 type str_tbl_type is table of varchar2(4000);
3 str_tbl str_tbl_type := str_tbl_type('X','A','D','ZZZ');
4 max_val varchar2(4000);
5 begin
6 select max(column_value)
7 into max_val
8 from table(str_tbl);
9 dbms_output.put_line('Max value is "' || max_val || '"');
10 end;
11 /
from table(str_tbl);
ERROR at line 8:
ORA-06550: line 8, column 18:
PLS-00642: local collection types not allowed in SQL statements
ORA-06550: line 8, column 12:
PL/SQL: ORA-22905: cannot access rows from a non-nested table item
ORA-06550: line 6, column 5:
PL/SQL: SQL Statement ignored
SQL> create or replace type str_tbl_type is table of varchar2(4000);
2 /
Type created.
SQL> declare
2 str_tbl str_tbl_type := str_tbl_type('X','A','D','ZZZ');
3 max_val varchar2(4000);
4 begin
5 select max(column_value)
6 into max_val
7 from table(str_tbl);
8 dbms_output.put_line('Max value is "' || max_val || '"');
9 end;
10 /
Max value is "ZZZ"
PL/SQL procedure successfully completed.
SQL> SY. -
Trigonometric functions in Oracle
Hi,
I have never used trigonometric functions in Oracle before. I am working on creating a google map of customers within a certain radius of a location. My database table contains longitude and latitude as well as customer information. At this point, using spatial is not an option though it may be in the future. My table name is account and I try to run the following query. I hardcoded in New York (40,-74) as a center and using 25 miles as the radius. I took the query from an example on google maps.
SELECT address, business_name, latitude, longitude, ( 3959 * acos( cos( radians(40) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(40) ) + sin( radians(-74) ) * sin( radians( latitude ) ) )) AS distance FROM account HAVING distance < 25
ORDER BY distance
I get an error message that radians is an invalid identifier. Any ideas as to what I am doing wrong here?
Thanks
KevinSQL> CREATE OR REPLACE FUNCTION degree2radian(pin_Degree IN NUMBER)
2 RETURN NUMBER DETERMINISTIC IS
3 BEGIN
4 RETURN pin_Degree / 57.2957795; --1R = 180C
5 END degree2radian;
6 /
Function created
SQL> select degree2radian(40) from dual;
DEGREE2RADIAN(40)
0,698131700957136
SQL> select degree2radian(180) from dual;
DEGREE2RADIAN(180)
3,14159265430711
SQL> by the way, what 3959 stands for? Is it for 25 miles?
Maybe you are looking for
-
How to install clusterware on windows 2008 R2 64bit
Hello all, As you know at otn there is only 10.2.0.4 clusterware setup for windows2008. I want to install oracle clusterware on 2008R2. I know that there is a patchset 10.2.0.5 for windows 2008R2. But before using it I must have alredy binary setup f
-
Hello, I'm having problems updating to Yosemite from OS X 10.7.5 on my 13' MacBook Air from mid 2011 I can pretty much download the whole thing from the App store, but then before the setup starts I get the error message: "The application could not b
-
Quicktime Player Pro won't play any movies?
Ever since I restored my computer about a month ago, my Quicktime Player won't play any video formats correctly. .avi files don't play anymore, and mp4 files only play sound with the screen black. Then when I try to close the application, I get the p
-
Resolution of Superimposed Pictures
I don't know why or how it happened, but I decided to try something on my own. Because I knew that the original picture was there, I "duplicated" it. Once I duplicated the original, I was able to "trash" the picture and the one superimposed. If anyon
-
I have a Creative Cloud Subscription. I have created a website in Muse and have published it in Business Catalyst but I would like to add Business Catalyst CMS functions like a Blog and a Sign-up form which I don't seem to be able to do with WebBasic