Slick insert with select

24 views
Skip to first unread message

Prasad Mokkapati

unread,
Feb 24, 2017, 12:35:20 AM2/24/17
to Slick / ScalaQuery
Hi All,

I am trying to do a insert with select using sqlu 

sqlu"""INSERT into targeted_email(targeted_campaign_id, cu_id,

          email, is_completed)

        SELECT $campaign_id, cu_id, value, true

          FROM consumer_identifier

          WHERE type= 'Email' and cu_id in ($ids)""".first

where I have a large number of ids - using slick 2.1 and mysql. I am using aws and set the following parameters

max_allowed_packet

bulk_insert_buffer_size

to very high values.

The above code however seem to insert only one record into the database although there are 248 ids to be inserted.

Also tried list instead of first with the same results.

Is there a way to do this insert with select either using sqlu or functional mapping ?


Thanks

Prasad Mokkapati

unread,
Feb 24, 2017, 12:45:04 AM2/24/17
to Slick / ScalaQuery
PS. The $ids are a list of ids I.E  - 123, 113, 114 ..
Reply all
Reply to author
Forward
0 new messages