Reuben,
thanks a lot for looking at this thing...

the cake version I use is: 2.2.3

so I might try to use to convert it to nvarchar in MSSQL, would it help??

I will try to get the sql message from the driver -  I will post it 
ASAP.But I will need to leave office now.

Thank you, very appreciated your assistance :) I have been looking so much 
but not this way. have a great day in Australia :)

Tomas


On Wednesday, November 14, 2012 5:48:20 PM UTC-5, Reuben wrote:
>
> Actually, I had a bit more of a look around.  The only thing that jumps 
> out at me is that Cake/Model/Datasource/Database/Sqlserver.php doesn't have 
> a mapping of VARCHAR to a string or text type.  It only handles nvarchar.
>
> It's the DboSource::value that determines if the value should be quoted or 
> not. CakePHP 2.2.3 seems to have handling such that if the value can not be 
> recognised by the type, and it doesn't get parsed as a float, int or 
> numeric, then it gets quoted.
>
> This is when it would be handy to see the actual SQL getting generated.
>
> On Thursday, 15 November 2012 08:03:41 UTC+10, Tomas wrote:
>>
>> Hi!!
>> I work ussualy with mysql and I work in cake long time, but now with MS 
>> SQL, I get strange error on very simple thing - *view*, *index*, 
>> *edit*methods within 
>> *SCAFFOLD mode.*
>> *
>>
>> Error: *SQLSTATE[22018]: [Microsoft][SQL Server Native Client 11.0][SQL 
>> Server]Conversion failed when converting the varchar value 'G12345' to data 
>> type int.
>>
>> There is a table called *'item'*, which has a field GLID - vachar(20). 
>> Simple field, not even primary key. the only thing is that it is in 
>> relation with other table 'material' with same properties. E.g. 'item' 
>> hasMany 'material' AND 'material' belongsTo 'item'.
>>
>> Can I link varchars as foreign keys in cake?? Because if I edit the field 
>> values and I remove letter 'G' ... 'G12345' >> '12345' then it works 
>> ok!! why cake converts something to int??
>>
>>
>> Any idea?
>>
>> Thank you
>> Tomas
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en.


Reply via email to