How to find string or key value using pl/sql code?

Answers were Sorted based on User's Feedback



How to find string or key value using pl/sql code?..

Answer / gourvendra singh

if you want to find a string value you can use the
following command
select length(TRIM(TRANSLATE(string,'+-.123456789',' ')))
from dual;
string=value that u entered
if the result is null then the string is numeric else its a
character

Is This Answer Correct ?    5 Yes 2 No

How to find string or key value using pl/sql code?..

Answer / kumarvijay

var=1; --var='a'

select to_number(var) from dual;

if variable holds string it will through exception else it
will execute.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More SQL PLSQL Interview Questions

need to split a string into separate values. eg. col1 col2 ---------- 100 - 'a,b,c' 200 - 'a,x,d,e' 300 - 'c' result: value count ------------- a - 2 b - 1 c - 2 etc.

2 Answers  


What is the order of sql select?

0 Answers  


What is dcl in sql?

0 Answers  


How do you run a query?

0 Answers  


What is sql key?

0 Answers  






What is dml and ddl?

0 Answers  


in sql table following column r there i want find 1st paid ,2nd paid,3rd paid date for same |service_type|date |vehicle_no| |------------|------|_---------| |paid |23 jan|MH12H2007 | | | | | |paid |26 feb|MH12H2007 | | | | | | | | | |paid |28 mar|MH12H2007 | i want o/p like below vehicle no| 1st paid date | 2nd paid date|3rd paid |latest paid date| pls help me out

4 Answers  


in table there r so many rows write a query which two rows r updated last two day befor?

3 Answers   Exilant,


What is clause?

0 Answers  


Why is a primary key important?

0 Answers  


What is the primary use of normalization?

0 Answers  


What is the difference between delete and truncate commands?

0 Answers  


Categories