LPAD is a SQL function, not an ObjectScript function, which is why it didn't work for you if you replaced the single quotes with double quotes.
USER>write ">"LPAD(1,10,"0")"<"There are two ways to solve the problem: using embedded SQL or an analog of LPAD for ObjectScript, for example:< USER>write ">"$$lpad^%qarfunc(1,10,"0")"<" 0000000001<
CREATE TABLE example_table (
id VARCHAR(10) PRIMARY KEY,
normalized_id VARCHAR(10) COMPUTECODE {
&sql(select LPAD(:{id}, 10, '0') into :{*})
}
COMPUTEONCHANGE(id))
- Log in to post comments