0

Let's say I want to insert values in table A, one of the columns in table A require a value which is present in table B, I wanted to know if there was a way to do this without first getting the value from table B and then saving the value in the next step in LLBLGEN

  • Get the value first and then insert – Vivek Nuna Jun 23 '20 at 07:26
  • That's what I don't want to do. Cause then I would have to wrap it in a transaction, which is what I'm avoiding. – Waleed Hasan Jun 23 '20 at 07:33
  • is the value column nullable? in that case, you can first insert then update the same record – Vivek Nuna Jun 23 '20 at 07:43
  • So is there no way to query a record while inserting in LLBLGEN? – Waleed Hasan Jun 23 '20 at 07:57
  • 2
    so you're looking for the llblgen way of doing sql `INSERT INTO t2(x,y) SELECT 'value',column FROM t1 WHERE t1.id = 123` ? How about https://www.llblgen.com/documentation/5.1/LLBLGen%20Pro%20RTF/Using%20the%20generated%20code/gencode_executing_plain_sql.htm ? – Caius Jard Jun 23 '20 at 07:57
  • @WaleedHasan no need to record query, just use the id to use in where clause – Vivek Nuna Jun 23 '20 at 07:58
  • @CaiusJard, this does look like something similar to what I'd want, however I wanted to know if there was a way to do it through LLBLGEN's given framework. Through predicates, or buckets etc? – Waleed Hasan Jun 23 '20 at 09:06

0 Answers0