Yii Framework Forum: Big Varbinary Column (Mssql) - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Big Varbinary Column (Mssql) Rate Topic: -----

#1 User is offline   smokeelow 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 02-December 12

Posted 02 December 2012 - 04:23 PM

Hi all.
Work with MSSQL, using pdo_sqlsrv driver(PHP 5.4.8).
In my DB I have column with varbinary type and size of it == 7584.
When I try get value from this column I get error "Invalid sql_display_size in G:\..\..\..\framework\yiilite.php on line 8836".

Here query:
$model = Character::model()->find(array(
            'select'=>'Inventory',
            'condition'=>'Name=:Name',
            'params'=>array(':Name'=>'JohnDoe')
        ));


Maybe someone encountered this problem and can help me.

P.S. Sorry for my bad english)
0

#2 User is offline   KonApaz 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 656
  • Joined: 21-February 11
  • Location:Greece

Posted 02 December 2012 - 05:14 PM

I think this is a PDO MSSQL driver and not Yii bug according to

https://bugs.php.net/bug.php?id=55083
Yii is the best php framework in the world!
Is it post useful? please v++ ;)
0

#3 User is offline   smokeelow 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 02-December 12

Posted 02 December 2012 - 05:46 PM

But last update of mssql drivers was 10/03/2012 I hope they fixed bugs like this, now I think problem in other.

If it is true and there are no solution it's very sad).
0

#4 User is offline   KonApaz 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 656
  • Joined: 21-February 11
  • Location:Greece

Posted 02 December 2012 - 06:03 PM

View Postsmokeelow, on 02 December 2012 - 05:46 PM, said:

But last update of mssql drivers was 10/03/2012 I hope they fixed bugs like this, now I think problem in other.

If it is true and there are no solution it's very sad).


I agree with you that is very sad if it is a bug of PDO

Please send a bug report to
https://bugs.php.net/report.php
Yii is the best php framework in the world!
Is it post useful? please v++ ;)
0

#5 User is offline   smokeelow 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 02-December 12

Posted 03 December 2012 - 04:57 AM

I found solution for my situation. But...

Here query:
 DECLARE @item varbinary(1728); SET @item = (SELECT Inventory FROM Character WHERE Name='CharName'); print @item;


In this case I get exactly that size that I need. It work in normal php query (not PDO) and in MSSQL Managment Studio.

When I run this code in Yii:
        
$query = "DECLARE @item varbinary(1728); SET @item = (SELECT Inventory FROM Character WHERE Name='CharName'); print @item";
$command=Yii::app()->db->createCommand($query)->query();
$command->read();


I get this:

Quote

SQLSTATE[IMSSP]: The active result for the query contains no fields.


I think that I wrong built query.

My question how run query like this in Yii.
0

#6 User is offline   KonApaz 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 656
  • Joined: 21-February 11
  • Location:Greece

Posted 08 December 2012 - 05:10 PM

View Postsmokeelow, on 03 December 2012 - 04:57 AM, said:

I found solution for my situation. But...

Here query:
 DECLARE @item varbinary(1728); SET @item = (SELECT Inventory FROM Character WHERE Name='CharName'); print @item;


In this case I get exactly that size that I need. It work in normal php query (not PDO) and in MSSQL Managment Studio.

When I run this code in Yii:
        
$query = "DECLARE @item varbinary(1728); SET @item = (SELECT Inventory FROM Character WHERE Name='CharName'); print @item";
$command=Yii::app()->db->createCommand($query)->query();
$command->read();


I get this:


I think that I wrong built query.

My question how run query like this in Yii.



Check the below links
http://social.msdn.m...c7-ae9e6786f59c
http://forums.phpfre...-mssql-connect/
Yii is the best php framework in the world!
Is it post useful? please v++ ;)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users