|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
getting the max length
i am using pl/sql and i need to do some validation regarding the max length of the string. but the problem is that i have to refer back to the database for the length so that if the database change, my code don't change.
is there any way to get the max length in the field of the table? eg: lets say i got a table call Person with column Name(varchar2(66)) and Sex(char(1)) so how i retrieve the max length of the field let say Name? which should return 66 thanks |
|
#2
|
||||
|
||||
|
Would the following help you at all?
Code:
DECLARE
myVariable Table.field%TYPE;
If the field is declared as CHAR(2) then myVariable will also be declared as the same... It mght be easier to do testing this way as you can catch different exceptions. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > General SQL Development > getting the max length |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|