SQL & PL/SQL :: Not Showing Proper Result When Report Taken For All Codes Available In Table
Nov 26, 2010
I am trying to build a report.My query is working fine when i take out this report for a single area_code.But it is not showing proper result when report is take for all are_code's available in table.I have used two tables transactions and balance
create table transactions ( glcode varchar2(10), area_code varchar2(10), debit number,credit number );
insert into transactions values(2000,'ap',200,200);
insert into transactions values(3000,'ap',222,222);
insert into transactions values(4000,'ap',123,123);
insert into transactions values(2000,'dp',200,200);
insert into transactions values(3000,'dp',222,222);
insert into transactions values(4000,'dp',123,123);
insert into transactions values(2000,'pp',200,200);
insert into transactions values(3000,'pp',222,222);
insert into transactions values(4000,'pp',123,123);
[code]....
View 6 Replies
ADVERTISEMENT
Aug 22, 2012
I am using apex 4.1 and database as oracle 11g. I uploaded images and stored in table structure as shown below
>>CREATE TABLE "HR_EMPLOYEE_DETAILS"
>> ( "ID" NUMBER,
>> "HR_ID" NUMBER NOT NULL ENABLE,
>> "PHOTO_BLOB" BLOB,
>> "MIME_TYPE" VARCHAR2(64),
>> PRIMARY KEY ("ID") ENABLE
>> )
My Requirement is to show the image in a report region as well as in a html region. I followed the methods in the URL links mentioned below.
[URL].......
[URL]........
But the image is not getting populated in the region, I tried with display_item with image i am able to view the image using this item.
View 19 Replies
View Related
Oct 8, 2010
am facing a Problem in creating display items .First I create a display item and name it ITEM6This Display item will show Department name of employees .I create a Block Level Trigger to invoke this display item .
WHEN-VALIDATE-ITEM
select dname into :ITEM6 FROM DEPT where :EMP.DEPTNO=DEPT.DEPTNO;
In Property Palette I edit following
Data Type : char
canvas :canvas4
Then I save ,compile and Run it successfully .But when i press Execute Query button . It shows me Following error message .
SELECT ROWID,ITEM6,EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO FROM scott.emp
ORA-00904: "ITEM6": invalid identifier
View 2 Replies
View Related
Dec 12, 2011
I have a report and require the output in xls/xlsx (Excel) format. Currently following properties under System Parameters in Report Builder 6i have been made
Desname = The path for e.g: \C:sz-serverc$ihelp_workingxls
pt_sample_report.xls
Desformat = Delimited
Destype = File
The rest parameters has default settings I have not changed any of the rest User parameter.The report comes up in excel format but totally in distorted manner. i.e; All the column names of report are displayed first in vertical format followed by actual rows for the report.
The requirement is like this
[Select all] [Show/ hide]
Student ID Student Name Fathers Name Guardian Name
1 sample1 sample2 sample3
2 sample4 sample5 sample6
And it is displaying like this
Student ID Student Name Fathers Name Guardian Name 1 sample1 sample2 sample3
Student ID Student Name Fathers Name Guardian Name 2 sample4 sample5 sample6
View 2 Replies
View Related
May 3, 2012
getting proper value from the file in external table.
How can I get the whole status in STATUS column like completed , Inprogress, incompleted.
Right now, if I gave position like (38:9) full status doesn't show. if I give (38:11) then '|1' is adding in status from the flat file.
BATCH_NO FILE_DATEEMP_ID COMPANY_ID TRANSACTIN_ID FILE_NAME STATUS DOC_NO
10000104252012100001***4252012**1:35:57***D100001***04252012***10:35:57***Diverified
[Code].....
View 3 Replies
View Related
Feb 8, 2012
I have to create the matrix report which shows calender. Looks Like this.
View 14 Replies
View Related
May 31, 2013
I have a classical report with a column as "Affirmation Status". This column can take three value as "Affirmed, Rejected or NA". My requirement is I have to show all row in one color like red wherever it has value affirmed, and all row in color like green wherever it is rejected.
View 4 Replies
View Related
Sep 20, 2013
I've created a classic report that sums a couple of columns in two different regions:(Why can't I insert an image?)This is a simple example:
Region1col1 col2 col3 col4 col5 a b 20 5 25%c d 40 4 10%e f 120 6 5%report total: 180 15 x Region 2col1 col2 col3 col4 col5 g h 30 6 20%i j 70 14 20%report total: 100 20 yMy
How do I access the values generated by APEX (in bold) so that I can use them in further calculations? e.g. create a grand total from both regions
2) Having calculated a value, assuming 1 above is possible, how do I insert it at position x or y? e.g I want to calculate a % so that x would be 8.33% and y 20%
3) How do I change the words report total
View 2 Replies
View Related
May 23, 2012
TABLE 1 : COSTS
I have a table of Costs. We have Jobs that run and there will be a cost associated with a particular machine.So JobNo 1 may run on Machine A and have a cost of 50 dollars. Although its now shown below JobNO 1 could run on MachineB and so on.
JOBNO MACHINE COST
1 MachineA 50
2 MachineA 70
3 MachineA 100
TABLE 2: OPERATIONS
We have operators (PERSONCODE) run the jobs on the machines. So Job 1 may be run by PERSONCODE 8 (e.g. Tony) and it may run on MachineA or MachineB.Multipe people may run a particular job. The PERSONCODE will be unique to the Job and it is actually unique to the list. A person never works on more than one job.
JOBNO MACHINE PERSONCODE
1 MachineA8
1 MachineA7
1 MachineB6
2 MachineA3
2 MachineA2
2 MachineA1
3 MachineA4
DESIRED RESULT:
I need to assign the COSTs to the OPERATIONS table but only want it to show next to one person (next to the appropriate machine).
DESIRED RESULT:
JOBNO MACHINE PERSONCODE COST
1 MachineA8 50
1 MachineA7
1 MachineB6
2 MachineA3 70
2 MachineA2
2 MachineA1
3 MachineA4 100
[code]....
View 5 Replies
View Related
Mar 17, 2009
I am writing my first procedure and need to exclude two codes from a list of receipts. I can probaby use the following
and rc_receipt_code in (1, 2, 3, 4, 7, 8)
however can I use <> to eliminate 2 codes for instance can I say
select NVL(sum(rc_amt), 0)
into tot_cont
from trefrc
where rc_filer_seq = filer
and rc_receipt_code <> (5, 6);
View 1 Replies
View Related
Jun 10, 2010
I am using oracle 10g.
I have a query which is used to get the contact details based on the zip code
select * from contacts where
primary_address_postalcode like '65084%' or
primary_address_postalcode like '65011%' or
primary_address_postalcode like '65034%' or
primary_address_postalcode like '65078%' or
primary_address_postalcode like '65050%' or
primary_address_postalcode like '65037%' or
primary_address_postalcode like '65329%' or
primary_address_postalcode like '65072%' or
primary_address_postalcode like '65081%' or
primary_address_postalcode like '65038%'
Result
userid name primary_address_postalcode
5 abc 65072
6 def 65038 -12343
1 xyz 65050
24 pqr 65011
32 test 65011-23455
54 itsme 65329
i want to order the records just same as the zip codes we are using in like (65084,65011,65034, 65078,65050, 65037, 65329,65072, 65081, 65038)
How can i get the result like below
expected result
userid name primary_address_postalcode
24 pqr 65011
32 test 65011-23455
1 xyz 65050
54 itsme 65329
5 abc 65072
6 def 65038-12343
View 15 Replies
View Related
Dec 29, 2011
I have an question.
- Imagine I have an table with several ZIPCODE.
- Imagine I want to return from that table the existence of several zipcodes I need to get.
- Imagine that I need to return both zipcodes that exists and both zipcodes that not exist.
The solution I've found to do this, was using the Pivot method, like the sample below, if there is another way to return anything like that. Return the zipcodes that exist, and the zipcodes that does not exist also!
Table Creation:
CREATE TABLE "AAA_ADDRESSZIPCODES"
("ZIPCODE" NUMBER,
"NAME" VARCHAR2(50 BYTE),
"COD_PLACE" NUMBER
)
Data:
Insert into GSCIS.AAA_ADDRESSZIPCODES (ZIPCODE,NAME,COD_PLACE) values (1100,'Portugal',2);
Insert into GSCIS.AAA_ADDRESSZIPCODES (ZIPCODE,NAME,COD_PLACE) values (1150,'Portugal',2);
Insert into GSCIS.AAA_ADDRESSZIPCODES (ZIPCODE,NAME,COD_PLACE) values (1000,'Portugal',1);
Insert into GSCIS.AAA_ADDRESSZIPCODES (ZIPCODE,NAME,COD_PLACE) values (1200,'Spain',2);
Select using Pivot:
SELECT *
FROM (SELECT distinct zipcode FROM aaa_addresszipcodes group by zipcode )
PIVOT ( count(zipcode) FOR zipcode IN (1000,1100,1200, 1150, 2000) )
View 3 Replies
View Related
May 22, 2013
I am getting string from my tool like this.... .. ‘ ‘PH1234’,’Ph3456’,’PH5678’ ‘
I wanted to remove single codes and take the each value and I have to process. Need output like this....
PH1234,
Ph3456,
PH5678.
View 4 Replies
View Related
Feb 27, 2013
Is there a way we can wrap pl sql codes and other people will not be able to unwrap it? because I came across this site successfully unwrapped my wrapped pl sql codes. How to just unwrapped pl sql code then what is the use of wrapping?
View 1 Replies
View Related
Aug 17, 2012
Oracle 10g, Windows XP
There is an interface table and there is an normal transcational table..interface table is being compared with normal table and if match found the result is dumped into another normal table.
I am using two cursors one is to query the interface table and in a for loop pass the results to the second cursor..The interface table is having 5000 + rows and the transcation table is having more than 3.7 millions ..and the program is taking lots of time to execute..took almost 35-45 minutes..
create table x_interface /* INterface table */ -- 5000 + rows
( name varchar2(80), addr_line1 varchar2(35), addr_line2 varchar2(35), addr_line3 varchar2(35),
addr_line4 varchar2(35), addr_line5 varchar2(35), addr_line6 varchar2(35), suffix varchar2(35),
city varchar2(15), state varchar2(10), zcode varchar2(10))
[code]....
View 7 Replies
View Related
Dec 4, 2012
Database version: 11.2.0.3.0
I need to remove duplicate values from concatenated long string of state codes(comma separated). Ex: 'VA,VA,PA,PA,CT,NJ,CT,VA'. I tried following query and did not get required out put.
select regexp_replace('VA,VA,PA,PA,CT,NJ,CT,VA,CT,PA,VA,CT','([^,]*)(,1)+($|,)', '13') new_str from dual;
Define Meta-character's format in regular expression to get desired result. Out put required: VA,PA,CT,NJ (with out any duplicates).
View 4 Replies
View Related
Aug 26, 2013
how to do a proper FormFeed ? "feed a new sheet of paper into the printer" I've tried the following :
declare
FormFeed constant varchar2(1) := chr(12);
CRLF CONSTANT CHAR(2) := CHR(13)||CHR(10);
.......
Begin
UTL_FILE.PUTF(vFILE,'%s
'||chr(12)); --- Try #1
utl_file.put_line(vFILE, CRLF ); --- Try #2
utl_file.put_line(vFILE, FormFeed); --- Try #3
View 3 Replies
View Related
Jun 25, 2011
i have two dates like
30-may-2011 11:50:34 and 27-may-2011 13:59:37
how i can calculate proper hrs between these dates? My condition is time calculate from 8.30AM to 5.30PM
it does not considered 24 hrs
if i calculate hrs
30-may-2011 11:50:34 - 27-may-2011 13:59:37
then it shows 69.85 hrs . but it considered full 24 hrs.
View 5 Replies
View Related
Jan 6, 2010
How do you determine or what is the proper way to set a linesize in sql*plus? I don't just want to make up a number.
View 15 Replies
View Related
May 31, 2011
homework assignment using pl/sql based on 2 tables I have created below? I am not sure of how to use cursors, loops and proper syntax.
ASSIGNMENT:
1. Create a PL/SQL Procedure (cursor to loop through the records, check the LastName, then update the grade table
where id=id on grade table)
Rule:
A
‐ LastName ends with a character between A‐F
B
‐ LastName ends with a character between G‐K
C
‐ LastName ends with a character between L‐P
D
‐ LastName ends with a character between Q‐T
E
‐ LastName ends with a character between U‐Z
Create TABLE Registration (RegistrationID number(10), SectionID number(10), CourseID number(10),
SectionNumber varchar2(10),
StudentID number(10), FirstName varchar2(20),
LastName varchar2(20), CourseNumber varchar2(20), CourseName varchar(20));
[code].....
View 20 Replies
View Related
Jan 31, 2012
The Ename SMITH should appear as Smith.
View 1 Replies
View Related
May 10, 2013
i m using oracle d2k i want to open a pdf file given proper path of C:Program FilesAdobeReader 9.0ReaderAcroRd32.exe but i want to use only AcroRD32. exe without using proper path how i use it
View 6 Replies
View Related
Oct 17, 2012
I have a table whose size is 2.3 GB and there are two indexes on it. One index is based on a Date column whose size is 900 MB, and the Other index consists of 5 columns including the date column, and the size is almost 2GB. But when i query the table using the Date column, it is doing a range scan on the second index which is almost the same size as the table. why is it not using the first index? What steps should i take so that it uses the First index without passing hints.
View 4 Replies
View Related
Jul 24, 2012
CREATE TABLE tbl_emp
(
name VARCHAR2(20),
price NUMBER,
[Code]...
NAME PRICE DATAENTRD ROWRANK
aaa 9999 24.07.2012 05:56:00 1
aaa 10000 24.07.2012 05:55:58 2
I want to insert this result into another table, how can I do it??
Quote:TABLE
CREATE TABLE tbl_emp_result_set
(
name VARCHAR2(20),
price NUMBER,
dataEntrd date,
rowrank number
)
View 8 Replies
View Related
Oct 29, 2012
There are 4 rows in table with stat_flag 'Updated Record' and stat_date with todays date.
stat date has date & time both, for that reason just trying to format with yyyy.mm.dd
I am getting zero rows as result.
where STAT_FLAG = 'Updated Record' and to_date(stat_date,'yyyy.mm.dd') = to_date(sysdate(),'yyyy.mm.dd')
View 4 Replies
View Related
Jul 20, 2011
me in building a query. I want to show the result of the query just like pivot table.
Test case
CREATE TABLE CPF_YEAR_PAYCODE
(
CPF_NO NUMBER(5),
INC_DATE DATE,
PAYCODE_TYPE CHAR(1 BYTE),
[code]...
I want that my query should look like the format as attached in the xls sheet.
View 1 Replies
View Related
Jul 9, 2013
I am getting different result when I run my dashboard procedure I am using temporary table with "ON COMMIT PRESERVE ROWS", below is the information I am running my attendance dashboard procedure which will display the employee attendance status based IN and OUT punches the status like AA-full day absent, GG-Full day Present, AG-First half absent,GA-Second half absent.
Now when I run the first time my procedure for first time I am getting status AA even though IN and OUT timings are correct and if run it again then it is displaying the status for same employee as GG I didn't understand the problem where it is effecting the status
View 4 Replies
View Related
Feb 7, 2012
Following are 2 queries, which return same results as far as the input parameter is NOT NULL
select /*+ gather_plan_statistics */ * from PX_CJQ where decode(:x,null,1,object_id) = NVL(:x,object_id);
select /*+ gather_plan_statistics */ * from PX_CJQ where object_id = NVL(:x,object_id);
However the execution plan differs a lot The FTS cost or rows accessed count also varies what could be the reason? The PX_CJQ is simply select * from dba_objects and has index on object_id which anyway is not being used in this case
variable x number
exec :x:= 28
Query - 1
***************
***************
SQL> >select /*+ gather_plan_statistics */ * from PX_CJQ where decode(:x,null,1,object_id) = NVL(:x,object_id);
SQL> >select * from table(dbms_xplan.display_cursor(NULL,NULL,'ALLSTATS LAST'));
[code]...
Query - 2
***************
***************
SQL> >select /*+ gather_plan_statistics */ * from PX_CJQ where object_id = NVL(:x,object_id);
SQL> >select * from table(dbms_xplan.display_cursor(NULL,NULL,'ALLSTATS LAST'));
PLAN_TABLE_OUTPUT
[code]...
29 rows selected.
SQL> >
View 8 Replies
View Related
May 12, 2013
I have three select queries. Each of them returns a single column. I want the result of these queries into a single table..
I tried this way..
select * from
(first select),(second select),(third select);
this gives duplicate rows...
View 4 Replies
View Related
Aug 28, 2012
I am unable to insert the result set of query into corresponding SQL Table type variable where as same functionality can be accomplished by PL/SQL table type variable. Can't we access the same by using SQL type variable?
Ex:
Step 1:
SQL Object type , Table type Objects creation :
drop type sql_emp_tab_type ;
drop type sql_emp_type ;
create or replace type sql_emp_type as object
(
empno number,
ename varchar2(20),
[code]...
Step 2: Accessing the table type object from PL/SQL block
SQL>
SQL> declare
2
3 tab_type_var sql_emp_tab_type := sql_emp_tab_type();
4
5 begin
6
7 tab_type_var.extend(10);
[code]...
Step 3: Instead of SQL Table type , if we define the corresponding PL/SQL table type variable
SQL> declare
2
3 --tab_type_var sql_emp_tab_type := sql_emp_tab_type();
4
5 type pl_sql_emp_type is record
6 (
7 empno number,
[code]...
View 3 Replies
View Related