That solved it, thank you! I'd been struggling with this for 2 days, 
awesome to move on to other things. In hindsight it seems so simple.
 
I posted this question on SO yesterday with no response. If you have an 
account there & care to make a few extra points, copy/paste your answer and 
I'll accept it as the solution.
 
http://stackoverflow.com/questions/26898670/invalid-parameter-type-error-from-sqlalchemy-insert-in-sql-server
 
--
Thanks,
Chris

On Thursday, November 13, 2014 12:19:02 PM UTC-6, Jonathan Vanasco wrote:

>  Notice the error:
>      'Invalid parameter type.  param-index=2 param-type=list
>
> And then the values you're putting in on index 2:
>     (u'url', None, [2L]
>
> You're submitting a list, instead of single value.
>
> Your problem is this line:
>
>     ins_id = result.inserted_primary_key
>
> according to the docs
>
>
> http://docs.sqlalchemy.org/en/latest/core/connections.html?highlight=inserted_primary_key#sqlalchemy.engine.ResultProxy.inserted_primary_key
>
> "Return the primary key for the row just inserted.
> The return value is a list of scalar values corresponding to the list of 
> primary key columns in the target table."
>
> so you want:
>
> ins_id = result.inserted_primary_key[0]
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to