Declare
type v_year_arr is varray(100) of emps%rowtype;
v_deptid emps.department_id%type :=90;
v_rem1 number(5,2);
v_rem2 number(5,2);
v_rem3 number(5,2);
v_year v_year_arr;
Begin
select * bulk collect into v_year from emps where department_id = v_deptid;
v_rem1 := MOD(v_year.yof,4);
v_rem2 := MOD(v_year.yof,100);
v_rem3 := MOD(v_year.yof,400);
for i..v_year loop
If (v_rem1=0 and v_rem2=0 and v_rem3=0)
then
DBMS_OUTPUT.PUT_LINE('Leap year :'||v_year.yof);
else
DBMS_OUTPUT.PUT_LINE('Not a Leap year :'||v_year.yof)
End if;
end loop;
end;
getting ORA-06550 error
82 Views Asked by user2664165 At
1
There are 1 best solutions below
Related Questions in PLSQL
- PLSQL Need REFCURSOR DATE + TIME
- PL SQL After Delete Trigger Not Inserting Record
- Oracle stored procedure wrapping compile error with inline comments
- How to compare multiple columns under same row in a table?
- How to find out which procedures and functions are using a table?
- How to display image in oracle form
- Oracle 11g : staging table
- 04098. "trigger '%s.%s' is invalid and failed re-validation"
- PL/SQL Check if SYSDATE is between two DATETIMES "HH24:mi"
- UTL_file: continue reading even if it encounters blank rows
- add time (char(8)) to date column
- if x not in(select y from table) in oracle
- Generate random ROWID
- Get same day of the same week last year
- Call procedure using anonymous block in pl/sql?
Related Questions in ORACLE10G
- Insert Into SP in Oracle Sql Developer
- use select under case statement
- How to execute a oracle procedure having out parameter inside a unix script
- How to check if there exist only one record for a certain Id
- Full Join on Group
- org.hibernate.HibernateException: Dialect class not found when using custom Dialect
- How to limit dynamic queries to only accept select statements?
- iText on a 10G database (1.4 JVM) generates a stacktrace
- How do you implement auto incremented sequence values in Oracle PL/SQL?
- Why I can't compare dates?
- ORA-12700: invalid NLS parameter value. (nls_numeric_characters)
- How to select record which are not between two time-Seconds range in ORACLE
- sequence already created but error showing RA-02289: sequence does not exist
- Oracle sql: Convert column to row
- PL/SQL - Update multiple rows in the target table from one row in the source table
Related Questions in VARRAY
- Adding elements in a Varray
- Access a varray type defined inside a package using oci_new_collection
- Pass varray variables into stored procedure - basic
- I want to insert a column values of a table into varray collection in PL/SQL
- How to count the number of elements in all Oracle varrays from table?
- ORA-06532: Subscript outside of limit
- To get the exact amount of data between specific date range and insert in table in oracle plsql procedure using varray type collection
- How to insert the comma separated value in table
- PLSQL user defined table types and joins
- How to execute procedure with input parametr (Varray OF INT)?
- Convert VARRAY to text (for concatenation)
- Oracle change column datatype from varray
- how to create a function to print the sum of all salaries of employees, maximum salary and minimum salary from a table using pl/sql function
- getting ORA-06550 error
- Can I accept values in a VARRAY in PL/SQL directly from the user?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I think you'd be better off writing this using a cursor FOR loop, as in:
This eliminates the potential problem of having more than 100 rows returned by the
SELECT...BULK COLLECT INTO...statement. I also took the liberty of correcting your leap year determination.Share and enjoy.