WCM Forum

WCM Forum (http://www.wcm.at/forum/index.php)
-   Programmierung (http://www.wcm.at/forum/forumdisplay.php?f=17)
-   -   SQL Länge eines Varchars ermitteln? (http://www.wcm.at/forum/showthread.php?t=230505)

pong 10.09.2008 10:04

SQL Länge eines Varchars ermitteln?
 
Weiß jemand Adhoc wie aus einem Varchar die Länge ausliest (und zwar möglichst Standard SQL ansonsten DB2)

pong

pc.net 10.09.2008 10:43

meinst du jetzt, die definierte länge eines varchar-feldes oder die länge, des wertes in diesem feld?

für letzteres nimm die "LENGTH" funktion:

SELECT LENGTH(EMPNAME)
FROM EMPLOYEE-2
WHERE EMPNO = '200'
;

funktioniert unter oracle und db2 ...

pong 10.09.2008 11:26

Die Länge des Feldinhaltes

Passt, danke

pong


Alle Zeitangaben in WEZ +2. Es ist jetzt 02:48 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© 2009 FSL Verlag