The field length in sql

Domingo

Member
Licensed User
Longtime User
I work with a sqlite database created in b4ppc. There are a long field that in b4ppc works without problem, but in b4a no works fine because cut the field.
Are there any solution?
Thanks
 

Domingo

Member
Licensed User
Longtime User
With Cursor.getstring.
I tried with cursor.getslong and done error by no declare cursor.
An exemple, please.
Thanks
 
Upvote 0

Domingo

Member
Licensed User
Longtime User
Thanks, but I have read it before.:sign0089:
In this exemple, imagine that the content in a row, at the "col1" is too long. With cursor1.getstring it is not posible to take all the content. If I change cursor1.getstring for cursor.getlong do error.

Sub LogTable1
Dim Cursor1 As Cursor
Cursor1 = SQL1.ExecQuery("SELECT col1, col2, col3 FROM table1")
For i = 0 To Cursor1.RowCount - 1
Cursor1.Position = i
Log("************************")
Log(Cursor1.GetString("col1")) ' remember: this field is text
Log(Cursor1.GetInt("col2"))
Log(Cursor1.GetInt("col3"))
Next
Cursor1.Close
End Sub

Can you help me
Thanks
 
Upvote 0

Domingo

Member
Licensed User
Longtime User
The long's field is >9000 (I used string.length when display this column). Over that 9000 is not displayed.
The same, exact same database works fine in b4ppc.
This column is declared as text.
 
Upvote 0

Domingo

Member
Licensed User
Longtime User
Equals in b4ppc. With edittext called lanota:

......
lanota.Text=Cursor.GetString("Notas")
......
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I've just checked it and there is no problem to display more than 15000 characters in EditText:
B4X:
Sub Activity_Create(FirstTime As Boolean)
    Dim e As EditText
    e.Initialize("")
    Dim sb As StringBuilder
    sb.Initialize
    For i = 1 To 10000
        sb.Append("ab ")
    Next
    sb.Append(" end!")
    e.Text = sb.ToString
    Activity.AddView(e, 10dip, 10dip, 300dip, 300dip)
    Log(e.Text.Length)
    e.SelectionStart = e.Text.Length - 1
End Sub
Are you logging the text with Log? LogCat does truncate very long text.
 
Upvote 0

Domingo

Member
Licensed User
Longtime User
No works. I tried all solutions.
The facts are:
1) I work in PC with a program maked for me with VB6
2) When I close this aplication, and trough it, I make csv file whit the fields and after I buid a sqlite database that I used with b4ppc and now with b4a.
3) With b4ppc aplication I did'nt problem for display all information of any field
4) With b4a aplication the long fields no are displayed. I do all that I said you and you said me. No displayed using stringutils, no displayed using log() tool.

I display it making a button that pressed when finised the content using substring. It isn't very nice, but it works.
Are there any posibility for displayed a specific line of text in a edittext?

Thanks
 
Upvote 0
Top