04-03-2017, 12:11 PM,
|
|||||
|
|||||
Modify Record
Hi every body ! I have a problem about modify RecordSet after get from database via connection.
This is my source code . ========================================================= {import * from CURL.DATA-ACCESS.BASE} {import * from CURL.DATA-ACCESS.CONNECTED} {let connection:BasicConnection = {BasicConnection {url "http://192.168.1.18:9999/cdbc-server/CdbcServlet"}} } {let sqlChart:String={String "SELECT E.EMPLOYEE_ID, E.FIRST_NAME, E.LAST_NAME, E.EMAIL, E.PHONE_NUMBER, E.HIRE_DATE, E.JOB_ID, E.SALARY, E.COMMISSION_PCT, (SELECT CONCAT(CONCAT(S.FIRST_NAME,' '),S.LAST_NAME) FROM EMPLOYEES S WHERE S.EMPLOYEE_ID = E.MANAGER_ID) AS MANAGER , D.DEPARTMENT_NAME FROM EMPLOYEES E LEFT JOIN DEPARTMENTS D ON E.DEPARTMENT_ID = D.DEPARTMENT_ID" } } {let rsbase:RecordSet={connection.create-record-set "HR","EMPLOYEES",request-modifiable?=true}} {define-proc {get-all-record rss:RecordSet}:RecordSet {let rsMod:RecordSet = {RecordSet {RecordFields {RecordField "f_name",caption = "FIRST NAME", domain = String}, {RecordField "l_name",caption ="LAST NAME",domain = String} } } } {for r:Record in rss do {rsMod.append{RecordData f_name = r["FIRST_NAME"],l_name = r["LAST_NAME"] }} } {return rsMod} } {let rs:RecordSet = {get-all-record rsbase}} {value rs.size} ================================================================= it's seem a problem happend in my proc get-all-record,I couldn't modified RecordSet. Please tell me about this problem. Thanks |
|||||
04-03-2017, 01:23 PM,
(This post was last modified: 04-03-2017, 01:27 PM by dyoshida.)
|
|||||
|
|||||
RE: Modify Record
Before appending a new record, you need to create a new record using Recordset.new-record method.
Code: {for r:Record in rss do |
|||||
04-03-2017, 01:58 PM,
|
|||||
|
|||||
RE: Modify Record
(04-03-2017, 01:23 PM)dyoshida Wrote: Before appending a new record, you need to create a new record using Recordset.new-record method.Thank you very much ! I wil try it . |
|||||
« Next Oldest | Next Newest »
|
Possibly Related Threads... | |||||
Thread | Author | Replies | Views | Last Post | |
Record の選択について | umemura | 2 | 3,395 |
11-01-2011, 02:58 PM Last Post: umemura |
Users browsing this thread:
3 Guest(s)
3 Guest(s)