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.
Is it Possible to Migrate Blanket PO’S in Closed Status Like Standard PO’S?
Hi, Where you need to migrate exactly ? and if their status's is closed why you need them ? Regards.
Hi,
Where you need to migrate exactly ? and if their status’s is closed why you need them ?
Regards.
See lessHow to remove duplicate rows by where condition ?
you can use : [code] SELECT * FROM test_table WHERE number_col NOT IN (SELECT number_col FROM test_table GROUP BY number_col HAVING count (*) > 1) [/code]
you can use :
[code]
See lessSELECT *
FROM test_table
WHERE number_col NOT IN (SELECT number_col
FROM test_table
GROUP BY number_col
HAVING count (*) > 1)
[/code]
How to to check old and new values for item in Oracle Form ?
to get the database value there is one property (database_value) and here is the example to achieve this: [code] BEGIN IF :BLOCK.ITEM = GET_ITEM_PROPERTY('BLOCK.ITEM', database_value) THEN RETURN; END IF; END; [/code] sometimes this property return value (0) if so you can use another way : -take theRead more
to get the database value there is one property (database_value) and here is the example to achieve this:
[code]
BEGIN
IF :BLOCK.ITEM = GET_ITEM_PROPERTY(‘BLOCK.ITEM’, database_value) THEN
RETURN;
END IF;
END;
[/code]
sometimes this property return value (0) if so you can use another way :
-take the value in the pre text item trigger and keep it in global
– as about this value in when validate item trigger and so on
hope this may help you 🙂
See lessHow to return N of rows after ordering in oracle sql ?
You can use a subquery for this like [code] select * from ( select * from emp order by sal desc ) where ROWNUM <= 5; [/code] Starting from Oracle 12c R1 (12.1). there is a syntax available to limit rows or start at offsets (full syntax here) example : [code] SELECT * FROM employees ORDER BY salarRead more
You can use a subquery for this like
[code]
select *
from
( select *
from emp
order by sal desc )
where ROWNUM <= 5;
[/code]
Starting from Oracle 12c R1 (12.1). there is a syntax available to limit rows or start at offsets (full syntax here)
example :
[code]
SELECT *
FROM employees
ORDER BY salary
OFFSET 20 ROWS FETCH NEXT 10 ROWS ONLY;
[/code]
hope this helpful 🙂
See lessHow dbms_assert protects against SQL injection ?
The dbms_assert package is used in databases that don't employ bind variables to help prevent SQL injection attacks, by "sanitizing" the SQL. it has several procedures inside ex : simple_sql_name: Validates the syntax of the SQL to ensure that the SQL statement only contains valid characters and proRead more
The dbms_assert package is used in databases that don’t employ bind variables to help prevent SQL injection attacks, by “sanitizing” the SQL.
it has several procedures inside ex :
and this a simple example of using (dbms_assert.simple_sql_name)
[code]CREATE OR REPLACE PROCEDURE oraask_test (tbl_name VARCHAR2, col_name VARCHAR2)
IS
qry VARCHAR2 (500);
BEGIN
qry := ‘ALTER TABLE ‘ || dbms_assert.simple_sql_name ( :tbl_name) || ‘ ADD ‘ || :col_name || char (1);
EXECUTE IMMEDIATE qry USING col_name;
See lessEND oraask_test;[/code]
How to validate phone number with specific format and fixed length ?
hello, you can use Format mask item property, it will handle the length along with format validation. you may enter this format mask ex: [code] 9"-"999"-"999"-"9999 [/code]
hello,
you can use Format mask item property, it will handle the length along with format validation. you may enter this format mask ex:
[code]
See less9″-“999”-“999”-“9999
[/code]
Can i INSERT or UPDATE a table through a view ?
Hello Beter, Views in Oracle may be updateable under specific conditions. It can be tricky, and usually is not advisable. From the Oracle 10g SQL Reference: Notes on Updatable Views An updatable view is one you can use to insert, update, or delete base table rows. You can create a view to be inherenRead more
Hello Beter,
Views in Oracle may be updateable under specific conditions. It can be tricky, and usually is not advisable.
From the Oracle 10g SQL Reference:
Notes on Updatable Views
An updatable view is one you can use to insert, update, or delete base table rows. You can create a view to be inherently updatable, or you can create an INSTEAD OF trigger on any view to make it updatable.
To learn whether and in what ways the columns of an inherently updatable view can be modified, query the USER_UPDATABLE_COLUMNS data dictionary view. The information displayed by this view is meaningful only for inherently updatable views. For a view to be inherently updatable, the following conditions must be met:
In addition, if an inherently updatable view contains pseudocolumns or expressions, then you cannot update base table rows with an UPDATE statement that refers to any of these pseudocolumns or expressions.
If you want a join view to be updatable, then all of the following conditions must be true:
Can I use If statement inside Where clause in oracle SQL?
hello oracle user, you can use CASE statement same like IF ex: [code] WHERE e.status = (CASE WHEN status_flag = STATUS_ACTIVE THEN 'A' WHEN status_flag = STATUS_INACTIVE THEN 'T' ELSE null END) AND e.business_unit = (CASE WHEN source_flag = SOURCE_FUNCTION THEN 'production' WHEN source_flag = SOURCERead more
hello oracle user,
you can use CASE statement same like IF ex:
[code]
See lessWHERE e.status = (CASE WHEN status_flag = STATUS_ACTIVE THEN ‘A’
WHEN status_flag = STATUS_INACTIVE THEN ‘T’
ELSE null END)
AND e.business_unit = (CASE WHEN source_flag = SOURCE_FUNCTION THEN ‘production’
WHEN source_flag = SOURCE_USER THEN ‘users’
ELSE null END)
[/code]
How to handle a unique constraint exceptions in PL/SQL code?
hello, you can use exception : [code] EXCEPTION WHEN DUP_VAL_ON_INDEX [/code]
hello,
you can use exception :
[code]
See lessEXCEPTION
WHEN DUP_VAL_ON_INDEX
[/code]
How to rollback oracle sequence value ?
There is no way to rollback the generated sequence. To restart the sequence at a different number, you must drop and re-create it. See http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_2011.htm. If you change the INCREMENT BY value before the first invocation of NEXTVAL, some sequenceRead more
There is no way to rollback the generated sequence.
To restart the sequence at a different number, you must drop and re-create it. See http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_2011.htm.
If you change the INCREMENT BY value before the first invocation of NEXTVAL, some sequence numbers will be skipped. Therefore, if you want to retain the original START WITH value, you must drop the sequence and re-create it with the original START WITH value and the new INCREMENT BY value.
See less