How to avoid @ for running a sql query in sqlplus
Hi friends,
Is there a way to avoid typing @ for the execution of every sql script in the database. Maybe playing around with the login.sql or something.
I am bored of typing shift+@ every execution of running any of my scripts(i have nearly 3000 scripts) :(. May sound like a request from a lazy guy , but still can anyone please suggest some solution.??
like instead of
14:12:04 sa@TESTDB> @active
Client last
SID SER# LOGON_AT USERNAME OSUSER MACHINE PID MODULE PROGRAM SQL_ID call et
225 1 17-jun 07:00 oracle tkxti019 4543 oracle@tkxt 55h 11m 43s
224 1 17-jun 07:00 oracle tkxti019 4651 oracle@tkxt 55h 11m 43s
223 1 17-jun 07:00 oracle tkxti019 4708 oracle@tkxt 55h 11m 43ssomething like below is needed
14:12:05 sa@TESTDB> active
Client last
SID SER# LOGON_AT USERNAME OSUSER MACHINE PID MODULE PROGRAM SQL_ID call et
225 1 17-jun 07:00 oracle tkxti019 4543 oracle@tkxt 55h 11m 43s
224 1 17-jun 07:00 oracle tkxti019 4651 oracle@tkxt 55h 11m 43s
223 1 17-jun 07:00 oracle tkxti019 4708 oracle@tkxt 55h 11m 43sThanks,
Kunwar
Kunwar wrote:
I am bored of typing shift+@ every execution of running any of my scripts(i have nearly 3000 scripts)If you're running several scripts in one go, why not put them into a script, so that you only have to call that script and the rest will run automatically?
eg:
main.sql:
Prompt Running script1
@script1
Prompt Running script2
@script2
Prompt Running script3000
@script3000
SQL> @main
Running script1
Running script2
Running script3000
...
Similar Messages
-
URGENT HELP Required: Solution to avoid Full table scan for a PL/SQL query
Hi Everyone,
When I checked the EXPLAIN PLAN for the below SQL query, I saw that Full table scans is going on both the tables TABLE_A and TABLE_B
UPDATE TABLE_A a
SET a.current_commit_date =
(SELECT MAX (b.loading_date)
FROM TABLE_B b
WHERE a.sales_order_id = b.sales_order_id
AND a.sales_order_line_id = b.sales_order_line_id
AND b.confirmed_qty > 0
AND b.data_flag IS NULL
OR b.schedule_line_delivery_date >= '23 NOV 2008')
Though the TABLE_A is a small table having nearly 1 lakh records, the TABLE_B is a huge table, having nearly 2 and a half crore records.
I created an Index on the TABLE_B having all its fields used in the WHERE clause. But, still the explain plan is showing FULL TABLE SCAN only.
When I run the query, it is taking long long time to execute (more than 1 day) and each time I have to kill the session.
Please please help me in optimizing this.
Thanks,
SudhindraCheck the instruction again, you're leaving out information we need in order to help you, like optimizer information.
- Post your exact database version, that is: the result of select * from v$version;
- Don't use TOAD's execution plan, but use
SQL> explain plan for <your_query>;
SQL> select * from table(dbms_xplan.display);(You can execute that in TOAD as well).
Don't forget you need to use the {noformat}{noformat} tag in order to post formatted code/output/execution plans etc.
It's also explained in the instruction.
When was the last time statistics were gathered for table_a and table_b?
You can find out by issuing the following query:select table_name
, last_analyzed
, num_rows
from user_tables
where table_name in ('TABLE_A', 'TABLE_B');
Can you also post the results of these counts;select count(*)
from table_b
where confirmed_qty > 0;
select count(*)
from table_b
where data_flag is null;
select count(*)
from table_b
where schedule_line_delivery_date >= /* assuming you're using a date, and not a string*/ to_date('23 NOV 2008', 'dd mon yyyy'); -
How to run recordset SQL query in FORM DATA event
How can I run recordset SQL query in FORM DATA event upon clicking on Add button in the document?
Hi Slamet,
When you receive a form data event you have a class containing inside it a ObjectKeys xml info regarding the object added/modified,...
With the objects keys you can then use the DI API method called GetByKeys to obtain the DI Object.
There is some information about it in the SDK Help file, mainly in the "FormDataEvent" class definition:
<i>The event provides the unique ID (BusinessObjectInfo.ObjectKey) of the modified business object. You can use the value of this property as an input parameter in the DI API DataBrowser.GetByKeys method to get a DI object.</i>
Pay attention you don't have this information in the Before=True event of the Add as it is not yet in the database.
Hope it helps
Trinidad. -
How to add a parameter to sql query in report
Hi
How to add a parameter to sql query in report.
Parameter is from Visual studio
example:
select * from tab1 where dl=parameter???
I have VS 2008 prof CR XI R2, mysqlHello,
If you have this API available then you can modify the record selection formulae in code to add filtering:
string recordSelectionFormula = "{T_INV_RPT_ADDR.IND_PROMUS} = {?P_PROMUS?} AND {T_INV_RPT_POINT.INVOICE_DATE} = DATE(2008, 05, 31) AND {T_INV_RPT_POINT.CHECKOUT_DATE} = date(2008, 04,29)";
CrystalDecisions.CrystalReports.Engine.ReportDocument.RecordSelectionFormula = recordSelectionFormula;
You have to format and follow the rules as in the Designer so not too much work to get this to work.
CR for .NET may not have the ability so you will need to upgrade to a Developer version of Crystal Reports.
Thank you
Don -
How to hide repeated details using SQL Query?
How to hide repeated details using SQL Query?
For Ex:
------------------------+
DEPTNO| ENAME | JOB |
------|-------| --------|
10 | JAMES | MANAGER |
10 | BLAKE | CLERK |
10 | FORD | SALESMAN|
20 | SCOTT | MANAGER |
20 | ADAMS | CLERK |
20 | KING | SALESMAN|
------------------------+
How we can display the above details in the following way?
------------------------+
DEPTNO| ENAME | JOB |
------|-------| --------|
10 | JAMES | MANAGER |
| BLAKE | CLERK |
| FORD | SALESMAN|
20 | SCOTT | MANAGER |
| ADAMS | CLERK |
| KING | SALESMAN|
------------------------+
Thanks AdvanceHi,
you can use BREAK ON DEPTNO in SQL*Plus or use LAG.
SQL> ed
Wrote file afiedt.buf
1 select nullif(department_id
2 , lag(department_id) over (partition by department_id order by last_name)
3 ) dept_id
4 , last_name, job_id
5* from employees where department_id in (30,50) and rownum <=10
SQL> /
DEPT_ID LAST_NAME JOB_ID
30 Baida PU_CLERK
Colmenares PU_CLERK
Himuro PU_CLERK
Khoo PU_CLERK
Raphaely PU_MAN
Tobias PU_CLERK
50 Fripp ST_MAN
Kaufling ST_MAN
Vollman ST_MAN
Weiss ST_MAN
10 rows selected. -
How to get this output using sql query?
Hi,
How to get this output using sql query?
Sno Name Age ADD Result
1 Anil 23 delhi Pass
2 Shruti 25 bangalor Pass
3 Arun 21 delhi fail
4 Sonu 23 pune Pass
5 Roji 26 hydrabad fail
6 Anil 28 delhi pass
Output
Sno Name Age ADD Result
1 Anil 23 delhi pass
28 delhi passHi Vamshi,
Your query is not pretty clear.
write the select query using Name = 'ANIL' in where condition and display the ouput using Control-break statements.
Regards,
Kannan -
How to setup a query plan in effective at any time for SP or SQL query?
I have a SP which include a group by SQL statement. It retrieve data from a couple of tables which are over 1G size,
When I run this SP at first time, it take more than 5 minutes to get the result. then I run it again and again, Finally, it become very quick, I can get the result within second.
Not sure why. I guess it is because of query plan.
How to make it running at first time to get result within second? How to force a better best query plan in effective at first time to run the query?
If the engine has better plan in memory, could it be lost at some point? because I have the complain from end user said some times it is fast, sometime it is very slow.
How to resolve this problem?thanks, kevin. Here is the pesudo query( I modify table name as business rule from my company). you are right, mytab3 is a lookup table.
Select d.stock,i.description,c.categoryname,
Round(IsNull(Sum(d.qty),0),2) AS qty,
From mytab1 d,mytab2 s,invent i,mytab3 c
Where
d.stock != 'param1'
And d.id1 = s.id1 --id1: univarchar(11)
And i.code = c.code --code:univarchar(2)
And d.stock = i.stock --stock: univarchar(12)
And i.code2 = d.code2 --code2: univarchar(2)
And d.code2 = 'param2'
And s.id2 = 'param3' --id2: univarchar(6)
Group By c.categoryname,d.stock,i.description
Order By d.stock
here is the query plan when run this query:
The command completed with no results returned
QUERY PLAN FOR STATEMENT 1 (at line 1).
Executed in parallel by coordinating process and 4 worker processes.
STEP 1
The type of query is SELECT (into Worktable1).
GROUP BY
Evaluate Grouped SUM OR AVERAGE AGGREGATE.
Evaluate Grouped SUM OR AVERAGE AGGREGATE.
Evaluate Grouped SUM OR AVERAGE AGGREGATE.
Executed in parallel by coordinating process and 4 worker processes.
FROM TABLE
mytab2
s
Nested iteration.
Index : ind_mytab2 _id2
Forward scan.
Positioning by key.
Keys are:
id2 ASC
Executed in parallel with a 4-way hash scan.
Using I/O Size 16 Kbytes for index leaf pages.
With LRU Buffer Replacement Strategy for index leaf pages.
Using I/O Size 16 Kbytes for data pages.
With LRU Buffer Replacement Strategy for data pages.
FROM TABLE
mytab1
d
Nested iteration.
Index : ind_det_inv
Forward scan.
Positioning by key.
Keys are:
id1 ASC
Using I/O Size 16 Kbytes for index leaf pages.
With LRU Buffer Replacement Strategy for index leaf pages.
Using I/O Size 16 Kbytes for data pages.
With LRU Buffer Replacement Strategy for data pages.
FROM TABLE
invent
i
Nested iteration.
Using Clustered Index.
Index : invent_pk
Forward scan.
Positioning by key.
Keys are:
stock ASC
code2 ASC
Using I/O Size 2 Kbytes for data pages.
With LRU Buffer Replacement Strategy for data pages.
FROM TABLE
mytab3
c
Nested iteration.
Table Scan.
Forward scan.
Positioning at start of table.
Using I/O Size 2 Kbytes for data pages.
With LRU Buffer Replacement Strategy for data pages.
TO TABLE
Worktable1.
Parallel work table merge.
STEP 2
The type of query is INSERT.
The update mode is direct.
Executed by coordinating process.
Worktable2 created, in allpages locking mode, for ORDER BY.
FROM TABLE
Worktable1.
Nested iteration.
Table Scan.
Forward scan.
Positioning at start of table.
Using I/O Size 8 Kbytes for data pages.
With MRU Buffer Replacement Strategy for data pages.
TO TABLE
Worktable2.
STEP 3
The type of query is SELECT.
Executed by coordinating process.
This step involves sorting.
FROM TABLE
Worktable2.
Using GETSORTED
Table Scan.
Forward scan.
Positioning at start of table.
Using I/O Size 8 Kbytes for data pages.
With MRU Buffer Replacement Strategy for data pages.
Total estimated I/O cost for statement 1 (at line 1): 1409882.
The sort for Worktable2 is done in Serial -
When I run my SQL query in MS Access it ask for value ...I don't know why
Hi,
Below is my SQL Query:
SELECT employee.Name, employee.Emplid, payudds.Udds, data.Budget, data.Fund, data.FTE, data.[Annualized Rate], data.[FN Dist Pct], data.Udds, data.Project, data.[Empl Class]
FROM ((employeeuddslink INNER JOIN employee ON employeeuddslink.[employee_ID] = employee.[ID]) INNER JOIN payudds ON employeeuddslink.[payudds_ID] = payudds.[ID]) INNER JOIN data ON employee.[Emplid] = data.[Emplid]
GROUP BY employee.Name, employee.Emplid, payudds.Udds, data.Budget, data.Fund, data.FTE, data.[Annualized Rate], data.[FN Dist Pct], data.Udds, data.Project, data.[Empl Class], employeeuddslink.employee_ID, employeeuddslink.payudds_ID;
When I run this it ask for value for employee.Emplid.
I just want my query to run. How do I resolve this.
Regards, HiteshFROM ((employeeuddslink INNER JOIN employee ON employeeuddslink.[employee_ID] =
employee.[ID]) INNER JOIN payudds ON employeeuddslink.[payudds_ID] = payudds.[ID]) INNER JOIN data ON
employee.[Emplid]
In the FROM you have employee.[ID] and employee.[Emplid] as both being in table [employee].
Build a little, test a little -
How to run a sql query from a button in apex 3.0
Hi,
I am brand new and went through/installed the obe project tracker. I have need to create a simple application that displays a result (2 fields, name and license number) based on two parameters (dob and login id) which all are stored in 1 table in the database. I could this very simply in VB or VB.net but have no idea how to do it in apex.
Please provide guidance,
Thank you,
TomHi Tom,
Sounds like a report region will satisfy your requirements.
Create a new report region on one of your pages.
Choose SQL Report and give the region a title.
When you get to the "Enter SQL Query or PL/SQL function returning a SQL Query:" step, type:
SELECT name, license_number
FROM <insert_your_table_name_here>
WHERE dob = :P<n>_dob
AND login_id = :P<n>loginid(replace <n> with the page number that the region is on and use your own table name).
Don't try to run the page yet - it will give 'No data found'
Now, go back to the Page Definition screen and add two items in the region you just created - call them P<n>dob and P<n>login_id
Then, create a button in the same region (to be displayed amongst the region's items) - call it P<n>_GO and click 'Create' (take all the other defaults).
Now you can run the page, put some values into the fields and click go.
If you want to get fancier, you can change the text items to select lists etc. - let us know if you need help with that.
Hope this helps,
Bryan. -
How to run a SQL query which is stored in a column using PL/SQL?
Hello
I have a table A and one of the column values is select * from emp where empno :=xyz;
Now I would like to call this SQL query using a cursor in PL/SQL and run this for all the empno's and insert them into a temp table.
Can anybody help me in writing this PL/SQL query?
With Regards,
Mohanuser525114 wrote:
The primary reason for doing this is we are calculating percentiles on an entity sales for different range periods, and there are several sql queries stored in a cloumn, so we would like to know whether we can run these queries by calling them in a pl/sql query, Its not necessary that we need to use a cursor, but once fetching the result set of the query we would like to insert them in a table.Vamsi,
As said in response to Satya, executing dynamic SQL, looping over the result set and inserting the results one by one in a temporary table, is a horribly bad idea. Especially in terms of performance, but also regarding the maintainability of your code. It's just way more complex than necessary.
If you want to calculate percentages, then use analytic or aggregate functions in SQL to do so. If you want to store them, use a single INSERT SELECT statement.
If you want to continue on the same path, use Satya's code and use it inside a loop.
Regards,
Rob. -
How to avoid DISTINCT in OBIEE SQL
Hi...
For question i posted previously...
Problem with LONG datatype in Answers
I run the query in TOAD, and i was identified the error because of what this error is coming... because of DISTINCT...
I have taken care of avoiding that column in ORDER BY by putting the order by on another column..
Now my question is how to avoid the DISTINCT clause in SQL generated by OBIEE...
If the first column in criteria is measure then it avoids the DISTINCT... but if i use measure... group by will come.. and group by should not be used here...
If this is done... my problem will be resolved...
Ofcourse... i would be getting duplicate rows...
Still i want the answer how to avoid DISTINCT?
Expecting answer from you...
Thanks & Regards
Kishore GuggillaHi...
Thanks for reply...
Now another question.. if i want to do this for one report... how?/
If i do that change in Catalog properties.. that will be effected for all reports i think...
Instead of that if i want to do that for only one report.. which is effecting... then how to proceed??
I tried by writing case when 1=0 ... for first column in criteria.. but no luck...
Thanks & Regards
Kishore Guggilla -
How to get # of rows in SQL Query ResultSet
I need to get the # of rows in a sql query resultset so I can create arrays of the size of the # or rows returned. This is how I do it so far. Is there a better way without running the query twice?
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery(query);
while (rs.next())
i++;
aid = new int;
i=0;
rs = stmt.executeQuery(query);
while (rs.next())
aid[i] = rs.getInt(1);
Theres actually a few more arrays but for this I just used one to show what I was doing. Notice stmt.executeQuery needed to be called twice, once to get the count to set the size of the array and once to get the values.nope - there's no easy way.
the right thing to do is to iterate through the ResultSet, load its contents into a List of Objects or some other data structure, and close it out right away. You can get the count of rows while you do it. return the contents in the object or data structure for clients to use. you should never be passing a ResultSet around.
why do you need to know, anyway?
% -
How to cancel/kill a long SQL query?
For example, I issued a SQL query from Java, which may run for a long time, then, I want to cancel/kill it after a certain amount of time, how can I do it?
Also, is there a way to cancel/kill the query session in Oracle without using Java/JDBC?
Thanks!Yes. Either set it up automatically with Statement.setQueryTimeout()
or cancel the statement from a different thread, via Statement.cancel().
Joe Weinstein at BEA Systems -
Hi,
I would like to konw how I can make multiple parameters to sql query string seperated by ,(comma) ..
For example, this parameters can be printed like 'abc,dde,ggf,eeg' ,once I use "join(Parameters!rpCode.Value,",")" with report builder ,
By the way, when I test this multiple parameters by Query Designer of report builder there was no problem,.(using Define query parameters, I put abc,dde,ggf,eeg)
however, when I run this report , it won't be executing , with (rsErrorExecutingCommand)
Plz, help me....If its sql query then it should like this
Select t.*
from table t
inner join dbo.ParseValues(@Parameters,',')f
on f.val = t.ID
ParseValues can be found him
http://visakhm.blogspot.in/2010/02/parsing-delimited-string.html
or easier way is
Select t.*
from table t
where ',' + @Parameters + ',' LIKE '%,' + CAST(t.ID AS varchar(10)) + ',%'
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
Urgent= How to Group selected columns in sql query
Hi,
I need some urgent help on the following sql query. I 'm sure there is an easy way to do this but I'm stacked!Any help will be much appreciated!!
I have a query to retrieve the following columns:
I want the first 9 columns to be grouped together (not to be repeated) for any occurence of the last 3 columns (abs.ABSENCE_START_DATE,abs.ABSENCE_END_DATE, abs.DAYS_TAKEN DAYS_TAKEN_analysis)
SELECT DISTINCT
sum.employee_number ,
sum.EMPLOYEE_NAME,
sum.EMAIL_ADDRESS,
sum.ORGANIZATION ,
sum.BCEBF ,
sum.ALDE ,
sum.CURYRREMDAYS ,
sum.DAYS_TAKEN ,
sum.REMBCE ,
abs.ABSENCE_START_DATE
abs.ABSENCE_END_DATE,
abs.DAYS_TAKEN DAYS_TAKEN_analysis
--TO_CHAR(TO_CHAR(abs.ABSENCE_START_DATE)||' '||TO_CHAR(abs.ABSENCE_END_DATE)||' '||TO_CHAR(abs.DAYS_TAKEN)) DAYS_TAKEN_ANAL
FROM
HB_V_ANNUAL_LEAVE_SUMMARY_REP SUM,
HB_V_AN_LEAV_DAYS_TAKEN_REP ABS
WHERE
sum.employee_number = abs.EMPLOYEE_NUMBER
ORDER BY
sum.employee_number ,
sum.EMPLOYEE_NAME,
sum.EMAIL_ADDRESS,
sum.ORGANIZATION ,
sum.BCEBF ,
sum.ALDE ,
sum.CURYRREMDAYS ,
sum.DAYS_TAKEN ,
sum.REMBCE
Any feedback/help on how to do this will be highly appreciated.
Thanks a lot
ElenaPlease help!!
I used the break command to group columns that I do not want to repeat in my query output. When I run the query without formatting is working. But when I put all formatting to produce the required output I dont get the result I want.
Below is the exact sql query I use:
<<
SET TERMOUT OFF
SET ECHO OFF
SET ARRAY 35
SET HEA OFF
SET FEEDBACK OFF
SET PAGES 2000
col beginLINE format A100
col winsecidLINE format A100
col placeLINE format A100
COL LINEempty1 format A100
COL LINEempty2 format A100
COL LINEempty3 format A100
COL LINEempty4 format A100
COL LINEempty5 format A100
COL LINEempty6 format A100
COL LINEempty7 format A100
COL LINEempty8 format A100
COL LINEempty9 format A100
COL LINEempty10 format A100
col LINECOLempty format A100
col receiverLINE FORMAT A100
COL EMP_EMAIL_ADDRESS FORMAT A100
COL LINEHEADER FORMAT A100
COL unitsLINE FORMAT A100
COL lmLINE FORMAT A100
COL INTITLE FORMAT A100
COL LINECOL1 FORMAT A100
COL CIF FORMAT A100
COL EMPLOYEE_NAME FORMAT A100
COL ORGANIZATION FORMAT A100
COL LINECOL2 FORMAT A100
COL ALHEADER FORMAT A100
col LINECOL3 FORMAT A100
col BCEBF FORMAT A100
col ALDE FORMAT A100
COL CURYRREMDAYS FORMAT A100
COL DAYS_TAKEN FORMAT A100
col LINECOL4 FORMAT A100
COL REMBCE FORMAT A100
col LINECOL5 FORMAT A100
col LINECOL6 FORMAT A100
col ALHEADER2 FORMAT A100
col LINECOL7 FORMAT A100
col endLINE FORMAT A100
break on beginLINE on winsecidLINE on placeLINE on LINEempty1 ON LINEempty2 ON LINEempty3 ON LINEempty4 ON LINEempty5 ON LINEempty6 ON LINEempty7 ON LINEempty8 ON LINEempty9 ON LINEempty10 on receiverLINE on EMP_EMAIL_ADDRESS on LINEHEADER on unitsLINE on lmLINE on INTITLE on LINECOL1 on CIF on EMPLOYEE_NAME on ORGANIZATION on LINECOL2 on ALHEADER on LINECOL3 on BCEBF on ALDE on CURYRREMDAYS on DAYS_TAKEN on LINECOL4 on REMBCE on LINECOL5 on LINECOL6 on ALHEADER2 on LINECOL7 ON LINEempty11 ON endREPORT on endLINE
SPOOL C:\FORMATout.txt
SELECT
'{{begin}} '||chr(10) beginLINE,
'{{winsecid 999999}} '||chr(10) winsecidLINE,
'{{place rbsemail.tif 0 0}} '||chr(10) placeLINE,
' '||chr(10) LINEempty1,
' '||chr(10) LINEempty2,
' '||chr(10) LINEempty3,
' '||chr(10) LINEempty4,
' '||chr(10) LINEempty5,
' '||chr(10) LINEempty6,
' '||chr(10) LINEempty7,
' '||chr(10) LINEempty8,
' '||chr(10) LINEempty9,
' '||chr(10) LINEempty10,
'{{from [email protected]}} '||chr(10) receiverLINE,
'{{fax '|| EMAIL_ADDRESS||' }} '||chr(10) EMP_EMAIL_ADDRESS,
'{{Subject Annual Leave Summary Report as at '||sysdate||' }} '||chr(10) LINEHEADER,
'{{units cm}} '||chr(10) unitsLINE,
'{{lm 2.0}} '||chr(10) lmLINE,
'ANNUAL LEAVE SUMMARY REPORT AS AT '||sysdate INTITLE,
'---------------------------------------------------------------------' LINECOL1,
'CIF: '||CIF CIF,
'EMPLOYEE NAME: '||EMPLOYEE_NAME EMPLOYEE_NAME,
'DEPARTMENT DETAILS: '||ORGANIZATION ORGANIZATION,
'---------------------------------------------------------------------' LINECOL2,
'ANNUAL LEAVE DETAILS:' ALHEADER,
'---------------------------------------------------------------------' LINECOL3,
'BALANCE B/F FROM PREVIOUS YEAR: '||BCEBF BCEBF,
'DAYS ENTITLED FOR THE CURRENT YEAR: '||ALDE ALDE,
'CURRENT YEAR REMAINING DAYS: '||CURYRREMDAYS CURYRREMDAYS,
'DAYS TAKEN FOR THE CURRENT YEAR: '||DAYS_TAKEN DAYS_TAKEN,
'---------------------------------------------------------------------' LINECOL4,
'REMAINING BALANCE: '||REMBCE REMBCE,
'---------------------------------------------------------------------' LINECOL5,
'---------------------------------------------------------------------' LINECOL6,
'ANNUAL LEAVE DAYS TAKEN ANALYSIS FOR THE CURRENT YEAR:' ALHEADER2,
'---------------------------------------------------------------------' LINECOL7,
TO_CHAR('START DATE: '||ABSENCE_START_DATE||' '||'END DATE: '||ABSENCE_END_DATE||' '||'DAYS TAKEN : '||DAYS_TAKEN_ANAL) AL_DAYS_ANAL,
' '||chr(10) LINEempty11,
'-- End of Report -- '||chr(10) endREPORT,
'{{end}} '||chr(10) endLINE
FROM HB_V_AN_LEAV_SUM_DAYSTAKEN_REP
WHERE CIF IN ('098033','098024')
ORDER BY
beginLINE ,
winsecidLINE,
placeLINE ,
LINEempty1,
LINEempty2,
LINEempty3,
LINEempty4,
LINEempty5,
LINEempty6,
LINEempty7,
LINEempty8,
LINEempty9,
LINEempty10,
receiverLINE,
EMP_EMAIL_ADDRESS,
LINEHEADER ,
unitsLINE ,
lmLINE ,
INTITLE ,
LINECOL1,
CIF ,
EMPLOYEE_NAME ,
ORGANIZATION ,
LINECOL2 ,
ALHEADER ,
LINECOL3,
BCEBF ,
ALDE ,
CURYRREMDAYS ,
DAYS_TAKEN ,
LINECOL4 ,
REMBCE ,
LINECOL5 ,
LINECOL6 ,
ALHEADER2 ,
LINECOL7 ,
LINEempty11,
endREPORT,
endLINE
spool off
>>
The required output I want to get is:
<<
{{begin}}
{{winsecid 750612}}
{{place rbsemail.tif 0 0}}
{{from [email protected]}}
{{fax [email protected] }}
{{Subject Annual Leave Summary Report as at 04-APR-08 }}
{{units cm}}
{{lm 2.0}}
ANNUAL LEAVE SUMMARY REPORT AS AT 04-APR-08
CIF: 098024
EMPLOYEE NAME: Christou Christos Panteli
DEPARTMENT DETAILS: 003-031-010-314-03140-Special Projects
ANNUAL LEAVE DETAILS:
BALANCE B/F FROM PREVIOUS YEAR: 9
DAYS ENTITLED FOR THE CURRENT YEAR: 27
CURRENT YEAR REMAINING DAYS: 24
DAYS TAKEN FOR THE CURRENT YEAR: -3
REMAINING BALANCE: 33
ANNUAL LEAVE DAYS TAKEN ANALYSIS FOR THE CURRENT YEAR:
START DATE: 04-JAN-08 END DATE: 04-JAN-08 DAYS TAKEN : 1
START DATE: 24-JAN-08 END DATE: 24-JAN-08 DAYS TAKEN : 1
START DATE: 20-FEB-08 END DATE: 20-FEB-08 DAYS TAKEN : 1
-- End of Report --
{{end}}
{{begin}}
{{winsecid 750612}}
{{place rbsemail.tif 0 0}}
{{from [email protected]}}
{{fax [email protected]}}
{{Subject Annual Leave Summary Report as at 04-APR-08 }}
{{units cm}}
{{lm 2.0}}
ANNUAL LEAVE SUMMARY REPORT AS AT 04-APR-08
CIF: 098033
EMPLOYEE NAME: Demetriou Elena Steliou
DEPARTMENT DETAILS: 003-031-010-314-03140-Special Projects
ANNUAL LEAVE DETAILS:
BALANCE B/F FROM PREVIOUS YEAR: 15
DAYS ENTITLED FOR THE CURRENT YEAR: 27
CURRENT YEAR REMAINING DAYS: 25
DAYS TAKEN FOR THE CURRENT YEAR: -2
REMAINING BALANCE: 40
ANNUAL LEAVE DAYS TAKEN ANALYSIS FOR THE CURRENT YEAR:
START DATE: 15-JAN-08 END DATE: 15-JAN-08 DAYS TAKEN : 1
START DATE: 24-MAR-08 END DATE: 24-MAR-08 DAYS TAKEN : 1
-- End of Report --
{{end}}
>>
However the actual output we get from the above query is as follows:
<<
{{begin}}
{{winsecid 750612}}
{{place rbsemail.tif 0 0}}
{{from [email protected]}}
{{fax [email protected] }}
{{Subject Annual Leave Summary Report as at 04-APR-08 }}
{{units cm}}
{{lm 2.0}}
ANNUAL LEAVE SUMMARY REPORT AS AT 04-APR-08
CIF: 098024
EMPLOYEE NAME: Christou Christos Panteli
DEPARTMENT DETAILS: 003-031-010-314-03140-Special Projects
ANNUAL LEAVE DETAILS:
BALANCE B/F FROM PREVIOUS YEAR: 9
DAYS ENTITLED FOR THE CURRENT YEAR: 27
CURRENT YEAR REMAINING DAYS: 24
DAYS TAKEN FOR THE CURRENT YEAR: -3
REMAINING BALANCE: 33
ANNUAL LEAVE DAYS TAKEN ANALYSIS FOR THE CURRENT YEAR:
START DATE: 04-JAN-08 END DATE: 04-JAN-08 DAYS TAKEN : 1
-- End of Report --
{{end}}
START DATE: 24-JAN-08 END DATE: 24-JAN-08 DAYS TAKEN : 1
START DATE: 20-FEB-08 END DATE: 20-FEB-08 DAYS TAKEN : 1
{{fax [email protected] }}
{{Subject Annual Leave Summary Report as at 04-APR-08 }}
{{units cm}}
{{lm 2.0}}
ANNUAL LEAVE SUMMARY REPORT AS AT 04-APR-08
CIF: 098033
EMPLOYEE NAME: Demetriou Elena Steliou
DEPARTMENT DETAILS: 003-031-010-314-03140-Special Projects
ANNUAL LEAVE DETAILS:
BALANCE B/F FROM PREVIOUS YEAR: 15
DAYS ENTITLED FOR THE CURRENT YEAR: 27
CURRENT YEAR REMAINING DAYS: 25
DAYS TAKEN FOR THE CURRENT YEAR: -2
REMAINING BALANCE: 40
ANNUAL LEAVE DAYS TAKEN ANALYSIS FOR THE CURRENT YEAR:
START DATE: 15-JAN-08 END DATE: 15-JAN-08 DAYS TAKEN : 1
-- End of Report --
{{end}}
START DATE: 24-MAR-08 END DATE: 24-MAR-08 DAYS TAKEN : 1
>>
IF ANYONE CAN HELP ON THIS I WOULD REALLY APPRECIATE IT!
THANKS A LOT!
Best regards,
Elena
Maybe you are looking for
-
Patch / workaround for kernel 2.6 (no components in pallet)
Since I've read about this complaint all over the net, and, after three weeks without problems, I seem to have solved the issue locally (at least for Fedora Core II), here's a mini tutorial on how to do a patch so that Creator sucessfully copies the
-
How to implement XI interfaces in online and offline modes?
Hi Everybody, Can you please tell me how to implement XI interfaces in online and offline modes? thanks a lot, Ramya Shenoy.
-
Hidden login items not working
Hello I currently have both messages and email open at startup. I wanted to make them open without opening a window so i selected "hide" in login items; however, for some reason this does not work. I got email to hide but messages wouldn't. But now m
-
Uninstall java 6 Yosemite (Java for OS X 2014-001)
In order to run certain Apps and an Uninstaller from an older app under OS X 10.10, I was requested to install Java 6 (legacy), which I did successfully (Java for OS X 2014-001). But now, that I do not need Java any more I would like to uninstall it.
-
Re: BT Home Hub replacement
I just had teh same probelm and I have a Business Account with them - they basically WALK OVER their customers and show no respect or loyalty to them. I will As soon as I can kill my account. They are a disgrace.