SQL statement which returns the length of a table field in the DB
well is there a sql statement so to obtain the length ( in bytes ) of a spesific table field from data base ?
Re: SQL statement which returns the length of a table field in the DB
What do you mean by "length of a table field"?
Are you asking about a varchar field, and how many characters it is has been set to?
Re: SQL statement which returns the length of a table field in the DB
try DATALENGTH
SELECT DATALENGTH(columnName) AS xxx FROM table ...etc
the result depends on the column datatype
Re: SQL statement which returns the length of a table field in the DB
i mean for example if field_name is varchar2(250) , i need a select statement so to have as result 250
Re: SQL statement which returns the length of a table field in the DB
Quote:
Originally Posted by chriskaza81
i mean for example if field_name is varchar2(250) , i need a select statement so to have as result 250
Ok, that was my question. :)
Did you try what brin351 suggested?
Re: SQL statement which returns the length of a table field in the DB
what do you mean brin351???? i use oracle
Re: SQL statement which returns the length of a table field in the DB
Re: SQL statement which returns the length of a table field in the DB
so do you know how can i do it is there any way???
Re: SQL statement which returns the length of a table field in the DB
Are you talking about using the Desc tablename as in SQL? If so that is not avail from VB (or C# or C or C++). Search the forums I have posted a method for returning table field sizes using Oracle and VB.
Re: SQL statement which returns the length of a table field in the DB
This is what I was referring to by brin351 and Post #3
Quote:
Originally Posted by brin351
try DATALENGTH
SELECT DATALENGTH(columnName) AS xxx FROM table ...etc
the result depends on the column datatype
Apparently it is moot, as Gary has stated it probably won't work, but I just wanted to clear that up.
Re: SQL statement which returns the length of a table field in the DB
yes i want to obtain table field size is there any select statement i can do that??
Re: SQL statement which returns the length of a table field in the DB
Look at this thread http://www.vbforums.com/showthread.php?t=459103
Last post (I think last any way). I posted a method of getting the data back from an Oracle DB.
Re: SQL statement which returns the length of a table field in the DB
Re: SQL statement which returns the length of a table field in the DB
Does that work for you? Is this question resolved?
Re: SQL statement which returns the length of a table field in the DB