2pack SQL statements cross client borders

Description

When I create a packout line of type "SQL Statement" I can use an SQL UPDATE command to change my data. My axample is this:

This code does not only inactivate the DocTypes in the active client but in all clients. A WHERE clause could help but at the time when I create the 2pack file I can not know which Client ID the user has when he uses PackIn.

One solution could be to automatically add an appropriate WHERE clause. I think this is nit easy to implement for all possible SQL texts. My idea is to allow context variables like this:

wdyt?

Environment

None

Activity

Show:
Carlos Ruiz
August 12, 2014, 9:59 PM

IMHO sounds like a good improvement

Thomas Bayen
August 13, 2014, 11:53 AM

This patch works for me. I tested it with the given SQL command. Please review.

Hiep Lq
February 2, 2016, 8:19 PM

this improve will avoid input sql like update for display logic.
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/idempiere/hNs9Kwcdkjo/RJ13s-ZoDQAJ

Hiep Lq
February 3, 2016, 2:10 AM

hi , for me, your suggest at forum is a solution, not only work-around.
but i already done a patch for it, so just attach here.
if you think chr(64) is ok, please help me close this ticket.

Carlos Ruiz
February 3, 2016, 5:16 PM

Thanks , I would like a solution like you proposed (escape) but in a more general approach - I think we have found similar issues in past with other functionalities - so implementing some ability to "escape" pounds on Env.parse could be good.

But that sounds like another ticket for improvement.

I'll close this one as per your advice.

Regards,

Carlos Ruiz

Assignee

Thomas Bayen

Reporter

Thomas Bayen

Tested By

None

Components

Priority

Major
Configure