Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL script to find number of characters allowed in "Description" column of "AP_INVOIC 2

Status
Not open for further replies.

Livia8

Technical User
Oct 29, 2003
130
IE
Could someone kindly let me know how to find how many characters are allowed in a specific field? Is there a sql entry I can use or can this be done some other way?

Some "Local Event Errors" have appeared in the Workflow, the description reads "Invoice Descr. field may be too long", although the rest of the errors does not seem to support this and we think the error description may be spurious.

This does error not stop the invoices from being input or processed, but seems to be causing problems with reports. I've looked on the web but I can't find what I need.

I'm not trying to find out how many characters have been typed in a field (e.g., in Excel, to find this, I'd use "LEN" to see that "APPLE" = 5, "ORANGE" = 6 and "WATERMELON"=10), but how many characters I'm allowed to type (e.g., if the field allows 8, "apple" and "orange" would fit, but "watermelon" wouldn't).

Thanks.
 
SELECT * FROM dba_tab_columns WHERE table_name = 'TABLE_NAME';

where TABLE_NAME is the name of your table, in upper case.
 
Thanks Carp, unfortunately that didn't work.

SELECT * FROM dba_tab_columns WHERE table_name = AP_INVOICES_ALL returned "ORA-00904: "AP_INVOICES_ALL": invalid identifier".

Yet, if I type (e.g.)SELECT DESCRIPTION from AP_INVOICES_ALL I do get an output.

 
It will work if you enclose the table name in single quotes (as shown).
Also, this assumes you have access to dba_tab_columns. If you do not, try querying against all_tab_columns.
 
Try:
[tt][blue]
SELECT DATA_LENGTH
FROM all_tab_columns
Where TABLE_NAME = 'AP_INVOICES_ALL'
And COLUMN_NAME = 'DESCRIPTION'[/blue][/tt]

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Thank you both, Carp and Andy, both your solutions worked like a charm. Have a good weekend.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top