Showing posts with label sql. Show all posts
Showing posts with label sql. Show all posts

Wednesday, January 20, 2016

How to execute procedure on TOAD editor Oracle SQL?

declare
test1 varchar(32000);
begin PACKAGE.PROCEDURE('DEC-13',1041,'VALUE',test1);
DBMS_OUTPUT.PUT_LINE(test1);
end;


PACKAGE.PROCEDURE(p_param1 IN VARCHAR2,
                                 p_param2 IN NUMBER,
                                 p_param3 IN VARCHAR2 p_param4 OUT VARCHAR2)
//init
begin
for loop

end loop;
end;


 set SERVEROUTPUT ON
 declare v_period varchar2(10):='1';
      begin
   --   fnd_profile.get( 'BRVO_PL56_PERIOD', v_period );
      DBMS_OUTPUT.PUT_LINE(v_period);

      end;

Friday, April 25, 2014

Using Partition Over in Oracle

SELECT ID, OTHER_ID, DATE_VALUE, ROW_NUMBER() OVER (PARTITION BY OTHER_ID ORDER BY DATA_VALUE desc) R,COUNT(*) OVER (PARTITION BY OTHER_ID) FROM SOME_TABLE


**Row_Number gives the row number of the row in a table after partition by other_id
**Count(*) gives the count value of the rows partitioned by other_id

Thursday, February 27, 2014

How to insert data into a table on Oracle database

       
INSERT INTO TABLE_NAME (Column1, Column2, Column3)

     Select TABLE1_SEQ.NEXTVAL, NewColumn2, NewColumn3

  FROM TABLE1  WHERE Column4 IN (X,Y) AND SomeCondition;