SQL & PL/SQL :: Print Fibonacci Series
Nov 8, 2006I want to print Fibonacci Series like :-
0,1,1,2,3,5,8,13,21,34..........
How can i do it.Can i do it by procedure or function?
I want to print Fibonacci Series like :-
0,1,1,2,3,5,8,13,21,34..........
How can i do it.Can i do it by procedure or function?
I have a query that selects multiple series for a bar chart (I have defined only one chart series, and have 3 columns selected to represent 3 series). The series display on Bar Chart is fine. Now I want to create a separate link target depending on which series is clicked on the chart. I am not able to do this.
View 1 Replies View RelatedI have this SQL statement:
WITH data
AS (SELECT user_id,
jc_name,
[Code]....
I wish to do something like
if results > 10 print an error message (and no results)
if results < 10 print the results/output
i have a data something like
010030
110495
210960
311425
[code]...
and user enters the figure like 13025now i would like to find the closest next value to the number entered by user, which is 713285 .how can i get this result, i have search a lot on Internet and i found some analytic functions can work out. but don't know how ..
I need to find a query to create a gap in continuous series. So that i can fill this gap with a new record.
Attached here is the test sql.
Sample Data is
test@orcl>select * from sales_mst;
NO VDATE T
---------- --------- -
1245 07-JAN-13 N
1246 07-JAN-13 N
1247 07-JAN-13 R
1248 07-JAN-13 N
[code]...
10 rows selected.
test@orcl>select * from sales_dtl;
NO CODE QTY RATE
---------- ---------- ---------- ----------
1245 11 60 600
1246 12 55 450
1246 11 45 600
1247 13 50 250
1247 11 60 600
1248 11 45 600
1249 12 55 450
[code]...
16 rows selected.
Required Out Put
test@orcl>select * from sales_mst;
NO VDATE T
---------- --------- -
1245 07-JAN-13 N
1246 07-JAN-13 N
1247 07-JAN-13 R
1248 07-JAN-13 N
1251 08-JAN-13 N
1250 08-JAN-13 R
1253 08-JAN-13 N
1252 09-JAN-13 R
1254 09-JAN-13 N
1255 09-JAN-13 N
10 rows selected.
test@orcl>select * from sales_dtl;
NO CODE QTY RATE
---------- ---------- ---------- ----------
1245 11 60 600
1246 12 55 450
1246 11 45 600
1247 13 50 250
1247 11 60 600
1248 11 45 600
1251 12 55 450
1251 11 45 600
[code]...
16 rows selected.
Update or move only those records which have Type 'N'. I have tried the following query but it is giving me an error.
test@orcl>ALTER TABLE
sales_dtl
DISABLE CONSTRAINT
fk_sales_dtl_no;
test@orcl>update sales_mst set no=no+1 where type='N' and vdate > '07-JAN-13';
*
ERROR at line 1:
ORA-00001: unique constraint (TEST.PK_SALES_MST_NO) violated
provide SQL query (not PL/SQL block) for the following. I have data in table as shown below
Serial No value
========= ========
123
2-99
3-99
4-99
534
656
77
88
990
1065
1167
12-99
13-99
14-99
15-99
16-99
17-99
182
1945
206
The output of the SQL will be the largest consecutive series of the value -99 is 6 and total count of the value -99 is 9
In SQL plus
<SQL>
i need to repeat last six or seven commands instead of typeing
is there any command to using arrow keys o backward and forward last typing comamnds
i know / to execute last command
how to do that in SQL plus.
whether the overlapping Multiple series charts are possible in Oracle APEX or not .
I am trying to create two graphs for two data sets , one as marker and another as line , but its giving me issues such as
1) X axis is taking all the points of the first series suppose(
1,5,10,180) itsplotting these first . and its then starting labeling
the x-axis for another one which has values like
(20,50,100,1000,15000)
so my X-axis is now ---> 1,5,10,180, 20,50,100,10000,150000
In case i make my marker chart series as the 2nd sequence , then its drawing all the markers on the right side of the chart .
[URL].........
Workspace:- NR_WORKSPACE
Username:-user1
password:- H123$
whether this thing is achievable in oracle apex or not , is there any work around ?
issue with my apex line chart. The scenario is as follows: have a table called revenue. revenues per year are saved in it. and revenues are generated from three sources which are also saved in the same table. I have made a line chart on it. works well.
Now I have to show that if the value of one of the sources had fallen, how must have it affected the total. I made a number field that takes an estimated change value, and build my sql query with it. it works but the problem is that it changes the non-affected source too. it must change the value of the affected source only and hence the total value.
bold or I will put it this way, how can I write a select statement for a chart series so that one of the rows value does not change and the other two change.
I am using apex 4.1, i created a chart with 4 series in each series i am calculating sum of the no.of students joining in different classes of a institute for every year.
example my table is like this
date_of_join class student_id
'07/22/2012' 8 1
'07/22/2011' 8 2
'07/22/2009' 8 3
'07/22/2012' 7 4
'07/22/2010' 7 5
'07/22/2011' 6 6i wrote query like
series1
select null as link,UNISTR('�0A0') || to_char(date_of_join,'YYYY'),count(student_id) "class 8" from stdent_record where class=8 group by to_char(date_of_join,'YYYY') order by to_char(date_of_join,'YYYY')
series2
select null as link,UNISTR('�0A0') || to_char(date_of_join,'YYYY'),count(student_id) "class 7" from stdent_record where class=8 group by to_char(date_of_join,'YYYY') order by to_char(date_of_join,'YYYY')but what happened is the x-axis is coming in order like
2009 2011 2012 2010because the series1 no student is joined in 2010 so its taking the series1 order but i need the years in normal order.
Would like to know the execution series of an application(From a particular screen) through Oracle trace events.
View 1 Replies View Relatedhere is my code it prints data for 1 perticular date.
instead of it printing
1
3
3
1
3
1
13
0
3
0
0
1
1
1
0
5
for whole day
I want it to add and print the total
here is code
SELECT O_ESBY_SUM.CALLS
,O_ESBY_SUM.ROWDATECREATED
FROM OB.O_ESBY_SUM O_ESBY_SUM
where To_Date(to_char(O_ESBY_SUM.CALLS.ROWDATECREATED, 'DD-MON-YYYY')) = To_Date('?DATE1::?','MM/DD/YYYY')
it prints this
for date 4/19/2012
here is screen shot
I have table and data like
Name
-----------------
A,B,C,D,E
I would like to print the value like
Name
------------------
A
B
C
D
E
how to do this using SQL or PL/SQl.............
I am getting an error while printing a sql query which is in a string inside a stored proc. I used
dbms_output.enable(1000000);
dbms_output.put_line(v_query);
and error "I get ORU-10028: line length overflow, limit of 255 bytes per line"
How do I print everything?
How to print even numbers 1 to 10.without using the MOD Function
View 17 Replies View RelatedDECLARE
JOBSFILE UTL_FILE.FILE_TYPE;
CURSOR JOBSCUR IS
SELECT *
-- DDOCNAME,DDOCTITLE,DSECURITYGROUP,DDOCAUTHOR,DDOCTYPE,DINDATE,PRIMARYFILE,EXTRACTIONDATE,BATCH_ID
FROM TARGET_UCM ;
BEGIN
JOBSFILE := UTL_FILE.FOPEN('FILES','JOBS.TXT','W');
UTL_FILE.PUT_LINE(JOBSFILE,'Action = insert');
FOR REC IN JOBSCUR
[code]....
is there anyway to print the values of full table .i have used all column names to print .
How to print data between two dates... startdate and enddate inclusive
View 2 Replies View RelatedI'm trying to create an output statement that will show that the update was successful, but everything that I'm trying doesn't seem to be working.
I have a procedure and an anonymous block that calls on the procedure.
So far after the begin in my anonymous block I have.
BEGIN
procedure_name(variable1, variable2);
dbms_output.put_line('Successfully Updated');
END;
Now I know that the procedure and the anonymous block without the dbms output works as the update takes place in the table, but I can't get any text string output to confirm this.
want to print a cheque from my form
View 1 Replies View RelatedI've 2 identical tables of 300+ columns each,and each of table is having pk as combination of 2 fields.There are some fields where data is not matching. need a query which will use these two tables and return the following-
1. primary key columns
2. null value for fields where data is matching
3. data for columns where there is data mismatch.
How can i print serial no of records in sql query? I know I can achieve this with selecting rownum but it gives wrong data if used with group by like below
select rownum,deptid from emp group by rownum,deptid order by rwnum
I am using oracle forms10g here i have next button. So when i click the next button it will show the total volumn of record count and each record value for example 1/10 like that.
View 9 Replies View RelatedI am creating report a using emp table .There are 14 rows in emp table , i want to print output into two pages . If i set FILTER TYPE Property to 5 ,it only shows 5 records .
View 2 Replies View RelatedI want to print data from a clob in XML format and use the following
PROCEDURE printClobOut(result IN OUT NOCOPY CLOB) is
xmlstr varchar2(32767);
line varchar2(32767);
cnt NUMBER;
[Code]...
However the length of the clob is 13832630 which is too large for a VARCHAR2. Thus my output of line is cut off at 4000 characters. How can i increase this... Do i overlook something here in my code?
print the list of prime factors of a given number create or replace FUNCTION prime (num in number)
return sys_refcursor
as
i number := 2;
temp number := num;
temp_cur sys_refcursor;
BEGIN
open temp_cur;
[code]....
Quote:gives error -->>expression is of wrong type @ open temp_curur;
how to print all the prime factors of a given number??
I have my own design employee time attendance application which i design in oracle forms 6i and oracle database 9i. Now I bought one USB fingerprint reader so I can attached this device to my application. I want every employee to scan there finger in my reader and I will record there attendance. How I can configure this device in my form.
View 1 Replies View RelatedI have a table emp having data as
empno ename sal deptno
1001 manoj 1000 10
1001 sachin 2000 20
1003 manoj 30000 30
Now I wanted to write a query which will display the results like below. Row data need to be display in the columns
empno ename sal deptno 1001 manoj 10 20 1003 30
1001 manoj 1000 10 1001 manoj 10
1001 sachin 2000 20 1001 sachin 20
1003 manoj 30000 30 1003 manoj 1003 30
How to print the rows into column data?
I am inserting empno in a table1 and updating another table2 using table1 empno and getting ora-01427 error. I want to print empno for whis this error is coming. How to print that value?
View 1 Replies View RelatedHow to print ampersand & in Oracle report from the parameter.
If give paramter 'Title of the report Profit & Loss'
it Print:-Title of the report- Profit & Loss
If give paramter Title of the report- Profit & Loss(without single code)
it Print:-Title of the report- Profit
My oracle database version : 10G
I have the following code on my employees table, lets say I fire an update on my employees table and in return 6 rows gets updated, I want to print this number within my trigger on the console, I have put a comment in my code where I want to achieve this.
<code>
create or replace trigger trig_employees_au
after update on employees
declare
Linst_file utl_file.file_type;
[code]....