Sign Up to our social questions and Answers to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers to ask questions, answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This promise is immense; every day and every night, we are trying our best to fulfill it by helping others, leaving something worthwhile behind us, and living for a purpose that is "Enrich & Spread knowledge everywhere".
How to convert milliseconds to mins, seconds in java ?
you can use java.util.concurrent.TimeUnit class Read more [code] String.format("%d mins, %d secs", TimeUnit.MILLISECONDS.toMinutes(milli), TimeUnit.MILLISECONDS.toSeconds(milli) - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(milli)) ); [/code] If TimeUnit or toMinutes are unsupported (Read more
you can use java.util.concurrent.TimeUnit class Read more
[code]
String.format(“%d mins, %d secs”,
TimeUnit.MILLISECONDS.toMinutes(milli),
TimeUnit.MILLISECONDS.toSeconds(milli) –
TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(milli))
);
[/code]
If TimeUnit or toMinutes are unsupported (such as on Android before API version 9), use the following equations:
[code]
See lessint seconds = (int) (milliseconds / 1000) % 60 ;
int minutes = (int) ((milliseconds / (1000*60)) % 60);
int hours = (int) ((milliseconds / (1000*60*60)) % 24);
[/code]
How to avoid != null statements in java ?
If you use (or planning to use) JetBrains IntelliJ IDEA, a Java IDE, you can use some particular annotations developed by them. Basically, you've got @Nullable and @NotNull. You can use in method and parameters, like this: [code] @NotNull public static String helloWorld() { return "Hello World"; } [Read more
If you use (or planning to use) JetBrains IntelliJ IDEA, a Java IDE, you can use some particular annotations developed by them.
Basically, you’ve got @Nullable and @NotNull.
You can use in method and parameters, like this:
[code]
@NotNull public static String helloWorld() {
return “Hello World”;
}
[/code]
or
[code]
@Nullable public static String helloWorld() {
return “Hello World”;
}
[/code]
The second example won’t compile (in IntelliJ IDEA).
When you use the first helloWorld() function in another piece of code:
[code]
public static void main(String[] args)
{
String result = helloWorld();
if(result != null) {
System.out.println(result);
}
}
[/code]
Now the IntelliJ IDEA compiler will tell you that the check is useless, since the helloWorld() function won’t return null, ever.
Using parameter
[code]
void someMethod(@NotNull someParameter) { }
[/code]
if you write something like:
[code]
someMethod(null);
[/code]
This won’t compile.
Last example using @Nullable
[code]
@Nullable iWantToDestroyEverything() { return null; }
[/code]
Doing this
[code]
iWantToDestroyEverything().something();
[/code]
And you can be sure that this won’t happen. 🙂
It’s a nice way to let the compiler check something more than it usually does and to enforce your contracts to be stronger. Unfortunately, it’s not supported by all the compilers.
In IntelliJ IDEA 10.5 and on, they added support for any other @Nullable @NotNull implementations.
See blog post More flexible and configurable @Nullable/@NotNull annotations.
See lessHow to open a PDF output directly when click of a SubmitButton in OAF ?
Hi Waqas, it's applicable by using Standard API [code]fnd_webfile.get_url (file_type => fnd_webfile.request_out, -- for output file. Use request_log to view log file ID => l_request_id, gwyuid => l_gwyuid, two_task => l_two_task, expire_time => 500 -- minutes, security!. );[/code] notRead more
Hi Waqas,
it’s applicable by using Standard API
[code]fnd_webfile.get_url
(file_type => fnd_webfile.request_out,
— for output file. Use request_log to view log file
ID => l_request_id,
gwyuid => l_gwyuid,
two_task => l_two_task,
expire_time => 500 — minutes, security!.
);[/code]
note : there are two profile options this API must take as following
l_gwyuid : Gateway User ID
[code]oadbtransactionimpl.getAppsContext().getEnvStore().getEnv(“GWYUID”)[/code]
l_two_task: Two Task(TWO_TASK)
[code]oadbtransactionimpl.getAppsContext().getEnvStore().getEnv(“TWO_TASK”)[/code]
you can register out parameter of calling this API to String variable then use
[code]pageContext.sendRedirect[/code]
Hope this helpful 🙂
How to to prevent other event handlers from executing after a certain event is fired ?
return false from within a jQuery event handler is effectively the same as calling both e.preventDefault and e.stopPropagation on the passed jQuery.Event object.e.preventDefault() will prevent the default event from occuring, e.stopPropagation() will prevent the event from bubbling up and return falRead more
return false from within a jQuery event handler is effectively the same as calling both e.preventDefault and e.stopPropagation on the passed jQuery.Event object.
e.preventDefault() will prevent the default event from occuring, e.stopPropagation() will prevent the event from bubbling up and return false will do both. Note that this behaviour differs from normal (non-jQuery) event handlers, in which, notably, return false does not stop the event from bubbling up
Source: John Resig
See lessHow to Put session parameter on link oracle OAF ?
Hello Aashish, There are three common means of passing parameters between pages : Request Transaction Session and you can use VO attributes for passing values Values stored in VO attributes are available in all pages within the transaction with same Root AM. URL Parameters : Encryption and EncodingRead more
Hello Aashish,
There are three common means of passing parameters between pages :
Request
Transaction
Session
and you can use VO attributes for passing values
Values stored in VO attributes are available in all pages within the transaction with same Root AM.
URL Parameters : Encryption and Encoding
When we are passing parameters in URL, following need to be considered:
[code]
See less{@Attr} – encodes. Changes Prince Kapoor to Prince%20Kapoor
{!Attr} – encrypts. Encrypts sensitive information.
{$Attr} – plain token substitution (no encoding or encryption)
{@@RETURN_TO_MENU} – Used for E-Business Suite Personal Home Page. Same as OAWebBeanConstants.RETURN_TO_MENU_URL.
{@@RETURN_TO_PORTAL} – Return the user to a launching Portal page. Same as OAWebBeanConstants.RETURN_TO_PORTAL_URL.
[/code]
what is the difference between “INNER JOIN” and “OUTER JOIN”?
Hi there,i found some answer you will understand it so easy.Assuming you're joining on columns with no duplicates, which is a very common case:An inner join of A and B gives the result of A intersect B, i.e. the inner part of a Venn diagram intersection.An outer join of A and B gives the results ofRead more
Hi there,
i found some answer you will understand it so easy.
Assuming you’re joining on columns with no duplicates, which is a very common case:
An inner join of A and B gives the result of A intersect B, i.e. the inner part of a Venn diagram intersection.
An outer join of A and B gives the results of A union B, i.e. the outer parts of a Venn diagram union.
Examples
Suppose you have two tables, with a single column each, and data as follows:
A B
– –
1 3
2 4
3 5
4 6
Note that (1,2) are unique to A, (3,4) are common, and (5,6) are unique to B.
Inner join
An inner join using either of the equivalent queries gives the intersection of the two tables, i.e. the two rows they have in common.
[code]SELECT *
FROM a INNER JOIN b ON a.a = b.b;[/code]
[code]SELECT a.*, b.*
FROM a, b
WHERE a.a = b.b;[/code]
a | b
–+–
3 | 3
4 | 4
Left outer join
A left outer join will give all rows in A, plus any common rows in B.
[code]select * from a LEFT OUTER JOIN b on a.a = b.b;
select a.*,b.* from a,b where a.a = b.b(+);[/code]
a | b
–+—–
1 | null
2 | null
3 | 3
4 | 4
Right outer join
A right outer join will give all rows in B, plus any common rows in A.
[code]select * from a RIGHT OUTER JOIN b on a.a = b.b;
select a.*,b.* from a,b where a.a(+) = b.b;[/code]
a | b
—–+—-
3 | 3
4 | 4
null | 5
null | 6
Full outer join
A full outer join will give you the union of A and B, i.e. all the rows in A and all the rows in B. If something in A doesn’t have a corresponding datum in B, then the B portion is null, and vice versa.
[code]select * from a FULL OUTER JOIN b on a.a = b.b;[/code]
a | b
See less—–+—–
1 | null
2 | null
3 | 3
4 | 4
null | 6
null | 5
How to query a CLOB column in Oracle SQL ?
Hi Albert, You can use DBMS_LOB.substr like this for example: DBMS_LOB.substr(column, 3000) but don't forget that substring of a CLOB column has size/buffer restrictions sometimes you would need to set the BUFFER to a larger size. For example while using SQL Plus use the SET BUFFER 10000 to set it tRead more
Hi Albert,
You can use DBMS_LOB.substr like this for example:
but don’t forget that substring of a CLOB column has size/buffer restrictions sometimes you would need to set the BUFFER to a larger size.
For example while using SQL Plus use the SET BUFFER 10000 to set it to 10000 as the default is 4000
and you can refer to Oracle Substr Function Article for more information about the substr function
See lessError ORA-00933: SQL command not properly ended – update
hello, here you can find the cause and action to correct your statement : Cause: The SQL statement ends with an inappropriate clause. For example, an ORDER BY clause may have been included in a CREATE VIEW or INSERT statement. ORDER BY cannot be used to create an ordered view or to insert in a certaRead more
hello,
here you can find the cause and action to correct your statement :
Cause: The SQL statement ends with an inappropriate clause. For example, an ORDER BY clause may have been included in a CREATE VIEW or INSERT statement. ORDER BY cannot be used to create an ordered view or to insert in a certain order.
Action: Correct the syntax by removing the inappropriate clauses. It may be possible to duplicate the removed clause with another SQL statement. For example, to order the rows of a view, do so when querying the view and not when creating it. This error can also occur in SQL*Forms applications if a continuation line is indented. Check for indented lines and delete these spaces.
you can use :
[code]
UPDATE employees e
SET e.last_name = ‘test’
WHERE e.department_id = (SELECT d.department_id
FROM departments d
WHERE d.department_id = e.department_id);
[/code]
How to Create the TKPROF Trace File in oracle ?
Hello , Solution : For the TKPROF a) tkprof rawtrace.trc output_file explain=apps/apps/sort=(exeela,fchela) sys=no b) rawtrace.trc: Name of trace file output_file: tkprof out file explain: This option provides the explain plan for the SQL statements sort: This provides the sort criteria in which allRead more
Hello ,
Solution :
a) tkprof rawtrace.trc output_file explain=apps/apps/sort=(exeela,fchela) sys=no
b) rawtrace.trc: Name of trace file
output_file: tkprof out file
explain: This option provides the explain plan for the SQL statements
sort: This provides the sort criteria in which all SQL statements will be sorted. This will bring the bad SQL at the top of the outputfile.
sys=no: Disables SQL statements issued by user SYS
Regards ,
Mahmoud Morsy
See lessHow to see lock on table and query?
Hi Mina , Try this query : [code] SELECT c.owner, c.object_name, c.object_type, b.sid, b.serial#, b.status, b.osuser, b.machine FROM v$locked_object a, v$session b, dba_objects c WHERE b.sid = a.session_id AND a.object_id = c.object_id AND xidsqn != 0; [/code] Regards , Mahmoud Morsy
Hi Mina ,
Try this query :
[code]
SELECT c.owner,
c.object_name,
c.object_type,
b.sid,
b.serial#,
b.status,
b.osuser,
b.machine
FROM v$locked_object a, v$session b, dba_objects c
WHERE b.sid = a.session_id AND a.object_id = c.object_id AND xidsqn != 0;
[/code]
Regards ,
Mahmoud Morsy
See less