Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix cleanupSQL in DBMSSQL.php #192

Open
oms-rubus opened this issue Apr 3, 2013 · 2 comments
Open

fix cleanupSQL in DBMSSQL.php #192

oms-rubus opened this issue Apr 3, 2013 · 2 comments

Comments

@oms-rubus
Copy link

I have an exception when try to insert values in table:
Unable to execute INSERT statement [INSERT INTO movie (STUDIO_ID,COUNTRY_ID,CATEGORY_ID,TITLE,TITLE_ENG,YEAR,DESCRIPTION,MPAA,LENGTH,AGE) VALUES (:p9,:p2,:p3,:p4,:p5,:p6,0xd09ed0bfd0b8d181d0b0d0bdd0b8d0b520d182d0b5d181d182d0bed0b2d0bed0b3d0be20d184d0b8d0bbd18cd0bcd0b0,:p7,:p8,:p90)] [wrapped: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined]

Fix row 298 in sfPropelORMPlugin/lib/vendor/propel/runtime/lib/adapter/DBMSSQL.php (cleanupSQL method)
from: preg_match_all('/:p\d/', $sql, $matches);
to: preg_match_all('/:p\d+/', $sql, $matches);

@brunnels
Copy link
Contributor

brunnels commented Apr 3, 2013

Good catch. Is DESCRIPTION actually a blob or should it be longvarchar?
The reason I ask is the binary you see in the query is a workaround for
dblib's ability to save binary data properly. I'm sure it adds a bit of
overhead to the queries when used so if you aren't storing binary data it
would be best to use longvarchar instead.

On Wed, Apr 3, 2013 at 8:03 AM, Maxim [email protected] wrote:

I have an exception when try to insert values in table:
Unable to execute INSERT statement [INSERT INTO movie
(STUDIO_ID,COUNTRY_ID,CATEGORY_ID,TITLE,TITLE_ENG,YEAR,DESCRIPTION,MPAA,LENGTH,AGE)
VALUES
(:p9,:p2,:p3,:p4,:p5,:p6,0xd09ed0bfd0b8d181d0b0d0bdd0b8d0b520d182d0b5d181d182d0bed0b2d0bed0b3d0be20d184d0b8d0bbd18cd0bcd0b0,:p7,:p8,:p90)]
[wrapped: SQLSTATE[HY093]: Invalid parameter number: parameter was not
defined]

Fix row 298 in
sfPropelORMPlugin/lib/vendor/propel/runtime/lib/adapter/DBMSSQL.php
(cleanupSQL method)
from: preg_match_all('/:p\d/', $sql, $matches);
to: preg_match_all('/:p\d+/', $sql, $matches);


Reply to this email directly or view it on GitHubhttps://github.com//issues/192
.

@oms-rubus
Copy link
Author

I am trying to migrate project from mysql to mssql with minimal changes in current scheme. But I am thinking about using longvarchar for description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants