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
ADVERTISEMENT
Jul 1, 2013
DECLARE
JOBSFILE UTL_FILE.FILE_TYPE;
-- TAKE ALL JOB TITLES FROM JOBS
CURSOR JOBSCUR IS
SELECT *
-- DDOCNAME,DDOCTITLE,DSECURITYGROUP,DDOCAUTHOR,DDOCTYPE,DINDATE,PRIMARYFILE,EXTRACTIONDATE,BATCH_ID
FROM TARGET_UCM ;
[code].......
this is my plsql here to print table values i am using many utl_file.put_line statements is there any way to print all table values in a single utl_file.put_line.
View 2 Replies
View Related
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
Aug 4, 2010
Is it possible to print the output of a sql query in Excel format without using third party tools like Toad, Hora or any front end Application.
View 10 Replies
View Related
Dec 9, 2011
I am stuck with this query.
I have a table "xyz" as -->>
SQL> select * from xyz;
A B
---------- ----------------------------------------
1 Hello
2 Hello
3 No Hello
4 No Hello
5 Hello
6 Hello
7 Hello
I want to print the output of this table as -->>
A B
---------- ----------------------------------------
1
2 Hello
3
4 No Hello
5
6
7 Hello
To make it more clear, I just want that whenever the value f column "B" changes then only its value should be printed, else it should be NULL. And if "B" has same value for all the records then the value of "B" should be printed at the last.
Either of SQL or PLSQL would d for me.
View 11 Replies
View Related
Jan 26, 2012
create table a_user
(
u_name varchar2(30)
, grp varchar2(30)
)
;
INSERT INTO a_user VALUES ('abc', 'new');
[code].....
sql:
SELECT
a.grp
, a.g_tot
FROM a_user b
,
(
SELECT
[code].....
getgrpname is a function to get grp when I input the u_name
Now I want to create a proc to display the output from the sql when I give the p_u_name as input. I am thinking some thing like this:
create or replace procedure get_u_name_data (p_u_name IN VARCHAR2, rc_data OUT SYS_REFCURSOR) IS
IS
BEGIN
OPEN rc_data FOR
SELECT
a.grp
[code].....
how to print output in SQL developer
View 2 Replies
View Related
Jan 24, 2012
When i run the below mentioned query(similar query)on TOAD. It will run without any errors and i can see "PL/SQL Procedure successfully completed" in the task bar.....
However i am unable to see the output for the query.
print the the query output on TOAD ....
**** Sample Query Starts *****
DECLARE
i PLS_INTEGER;
BEGIN
SELECT NVL(i, 93)
INTO i
FROM DUAL;
--print i;
--dbms_output.put_line('i1: ' || i);
END;
**** Sample Query Ends*****
**** Actual Query Starts *****
-----------------------------------------------------------------
DECLARE
UnxDate number(6);
MyResult number(6);
Todaysdate date := TO_DATE('17-01-2012 00:00:00','dd-mm-yyyy hh24:mi:ss');
BEGIN
SELECT ROUND (Todaysdate - TO_DATE('01-jan-1970','dd-mon-yyyy') ) INTO UnxDate FROM dual;
[code]......
View 9 Replies
View Related
Apr 19, 2007
In Sales Order Form there is a print receipt button. In current situation On Clicking the 'Print Receipt Button' it submits a XML Publisher report(PDF output) to the concurrent manager. Currently to print that report i need to go view--> requests--> view output and then print. According to my new Requirement i need to print that report directly to local printer on one simple Print receipt button click in form.
I am trying to call the printers on server using custom.pll. The report is running successfully but it is not printing output to the local printer. I need to print the report to the local printers based on responsibility. Local printers are available on apps server.
Is it possible to print the document using custom.pll? Is there any other alternative to print the report on simple button click in form.
I searched many forums but i found customizations on form level. I am trying to customize the form using custom.pll. I found many examples like URL..... but i don't think i can use these practices in custom.pll. ADD_PARAMETER & RUN_PRODUCT dont work in custom.pll. I need to complete this requirement immediately.
Environment: Apps 11.5.10.2, Forms 6i
Here is the code that i am using in my custom.pll.
if (v_form_name = 'OEXOETEL' --and v_block_name = 'LINES_SUMMARY'
and name_in('parameter.ACTIONS') = 'PAYMENT_RECEIPT' )THEN
l_organization_id := Name_In('PARAMETER.OE_ORGANIZATION_ID');
l_order_header_id := Name_In('ORDER.header_id');
select to_number(oe_sys_parameters.value ('SET_OF_BOOKS_ID')) into l_sob_id from dual;
xml_layout := FND_REQUEST.ADD_LAYOUT('XXAFP','XXAFPOEXPMTRCRTF','en','US','PDF');
[code]....
View 2 Replies
View Related
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
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
Mar 1, 2012
How to print even numbers 1 to 10.without using the MOD Function
View 17 Replies
View Related
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
Oct 8, 2012
How to print data between two dates... startdate and enddate inclusive
View 2 Replies
View Related
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
Feb 10, 2011
want to print a cheque from my form
View 1 Replies
View Related
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
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
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
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
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
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
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
View Related
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
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
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
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
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
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
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
Mar 25, 2010
I installed a printer(HP Laserjet 3390) in UNIX(Solaris).Followed the instructions while installing as to the path it should be present for Reports to read it etc.,Also modified the uiprint.txt file with the desired .hpd file.Logging on to the UNIX machine, I am using the below command
rwrun.sh report=xyz.rdf userid=XXXX/XXX@xxx paramform=no p_orig_org='0825' desformat=pdf destype=printer desname=xxxx batch=yes
This command invokes the printer and
^[%12345X@PJL
@PJL SET RESOLUTION=300
@PJL SET PAGEPROTECT=OFF
@PJL SET ENTER LANGUAGE=PCL
^[%1A^[E^
@PJL RESET
^[%12345X
is what it prints.Realizing that this is because of the missing parameter,tried to change paramform=yes but I am not sure how to pass the parameter.
View 11 Replies
View Related