SQL & PL/SQL :: How To Print All Prime Factors Of Given Number

Sep 3, 2012

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??

View 9 Replies


ADVERTISEMENT

How To Print Sql Query With Serial Number

Mar 27, 2007

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

View 2 Replies View Related

PL/SQL :: Print Number Within Trigger On Console

May 27, 2013

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]....

View 12 Replies View Related

SQL & PL/SQL :: Query To Get Total Points From Various Factors

Oct 20, 2011

I am trying to calculate the total points of each customer

create table Customers(Customer_no number,revenue varchar2(30),Regularity varchar 2(30)
);
insert into Customers values(1,'25','2');
insert into Customers values(2,'50','3');

Table customers:

Customer_no, revenue, regularity
1,25,2
2,50,3

create table Points(ponts ID number,Factor varchar2(30),Weight number);

insert into Points values(1,revenue,2);
insert into Points values(1,Regularity,4);

Table points
Points ID,Factor,Weight
1,revenue,2
1,regularity,4

So for customer_no: 1

revenue is 25 * 2(weight for revenue ) =50
regularity is 2*4(weight for regularity) =8
Total =58

So for customer_no: 2

revenue is 50 * 2(weight for revenue ) =100
regularity is 3*4(weight for regularity) =12
Total =104

View 8 Replies View Related

SQL & PL/SQL :: Print Ename And Salary Of Employee Using Employee Number As Input

Aug 11, 2013

/* Formatted on 2013/08/11 18:46 (Formatter Plus v4.8.8) */
CREATE PROCEDURE p_get_name (
p_empno IN OUT NUMBER,
p_name OUT VARCHAR2,
p_err OUT NUMBER
[code].......

Note:- I want to print ename and salary of emp using empno as a input but i dont want to declare extra variable for salary , i want to print salary using empno but when i execute this procedure. It gives value of empno in salary. Don't Know Why , how can i print salary of emp using empno as input without declaring extra variable for salary.

View 25 Replies View Related

SQL & PL/SQL :: Print No Results If More Than 10 Records Else Print The Output

Mar 24, 2011

I 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

View 1 Replies View Related

How To Add And Print In Sql

Apr 23, 2012

here 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

View 1 Replies View Related

SQL & PL/SQL :: How To Print Row Value In Column

Jul 20, 2010

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.............

View 3 Replies View Related

PL/SQL :: Output Print More Than 255

Jan 2, 2013

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?

View 3 Replies View Related

SQL & PL/SQL :: How To Print Even Numbers Without Using MOD Function

Mar 1, 2012

How to print even numbers 1 to 10.without using the MOD Function

View 17 Replies View Related

SQL & PL/SQL :: Print Columns Of A Table

Jul 5, 2013

DECLARE
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 .

View 6 Replies View Related

SQL & PL/SQL :: How To Print Data Between Two Dates

Oct 8, 2012

How to print data between two dates... startdate and enddate inclusive

View 2 Replies View Related

SQL & PL/SQL :: Print Update Confirmation?

Apr 13, 2013

I'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.

View 4 Replies View Related

Forms :: Print A Cheque?

Feb 10, 2011

want to print a cheque from my form

View 1 Replies View Related

SQL & PL/SQL :: Print Fibonacci Series

Nov 8, 2006

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?

View 4 Replies View Related

Reports & Discoverer :: How To Find Page Number And Total Number Of Pages

Jan 26, 2010

i am using oracle developer 6i report builder i required this type of query

example

if (:page number LIKE '1')
then
srw.set_text_color('darkred');
end if;

return (TRUE);
end;

but page number is not my table database item how can i use builtan page &<pagenumber> use for conditional format.

View 34 Replies View Related

SQL & PL/SQL :: Replacing 4 Digit Number In A Given String With The Same Number Incremented By 10000?

Jun 17, 2010

i want to replace 4 digit number in a given string with the same number incremented by 10000.

That mean in the given sting 1201 should be replace by 11201 (Icremented BY 10000).

Input String:

<query><matchAll>true</matchAll><row><columnId>1201</columnId><dataType>31</dataType><op>Like</op><val>North America - Houston</val></row><row><columnId>1212</columnId><dataType>31</dataType><op>!=</op><val>Agreement Date Mismatch</val></row><row><columnId>1212</columnId><dataType>31</dataType><op>!=</op><val>Facility Type Mismatch</val></row><row><columnId>1224</columnId><dataType>31</dataType><op>Like</op><val>y</val></row></query>

Required output :

<query><matchAll>true</matchAll><row><columnId>11201</columnId><dataType>31</dataType><op>Like</op><val>North America - Houston</val></row><row><columnId>11212</columnId><dataType>31</dataType><op>!=</op><val>Agreement Date Mismatch</val></row><row><columnId>11212</columnId><dataType>31</dataType><op>!=</op><val>Facility Type Mismatch</val></row><row><columnId>11224</columnId><dataType>31</dataType><op>Like</op><val>y</val></row></query>

View 7 Replies View Related

SQL & PL/SQL :: Extract Number And Previous Character From Where 5 Digit Number Starting

Oct 21, 2011

I have a text field and if the text field has 5 consecutive numbers then I have to extract the number and the previous character from where the 5digit number starting

For example i/p asdfasfsdS251432dasdasd o/p should be S251432

View 10 Replies View Related

Express Edition (XE) :: Why Maximum Number Of Voting Disk Is Even Number (32)

Oct 3, 2013

I gone through many forums and found that the number of voting disks should be always in odd number. Then why the maximum number of voting disk is 32?

View 1 Replies View Related

Print Mismatch Values From Two Tables?

Nov 6, 2012

I'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.

View 4 Replies View Related

Forms :: How To Print Next Record Value In Oracle 10g

Jun 28, 2010

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 Related

Reports & Discoverer :: How To Print Into Two Pages

Jul 6, 2010

I 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 Related

SQL & PL/SQL :: Print Data From A Clob In XML Format?

Sep 11, 2013

I 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?

View 13 Replies View Related

Forms :: USB Finger Print Reader

Jun 17, 2013

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 Related

SQL & PL/SQL :: How To Print Rows Into Column Data

Sep 24, 2010

I 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?

View 1 Replies View Related

Precompilers, OCI & OCCI :: Print Run Time Value?

Apr 26, 2012

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 Related

Forms :: How To Print Ampersand In Title

Apr 30, 2013

How 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

View 1 Replies View Related

SQL & PL/SQL :: Count A List Of Number Value And Find Maximum Number?

May 21, 2010

how do I count a list of number value eg 1,1,1,1,3,3,6,4 and find the one with maximum number which is 1

View 5 Replies View Related

Print Out All Triggers / Procedures From Oracle 9iForms

Dec 15, 2011

I need to print out all the triggers/procedures from an Oracle 9iForms. When I open an Oracle 9iform in the Oracle form builder, I click on FILE/CONVERT but cannot see the triggers/procedures.

View 2 Replies View Related

SQL & PL/SQL :: How To Pass Parameter To Cursor And Print Details

Aug 15, 2010

Create a PL/SQL block that declares a cursor called DATE_CUR. Pass a parameter of DATE data type to the cursor and print the details of all the employees who have joined after that date.

DEFINE P_HIREDATE = 08-MAR-00

Test the PL/SQL block for the following hire dates: 08-MAR-00, 25-JUN-97, 28-SEP-98, 07-FEB-99.

I don't know how to pass parameters. So far I have this:

SET serveroutput ON;
DECLARE
p_HIREDATE DATE := 08-MAR-00;
CURSOR c_DATE_CUR(P_HIREDATE DATE) IS
BEGIN
OPEN c_DATE_CUR();

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved