|
-
Sep 24th, 2007, 05:12 AM
#1
Thread Starter
Lively Member
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 ?
-
Sep 24th, 2007, 06:00 AM
#2
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?
-
Sep 24th, 2007, 06:04 AM
#3
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
-
Sep 24th, 2007, 06:08 AM
#4
Thread Starter
Lively Member
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
-
Sep 24th, 2007, 06:37 AM
#5
Re: SQL statement which returns the length of a table field in the DB
 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?
-
Sep 24th, 2007, 06:39 AM
#6
Thread Starter
Lively Member
Re: SQL statement which returns the length of a table field in the DB
what do you mean brin351???? i use oracle
-
Sep 24th, 2007, 06:40 AM
#7
Re: SQL statement which returns the length of a table field in the DB
-
Sep 24th, 2007, 06:42 AM
#8
Thread Starter
Lively Member
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???
-
Sep 24th, 2007, 06:45 AM
#9
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.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Sep 24th, 2007, 06:47 AM
#10
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
 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.
-
Sep 24th, 2007, 06:48 AM
#11
Thread Starter
Lively Member
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??
-
Sep 24th, 2007, 06:48 AM
#12
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.
Sometimes the Programmer
Sometimes the DBA
Mazz1
-
Sep 24th, 2007, 06:55 AM
#13
Thread Starter
Lively Member
Re: SQL statement which returns the length of a table field in the DB
-
Sep 24th, 2007, 07:31 AM
#14
Re: SQL statement which returns the length of a table field in the DB
Does that work for you? Is this question resolved?
-
Sep 26th, 2007, 04:53 AM
#15
Thread Starter
Lively Member
Re: SQL statement which returns the length of a table field in the DB
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|