TD 4.1 and sqlserver?

General discussion forum about all databases other than SqlBase.
gigit
Italy
Posts: 166
Joined: 14 Jun 2017, 15:04
Location: Italy

TD 4.1 and sqlserver?

Post by gigit » 21 Sep 2012, 16:30

Hi to all.
I am facing a strange problem. With TD 4.1 on a sqlserver d.b. I get no tresult with this instruction

SELECT * FROM
(testa_doc T inner join righe_doc R on T.c_ditta=R.c_ditta and T.t_docum=R.t_docum
and T.dt_docum=R.dt_docum and T.n_docum=R.n_docum)
WHERE R.c_ditta = :dlgStampaDocumenti.dfCDitta AND R.t_docum = :dlgStampaDocumenti.dfTDocum AND R.dt_docum >= :dlgStampaDocumenti.dfDtDocumDa AND R.dt_docum <=
:dlgStampaDocumenti.dfDtDocumA AND R.n_docum >= :dlgStampaDocumenti.dfNDocumDa AND R.n_docum <= :dlgStampaDocumenti.dfNDocumA

So I tried select * from testa_doc T inner join righe_doc R on R.c_ditta=T.c_ditta and T.t_docum=R.t_docum and T.dt_docum=R.dt_docum
and T.n_docum=R.n_docum ;
with SqlTalk and this is the result.

C_DITTA T_DOCUM DT_DOCUM N_DOCUM SG_ESERMAG D_DES1 D_DES2 FG_TESTOLIB DT_UFFIC FG_IVASOSPESA DT_DECOR DT_SCAD
=========


1 ROW SELECTED
IN 0.01 SECONDS

100.00 ROWS PER SECOND / 0.01 SECONDS PER ROW


Afetr inserting some new row in righe_Doc with
ALTER TABLE righe_doc ADD
id_produzione varchar(10),
t_bloccorigdoc smallint,
dt_bloccorigdoc datetime,
c_identita_bloccorig int,
c_analisifabb varchar(10),
n_qtaprenotata decimal(18, 8)

this is what I get.


=========== =========== ==================== ===========
1 3 21-SEP-2012 00:00:00 1


1 ROW SELECTED
IN 0.01 SECONDS

100.00 ROWS PER SECOND / 0.01 SECONDS PER ROW

We have 114 columns in righe_doc and 146 in testa_doc.
Too much?

And with select * from testa_doc T inner join righe_doc R on R.c_ditta=T.c_ditta and T.t_docum=R.t_docum and T.dt_docum=R.dt_docum
and T.n_docum=R.n_docum inner join ana_art A on R.c_ditta=A.c_ditta and R.c_articolo=A.c_articolo ;
this is the output
ana_art has 78 columns.




1 ROW SELECTED
IN 0.01 SECONDS

100.00 ROWS PER SECOND / 0.01 SECONDS PER ROW

Why these strange characters and why TD and ST don't get the correct data?
With SqlServer Query Analizer I have no problems. All data are returned.
Any hint?
Thank you.

gigit
Italy
Posts: 166
Joined: 14 Jun 2017, 15:04
Location: Italy

Re: TD 4.1 and sqlserver?

Post by gigit » 21 Sep 2012, 16:45

Even calling select T.c_ditta
,T.t_docum
,T.dt_docum
,T.n_docum
...
etc instread of select * I get

=========== =========== ==================== ===========
1 3 21-SEP-2012 00:00:00 1

gigit
Italy
Posts: 166
Joined: 14 Jun 2017, 15:04
Location: Italy

Re: TD 4.1 and sqlserver?

Post by gigit » 25 Sep 2012, 15:39

Here the result of this select in 4.1 and 5.2. As you can see in 4.1 it is wrong in 5.2 it seems correct even if not all 260 fileds are retrieved, but only 255. The instruction in both of cases is the same

Call SalTblPopulate( tbl1, hSqlMain, 'SELECT * FROM
(testa_doc T inner join righe_doc R on T.c_ditta=R.c_ditta and T.t_docum=R.t_docum
and T.dt_docum=R.dt_docum and T.n_docum=R.n_docum)', TBL_FillNormal )

Is there a reason for this behaviour?
The amount of rows is not relevant. I tried from 1 row till 1.500.000. and the Operating System too (XP, 7, 2003, 2008).
Many thanks.
You do not have the required permissions to view the files attached to this post.

gigit
Italy
Posts: 166
Joined: 14 Jun 2017, 15:04
Location: Italy

Re: TD 4.1 and sqlserver?

Post by gigit » 25 Sep 2012, 16:00

But only first 5 columns are populated, even if all rows are full.

Geert_Schröder
Germany
Posts: 328
Joined: 01 May 2019, 08:04
Location: Germany

Re: TD 4.1 and sqlserver?

Post by Geert_Schröder » 02 Dec 2012, 22:53

4.1 does not work with unicode and 5.1 does.
If columns are of type unicode this would be the reason.
Geert

gigit
Italy
Posts: 166
Joined: 14 Jun 2017, 15:04
Location: Italy

Re: TD 4.1 and sqlserver?

Post by gigit » 06 Feb 2013, 17:19

Thank you, Geert, sorry for my late response, but I think that the problem is due to the number of columns. May be? There are no unicode columns in the tables. Or it is an ODBC driver problem.

Warren

Re: TD 4.1 and sqlserver?

Post by Warren » 07 Mar 2013, 17:23

We use TD4.0 and have the same issue. You can only select a maximum of 255 columns from a database. I think it is a SQLWindows limit?
We way we work around it is to split the statement into two.
i.e. Select the first 250 columns including an ID column. then for each record returned fetch the rest of the columns based on the ID value obtained.

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests