Skip to Content.
Sympa Menu

freetds - Re: [freetds] Problem with nvarchar output

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Ola Karlsson <olka AT bagheera.se>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Problem with nvarchar output
  • Date: Thu, 31 Jul 2014 14:01:21 +0000

I´ve attached a bigger log but I find it difficult to see what is exactly
related to this query so perhaps I´ve still missed something.
Will adding logg details for a specific instance in freetds.conf cause only
logging for that instance, in my case [ap1Dev], or will it still logg for all
instances?

If it’s the encoding is it a PHP problem or FreeTDS setting that needs to
change?

BR
Ola

-----Ursprungligt meddelande-----
Från: FreeTDS [mailto:freetds-bounces AT lists.ibiblio.org] För Frediano Ziglio
Skickat: den 31 juli 2014 15:41
Till: FreeTDS Development Group
Ämne: Re: [freetds] Problem with nvarchar output

The upper layer decided to cancel the query. The reason could be previously
in the log.
Looks like you are using an encoding which cannot support your charset (there
are some question marks in the output string possibly result of a wrong
conversion).

Frediano


2014-07-31 9:44 GMT+01:00 Ola Karlsson <olka AT bagheera.se>:

> Hi,
> Sorry for the delay. Went on hollidays for a few weeks :)
>
> As far as I can see my error message is stated in the log exactly as
> it should be and it also states two returned results.
> The integer value is returned correctly but not the nvarchar.
>
> I have attached a portion of the log containing the procedure call and
> my error message.
> I don't notice any error messages or so but then again theres a lot of
> information in the logs.
>
> No errors in the php logs either.
>
> Any ideas?
>
>
> BR
> Ola
>
> -----Ursprungligt meddelande-----
> Från: FreeTDS [mailto:freetds-bounces AT lists.ibiblio.org] För Frediano
> Ziglio
> Skickat: den 12 juli 2014 09:06
> Till: FreeTDS Development Group
> Ämne: Re: [freetds] Problem with nvarchar output
>
> Hi,
> did you check TDSDUMP ?
>
> Frediano
>
>
> 2014-07-06 14:32 GMT+01:00 Ola Karlsson <olka AT bagheera.se>:
>
> > Hi
> > I'm using Freetds with PHP5 to access a SQL server but I'm having
> > trouble with the output parameters.
> > I have two parameters, one SQLINT4 and one SQLVARCHAR. The int is
> > working but I don't get any returns from the varchar.
> >
> > Is there anything special that needs to be done when outputting nvarchar?
> >
> > PHP binds,
> > mssql_bind($stmt, '@ErrorMsg',$ErrorMsg,SQLVARCHAR,true,false,4000);
> > mssql_bind($stmt, '@OrderNr',$OrderNr,SQLINT4,true,true,8);
> >
> > SQL parameters,
> > @ErrorMsg nvarchar(4000) output
> > @OrderNr Jeeves_OrderNo output
> >
> >
> > Sql server,
> > SQL Server 2008 R2
> >
> > Freetds server,
> > Ubuntu 12.04 3.5.0-51-generic
> >
> > Tsql -C
> > Version: freetds v0.91
> > freetds.conf directory: /etc/freetds MS db-lib source compatibility:
> > no Sybase binary compatibility: yes Thread safety: yes iconv
> > library: yes TDS version: 4.2
> > iODBC: no
> > unixodbc: yes
> > SSPI "trusted" logins: no
> > Kerberos: no
> >
> > Freetds conf,
> > [global]
> > text size = 64512
> > [Sqlserver]
> > host = xxx.xxx.xxx.xxx
> > port = xxxx
> > tds version = 8.0
> >
> > PHP5
> > PHP 5.3.10-1ubuntu3.12
> >
> >
> > BR
> > Ola
> > _______________________________________________
> > FreeTDS mailing list
> > FreeTDS AT lists.ibiblio.org
> > http://lists.ibiblio.org/mailman/listinfo/freetds
> >
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
>
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds
10:13:50.541062 46051 (token.c:540):tds_process_tokens(0x7f9b0e496ad0,
0x7fff97865f9c, (nil), 0x1508)
10:13:50.541070 46051 (util.c:156):Changed query state from PENDING to READING
10:13:50.541077 46051 (token.c:555):processing result tokens. marker is
d1(ROW)
10:13:50.541084 46051 (token.c:2304):tds_process_row(): reading column 0
10:13:50.541090 46051 (token.c:2049):tds_get_data: type 39, varint size 2
10:13:50.541097 46051 (token.c:2110):tds_get_data(): wire column size is 31
10:13:50.541111 46051 (util.c:156):Changed query state from READING to PENDING
10:13:50.541122 46051
(buffering.h:306):buffer_transfer_bound_data(0x7f9b0e496120 4040 -1
0x7f9b0e496110 0)
10:13:50.541130 46051 (dblib.c:2100):leaving dbnextrow() returning
REG_ROW/MORE_ROWS
10:13:50.541139 46051 (dblib.c:1839):dbcolname(0x7f9b0e496110, 1)
10:13:50.541149 46051 (dblib.c:3056):dbcollen(0x7f9b0e496110, 1)
10:13:50.541158 46051 (dblib.c:3032):dbcolsource(0x7f9b0e496110, 1)
10:13:50.541165 46051 (dblib.c:2831):dbcoltype(0x7f9b0e496110, 1)
10:13:50.541172 46051 (dblib.c:3162):dbdata(0x7f9b0e496110, 1)
10:13:50.541179 46051 (dblib.c:3162):dbdata(0x7f9b0e496110, 1)
10:13:50.541186 46051 (dblib.c:3133):dbdatlen(0x7f9b0e496110, 1)
10:13:50.541193 46051 (dblib.c:3142):dbdatlen() type = 39, len= 31
10:13:50.541200 46051 (dblib.c:7026):dblastrow(0x7f9b0e496110)
10:13:50.541206 46051 (dblib.c:2781):dbclrbuf(0x7f9b0e496110, 1)
10:13:50.541213 46051 (dblib.c:2018):dbnextrow(0x7f9b0e496110)
10:13:50.541220 46051 (dblib.c:2031):dbnextrow() dbresults_state = 2
(_DB_RES_RESULTSET_ROWS)
10:13:50.541227 46051 (token.c:540):tds_process_tokens(0x7f9b0e496ad0,
0x7fff97865f2c, (nil), 0x1508)
10:13:50.541234 46051 (util.c:156):Changed query state from PENDING to READING
10:13:50.541241 46051 (token.c:555):processing result tokens. marker is
ff(DONEINPROC)
10:13:50.541248 46051 (token.c:2339):tds_process_end: more_results = 1
was_cancelled = 0
error = 0
done_count_valid = 0
10:13:50.541256 46051 (token.c:2370): rows_affected = 1
10:13:50.541262 46051 (util.c:156):Changed query state from READING to PENDING
10:13:50.541269 46051 (dblib.c:2100):leaving dbnextrow() returning
NO_MORE_ROWS
10:13:50.541280 46051 (dblib.c:3196):dbcancel(0x7f9b0e496110)
10:13:50.541287 46051 (query.c:2155):tds_send_cancel: not in_cancel and not
idle
10:13:50.541294 46051 (query.c:2164):tds_send_cancel: sending cancel packet
10:13:50.541301 46051 (net.c:741):Sending packet
0000 06 01 00 08 00 00 01 00- |........|

10:13:50.541329 46051 (token.c:540):tds_process_tokens(0x7f9b0e496ad0,
0x7fff97865f3c, (nil), 0x0)
10:13:50.541329 46051 (token.c:540):tds_process_tokens(0x7f9b0e496ad0,
0x7fff97865f3c, (nil), 0x0)
10:13:50.541338 46051 (util.c:156):Changed query state from PENDING to READING
10:13:50.541345 46051 (token.c:555):processing result tokens. marker is
81(TDS7_RESULT)
10:13:50.541352 46051 (token.c:1515):processing TDS7 result metadata.
10:13:50.541359 46051 (mem.c:615):tds_free_all_results()
10:13:50.541367 46051 (token.c:1540):set current_results (1 column) to
tds->res_info
10:13:50.541374 46051 (token.c:1547):setting up 1 columns
10:13:50.541381 46051 (token.c:3420):adjust_character_column_size:
Server charset: UCS-2LE
Server column_size: 8000
Client charset: UTF-8
Client column_size: 16000
10:13:50.541389 46051 (token.c:1486):tds7_get_data_info:
colname = (0 bytes)
type = 39 (varchar)
server's type = 231 (x UCS-2 varchar)
column_varint_size = 2
column_size = 16000 (8000 on server)
10:13:50.541396 46051 (token.c:1556): name size/wsize
type/wtype utype
10:13:50.541404 46051 (token.c:1557): -------------------- ---------------
--------------- -------
10:13:50.541411 46051 (token.c:1567): 16000/8000
39/231 0
10:13:50.541421 46051 (token.c:555):processing result tokens. marker is
d1(ROW)
10:13:50.541429 46051 (token.c:2304):tds_process_row(): reading column 0
10:13:50.541435 46051 (token.c:2049):tds_get_data: type 39, varint size 2
10:13:50.541448 46051 (token.c:2110):tds_get_data(): wire column size is 1864
10:13:50.541466 46051 (token.c:555):processing result tokens. marker is
ff(DONEINPROC)
10:13:50.541474 46051 (token.c:2339):tds_process_end: more_results = 1
was_cancelled = 0
error = 0
done_count_valid = 0
10:13:50.541481 46051 (token.c:2370): rows_affected = 1
10:13:50.541487 46051 (token.c:555):processing result tokens. marker is
79(RETURNSTATUS)
10:13:50.541494 46051 (token.c:690):tds_process_tokens: return status is 0
10:13:50.541501 46051 (token.c:555):processing result tokens. marker is
ac(PARAM)
10:13:50.541508 46051 (token.c:1247):tds_process_param_result(0x7f9b0e496ad0,
0x7f9b0e496b50)
10:13:50.541518 46051 (token.c:1591):tds_get_data_info(0x7f9b0e496ad0,
0x7f9b0e4d1b50, 1) [for parameter]
10:13:50.541527 46051 (token.c:1654):processing result. type =
38(integer-null), varint_size 1
10:13:50.541518 46051 (token.c:1591):tds_get_data_info(0x7f9b0e496ad0,
0x7f9b0e4d1b50, 1) [for parameter]
10:13:50.541527 46051 (token.c:1654):processing result. type =
38(integer-null), varint_size 1
10:13:50.541535 46051 (token.c:1659):processing result. column_size 4
10:13:50.541542 46051 (token.c:2049):tds_get_data: type 38, varint size 1
10:13:50.541549 46051 (token.c:2110):tds_get_data(): wire column size is 4
10:13:50.541556 46051 (log.c:493):type integer-null has value 28387
10:13:50.541563 46051 (token.c:1247):tds_process_param_result(0x7f9b0e496ad0,
0x7f9b0e496b50)
10:13:50.541571 46051 (token.c:1591):tds_get_data_info(0x7f9b0e496ad0,
0x7f9b0e4d1ff0, 1) [for parameter]
10:13:50.541580 46051 (token.c:1654):processing result. type = 39(varchar),
varint_size 2
10:13:50.541587 46051 (token.c:1659):processing result. column_size 4000
10:13:50.541594 46051 (token.c:3420):adjust_character_column_size:
Server charset: CP1252
Server column_size: 4000
Client charset: UTF-8
Client column_size: 16000
10:13:50.541606 46051 (token.c:2049):tds_get_data: type 39, varint size 2
10:13:50.541614 46051 (token.c:2110):tds_get_data(): wire column size is 932
10:13:50.541630 46051 (log.c:480):type varchar has value
"{xxxxxxxx/orp_insert};
10:13:50.541630 46051 (log.c:480):type varchar has value "{xxxxxx/orp_insert};
{0:4153} Artikel är markerad som utgående, enligt aktuell planering finns
registrerat antal EJ DISPONIBELT !
Artikelnr = 84062-10
Lagerställe = 1
Lagersaldo = 2.000000
Reserv ant (behov) = 1.000000
Disp lagersaldo = 1.000000
Beställt antal = 0.000000
Beord ant hos prod = 0.000000
TotLagerSaldo = 1.000000
Orderradantal = 3.000000

Orderrader, artiklar (produkter) =
Ordernummer = 28387
Restordernr = 0
Orderradnr = 60
Ord.radnr f paket = 0
Artikelnr = 84062-10

orp_insert - Info :
10:13:52.030<#>52.030<1>52.030<2>52.030<2>52.030<7>52.030<8>52.030<9>52.030<9>52.033<10>52.033<10>52.033<11>52.033<12>52.033<13>52.033<14>52.033<16>52.033<20>52.$


++++++++++++++++++++++++++++++++++++
Called from: ic_spr_Excel_PlaceOrder
ic_spr_Excel_PlaceOrder - Info : @@NestLevel=1"
10:13:50.541640 46051 (token.c:555):processing result tokens. marker is
fe(DONEPROC)
10:13:50.541647 46051 (token.c:2339):tds_process_end: more_results = 0
was_cancelled = 0
error = 0
done_count_valid = 0
10:13:50.541654 46051 (token.c:2370): rows_affected = 0
10:13:50.542019 46051 (net.c:555):Received header
0000 04 01 00 11 00 39 01 00- |.....9..|

10:13:50.542056 46051 (net.c:609):Received packet
0000 04 01 00 11 00 39 01 00-fd 20 00 fd 00 00 00 00 |.....9.. . ......|
0010 00 - |.|

10:13:50.542072 46051 (token.c:555):processing result tokens. marker is
fd(DONE)
10:13:50.542081 46051 (token.c:2339):tds_process_end: more_results = 0
was_cancelled = 1
error = 0
done_count_valid = 0
10:13:50.542088 46051 (token.c:2355):tds_process_end() state set to TDS_IDLE
10:13:50.542096 46051 (util.c:156):Changed query state from READING to IDLE
10:13:50.542103 46051 (token.c:2370): rows_affected = 0
10:13:50.542126 46051 (dblib.c:5854):dbcanquery(0x7f9b0e496110)
10:13:50.542135 46051 (token.c:540):tds_process_tokens(0x7f9b0e496ad0,
0x7fff97865fec, (nil), 0x108)
10:13:50.542143 46051 (token.c:543):tds_process_tokens() state is COMPLETED
10:13:50.542158 46051 (dblib.c:1668):dbresults(0x7f9b0e496110)
10:13:50.542166 46051 (dblib.c:1674):dbresults: dbresults_state is 3
(_DB_RES_NEXT_RESULT)
10:13:50.542173 46051 (token.c:540):tds_process_tokens(0x7f9b0e496ad0,
0x7fff97865fb8, 0x7fff97865fbc, 0x6914)
10:13:50.542180 46051 (token.c:543):tds_process_tokens() state is COMPLETED
10:13:50.542186 46051 (dblib.c:1695):dbresults() tds_process_tokens returned
2 (TDS_NO_MORE_RESULTS),
result_type TDS_DONE_RESULT
10:13:50.542194 46051 (dblib.c:1657):dbresults returning 2 (NO_MORE_RESULTS)
10:13:50.542562 46051 (dblib.c:1443):dbclose(0x7f9b0e496110)
10:13:50.542579 46051 (dblib.c:258):dblib_del_connection(0x7f9b0471c760,
0x7f9b0e496ad0)
10:13:50.542586 46051 (mem.c:615):tds_free_all_results()
10:13:50.542621 46051 (util.c:156):Changed query state from IDLE to DEAD



Archive powered by MHonArc 2.6.24.

Top of Page