Way To Display Proper Case Of A String

Jan 31, 2012

The Ename SMITH should appear as Smith.

View 1 Replies


ADVERTISEMENT

SQL & PL/SQL :: Display Results Using CASE WHEN?

May 24, 2011

I am trying to create a query that displays the given error message if the result of my COUNT(*) is smaller than 1, but displays the result of my first query (data) if the total count is bigger than 1 (read: the query found data, so it needs to display the rows according to the search).

What do I need to do to display 'data' if 'data2' contains rows?

WITH data
AS (SELECT a.order_id, a.session_id, a.log_id, b.date_of_order, a.operation,
b.funct_prod_code, b.sts_status_code, b.ost_order_situation_code, c.order_situation_oms,

[Code]....

View 11 Replies View Related

PL/SQL :: Not Comparing String In Case

Mar 21, 2013

i executed the below code and found that output should be 5 but it shows 7(always else part). it is not comparing string in case.

declare
check_in_date date;
var_day varchar2(11);
rate_id number;
[code]....

View 3 Replies View Related

SQL & PL/SQL :: Code That Display First 10 Words From A String

Oct 19, 2011

wrote a code that display the first 10 words from a string.

View 15 Replies View Related

SQL & PL/SQL :: If Exist / Then Display As Lines As String Between /

Oct 12, 2010

I got some records in the table between the sign / Some of these records are separated by / And I would like to get something like:

If exist / inside the string then display as lines as string between /

For instance:

select handset_brand, handset_model
from the_table;
display : handset_brand: Siemens
handset_model: A35 / A36 / A40 / B35N

I need to get 4 lines:

handset_brand: Siemens
handset_model: A35
handset_brand: Siemens
handset_model: A36
handset_brand: Siemens
handset_model: A40
handset_brand: Siemens
handset_model: B35N

View 31 Replies View Related

Display String Using Select Statement In Oracle 10g

Jul 27, 2010

i want display a string like this using a select statement in oracle 10g.i have tried but not yet done.

example:
-----------
from 'ABCDEFGH' to 'ACEG'
removing 'BDFH' from the source string 'ABCDEFGH'

i giving here the example you can take any valid string i want the result like the above example and also in a dynamic manner means we can give string to a select statement in run time.can it is possible in a select statement only.

View 14 Replies View Related

SQL & PL/SQL :: Query Of Functions - Display Half Part Of String

Jun 8, 2011

I want to write a plsql program to display half part of a string .Example there is a string like gillmadden@myharbour.org.uk

I want to display only the later part of the string

myharbour.org.uk as output.

Can we write using string functions in plslql?

View 19 Replies View Related

PL/SQL :: ORA-06592 / CASE Not Found While Executing CASE Statement

Oct 16, 2013

My DB version is

BANNER                                                       
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
PL/SQL Release 10.2.0.1.0 - Production                         
CORE 10.2.0.1.0 Production                                       
TNS for Linux: Version 10.2.0.1.0 - Production                 
NLSRTL Version 10.2.0.1.0 - Production      

I'm getting this error while executing a package.But this is unpredictable because sometimes it's coming and sometimes it's not. Everytime I'm passing the value as 'ALERT' for the transaction name. Sometimes it's successful and sometimes it's throwing ORA-06592 

CASE UPPER(IC_TRANSACTION_NAME)
WHEN 'ALERT' THEN
SELECT A.FACILITY_ID INTO VN_FACILITY_ID FROM ALERT A
WHERE A.ALERT_ID = IN_PARENT_NODE_ID;
INSERT INTO TRANSACTION_HISTORY (TXN_HISTORY_ID,

[code]....

View 23 Replies View Related

PL/SQL :: How To Do A Proper FormFeed

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

SQL & PL/SQL :: How To Calculate Proper Hrs Between Two Dates

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

Client Tools :: Proper Way To Do LINESIZE

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

SQL & PL/SQL :: How To Use Cursors / Loops And Proper Syntax

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

Forms :: Use Only AcroRD32. Exe Without Using Proper Path?

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

Performance Tuning :: Proper Index Is Not Used

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

Server Utilities :: How To Get Proper Value In External Table

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

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

Reports & Discoverer :: How To Present Report In XLS Format With Proper Column Headings

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

Server Utilities :: Proper Data Type Should Use In Control-file For Both Fields

Jan 26, 2012

My oracle table having 2 fields.

filed1 VARCHAR(500)
field2 NUMBER.

i load data to this table from a file using sqlldr.

what is the proper data type should i use in control-file for both the fields.? i dont mention any datatye in ctl file which is working fine with given dataset.

View 19 Replies View Related

Client Tools :: Convert Incorrectly Imported Data Into Proper Unicode Format?

Mar 26, 2012

how can I convert incorrectly imported data into it's proper unicode format.

example:

FULL_NAME
GöRAN JOHANSSON
GÖRAN JOHANSSON

The first record is incorrectly imported and the second is how it should be looking like, if it has been properly imported.

NLS parameters are:

NLS_CHARACTERSET: WE8MSWIN1252
NLS_NCHAR_CHARACTERSET: AL16UTF16

In the example above, full_name is of a NVARCHAR2(100) type but the same problem applies to columns with VARCHAR2 type.

Is there a function or a peace of code I could use to convert value of the first record to be look alike of the second record?

View 14 Replies View Related

ORA-02085 - Database Link String Connects To String

Jun 19, 2012

I have this error (and solution):

ORA-02085: database link string connects to string

Cause: a database link connected to a database with a different name. The connection is rejected.

Action: create a database link with the same name as the database it connects to, or set global_names=false.
Where should I set global_names=false ?

View 7 Replies View Related

SQL & PL/SQL :: How To Find Whether Exact String Is Present / Not In Given String

Mar 14, 2013

I'm facing some problem even after using INSTR function in Oracle.The problem is I have written the logic in the PL/SQL block which appends all the values fetched in a loop on the basis of whether the string is present or not.

For ex:

The first value fetched from the select query first is ABCDEFG which gets appended to a variable
The next value fetched is AB even this has to be appended to the variable since this exactly doesn't match with ABCDEFG.
The next value fetched is BCDEF even this has to be appended to the variable since this exactly doesn't match with ABCDEFG.
The third Value fetched is ABCDEFG this will not get appended presently according to the logic which is correct.

writing that piece of code to append the value fetched which doesn't exactly match with the existing string

View 3 Replies View Related

How To Use String Buffer Instead Of String Query

May 9, 2008

show an ex to use string buffer for select statemnt

View 1 Replies View Related

SQL & PL/SQL :: Use MAX And CASE Together?

Jun 3, 2010

differs on below SQLs and where I need to use "MAX" and "CASE" together?

select trunc(sysdate),max(case when trunc(sysdate)='03jun2010' then 'correctdate' end) dates
from dual
output dates
-------------------------------
6/3/2010 6/3/2010
[code]....

View 6 Replies View Related

SQL & PL/SQL :: IF And Case?

Sep 22, 2010

I'm starting to Oracle and am having a doubt, need to check if a variable is null if I need to make an appointment if you do not need to make another appointment. I thought I was doing fine, but Oracle is pointing this error: "ORA-00900: invalid SQL statement."

- Case

CASE
WHEN 1 = 1
THEN
select *
from BANANA
WHEN 1 = 2

[code]...

View 8 Replies View Related

SQL & PL/SQL :: Case Vs Decode?

Feb 13, 2011

How to use decode and case in "where" and "from" clause of a select statement.

I know the decode can't be used in where clause. In that case how we can use decode and case in from clasue that is: table definition

View 7 Replies View Related

SQL & PL/SQL :: Case Condition?

Nov 21, 2010

i have small requirement

case when type=1 then max(col2) else end
case when type=2 then max(col2) else end

i wanted to have difference 2 timestamp

type(datatype- numeric)
col2(datatype-timestamp)

all it should be in one select condition

View 17 Replies View Related

Using Case Or If To Get Grade?

Feb 7, 2007

Im trying to make a query to get the grades of students, I already figured out how to get the average from the exams. Now I would like to make like a select case or if statements to get the actual grade.

Something like this:
average > 89 then grade = 'A'
average > 79 then grade = 'B'
average > 69 then grade = 'C'
average > 59 then grade = 'D'
else grade = 'F'

View 2 Replies View Related

How To Use CASE When Set Query Empty

Mar 23, 2009

I have a query that will either return one record or zero records. When it returns zero records I want to replace my attributes with a sentinel, like 'N/A'. I tried the CASE statement but couldn't get anything to work

Sample (does not work):
select
(case when exists (select product from tbl_product where productid = '123') then product else 'N/A' end) product
from tbl_product
where productid= '123';
If one record exists it should produce: 'My Widget' (or whatever)
If zero records exist it should produce: 'N/A'

View 3 Replies View Related

Case Statement In Where Clause

Feb 1, 2012

Depending on which month the user is running this select the TAG_YEAR needs to be calculated differently. I have a feeling that I'm over thinking it.

SELECT DOG_MASTER.DOG_MASTER_ID,
DOG_NAME,
TAG_YEAR,
TAG_NUMBER AS PREVIOUSTAGNUMBER,
ISSUE_DATE
FROM DOG_OWNER
[code].......

View 1 Replies View Related

ORACLE_SID Is Case Sensitive Or Not?

Jul 21, 2010

I would like to know does oracle_sid is case sensitive or not on Linux platform?also let me know on windows platform also?

View 14 Replies View Related







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