I try like this:
local _cString as string
_cString := fieldget(#text)
No Error, but also no data in _cString.
what happend?
regards rolf
You didn't post a sufficiently complete example?
I see a few options
1) You are not using the ADO RDD and hence the fieldget
function has no access to the "SQL" data
2) What you posted is not what you are doing.
I think that you should also read the column being the primary key in your
query.
HTH,
Pierre
"Rolf Laumann" <rolf.l...@de.flextronics.com> wrote in message
news:bd2593cc.03072...@posting.google.com...
2. here is the complete sample ( I use SQL Server 7.0 or 2000 )
function readtext(cWrite) class My_app
local osql as sqlselect
local oconn as sqlconnect
local _cString := "" as string
oConn := SQLConnection{}
oConn:ODBCCursors := SQL_CUR_USE_ODBC
// Check for your own server
oConn:connect("sqlserver","uid","pwd")
oSQL:= sqlselect{"select top 1 * from texttest",oConn}
// Tabel testtext:
_cString := oSQL:fieldget(#testtext)
?_cString
// here you can see, that the result von fieldget is NULL_STRING
oSQL:FreeStmt(SQL_DROP)
oConn:Disconnect()
RETURN
Also I can't write any data to SQL Field (TEXT) with the function
Fieldput.
Regards rolf
"Malcolm Gray" <malcol...@jobstream.co.uk> wrote in message news:<i0n2gb...@192.168.1.252>...
"Pierre Honore" <pierre...@options.fr> wrote in message news:<bg2tbh$k875s$1...@ID-179727.news.uni-berlin.de>...
> _cString := oSQL:fieldget(#testtext)
OK - important difference to the original posting -
this is now a method call, the previous was a function call.
> Also I can't write any data to SQL Field (TEXT) with the
> function
> Fieldput.
Do you really mean the function?
I am afraid I have never used the sqlselect select class,
we use VO2ADO. Are you sure the table has at least
one row?
do you have a table texttest with a field texttest???
all you do is correct:
oConn := SQLConnection{ "odbcname", "user", "passwd" }
oSQL:= SQLSelect{"select top 2 * from TableName", oConn }
// better to use a where-Statement ;-)
// Check error, display ErrorMessage
// please check this ErrorMessage..., maybe the user didn't have rights???
oSQL:GoTop()
IF oSQL:ErrInfo:ErrorFlag
MessageBox( 0, oSQL:ErrInfo:ErrorMessage, "Error", MB_OK+MB_ICONERROR )
ELSE
_cString := oSQL:FieldGet(#FieldName)
ENDIF
oSQL:Close()
oConn:DisConnect()
Markus Feser
SELECT top 1 SubString(testtext,1,50) FROM texttest
this statement did work?...
Markus Feser
some more possible errors to check:
1) in Interactive SQL (as it is called by Sybase) test your statement
"select top 1 * from texttest" for results
(I've never used in Sybase "top 1")
2) change your code to
oSQL:= sqlselect{"select testtext from texttest",oConn} // is this
working in ISQL ?
_cString := oSQL:fieldget(1)
Michael
"Rolf Laumann" <rolf.l...@de.flextronics.com> schrieb im Newsbeitrag
news:bd2593cc.0307...@posting.google.com...
"Rolf Laumann" <rolf.l...@de.flextronics.com> wrote in message
news:bd2593cc.03072...@posting.google.com...
to 1.) I'm using Microsoft SQL Server 2000 and in other App's I try
this select ("select top 1 * from ....) it works. I receive only the
first Row from the Select.
to 2.) I try this, but it does not work. I get 1 Row back from SQL
Server, but in the aSQLData Buffer from Debuger the field testtext is
null_string.
???? Why.
Regards Rolf
"Michael Haensch" <michael...@fritsche-entsorgung.de> wrote in message news:<bg3nrf$kjr$01$1...@news.t-online.com>...
"Malcolm Gray" <malcol...@jobstream.co.uk> wrote in message news:<2g33gb...@192.168.1.252>...
Rolf,
NO JOKE!!!
I claim, this will work.
because this data type (text in SQLServer) is not supported by VO.
Markus Feser
Sample that works not:
oSQL:= SQLSelect{"select testtext from testtext where uid = 1", oConn }
oSQL:= SQLSelect{"exec P_testtext 1",oConn}
Why doesn't work the stored Procedure from MS SQL Server??
Rolf
"Markus Feser" <markus.fese...@imsgear.com> wrote in message news:<bg3c2i$kfqua$1...@ID-72150.news.uni-berlin.de>...
"Geoff Schaller" <ge...@softwareXXXXobjectives.com.au> wrote in message news:<EXgVa.19930$OM3....@news-server.bigpond.net.au>...
> because this data type (text in SQLServer) is not supported by VO.
It is, but under some circumstances (maybe ODBC related) the data from a
data type "text" column will not be retrieved, a null string is returned
instead. Why ? I do not know.
What I have observed is that when too many (!?) columns are asked in the
query, or when only one column containing a text is queried, then the text
column will be a null string.
I have observed that when queried along with the primary key, a text column
will be what is stored in the base.
The workaround which works in all cases is to cast the text data type
columns into varchar( n )
HTH,
Pierre
"Rolf Laumann" <rolf.l...@de.flextronics.com> wrote in message
news:bd2593cc.03072...@posting.google.com...
that should be work:
oStmt := SQLStatement{ "EXECUTE StoredProcName @var1 = ...", oConn }
oStmt:Execute()
Markus Feser
"Pierre Honore" <pierre...@options.fr> wrote in message news:<bg5dpm$kri4e$1...@ID-179727.news.uni-berlin.de>...
> Hi Markus and Rolf
>
> > because this data type (text in SQLServer) is not supported by VO.
>
> It is, but under some circumstances (maybe ODBC related) the data from a
> data type "text" column will not be retrieved, a null string is returned
> instead. Why ? I do not know.
> What I have observed is that when too many (!?) columns are asked in the
> query, or when only one column containing a text is queried, then the text
> column will be a null string.
> I have observed that when queried along with the primary key, a text column
> will be what is stored in the base.
This is exactly that, that I found out through testing.
>
> The workaround which works in all cases is to cast the text data type
> columns into varchar( n )
But when I cast the text data type into varchar the limit of retrieved
chars is 8000 (nVarchar is 4000). In the Text field my be
2.147.483.647 chars.
I must work with long text. Thus 8000 (4000) bytes are not enough.
>
> HTH,
>
> Pierre
But thank you for the information.
Regards
Rolf
Hi,
I hope this and the dirty __RecCount() Method will be fixed in 2.7
(perhaps Robert reads the message <g>)
Markus Feser
in Sybase I'm using for "memo fields" the long varchar data type.
If this data type "long varchar" exists in SqlServer, you can try to make a
"cast( testtest as long varchar)"
Michael
"Rolf Laumann" <rolf.l...@de.flextronics.com> schrieb im Newsbeitrag
news:bd2593cc.03073...@posting.google.com...