I'm thinking of doing that because if you need to set values from two
columns, and both use these kind of functions, then while you may get $1$
correctly, I'm wondering what it would set for $2$. I might test that on
Monday before opening a ticket.

Joe

-----Original Message-----
From: Action Request System discussion list(ARSList)
[mailto:[email protected]]on Behalf Of LJ Longwing
Sent: Friday, September 11, 2009 7:44 PM
To: [email protected]
Subject: Re: Setting fields from a direct SQL...


**
Joe,
I haven't tested, but your hypothesis sounds correct.  I would open a defect
with BMC regarding it :)



----------------------------------------------------------------------------
----
From: Action Request System discussion list(ARSList)
[mailto:[email protected]] On Behalf Of Joe DeSouza
Sent: Friday, September 11, 2009 4:47 PM
To: [email protected]
Subject: Setting fields from a direct SQL...


**
Something that I had seen in the past when you use a nested function to
return a value or values where the developer client thinks it has been asked
to query for more than the requested number of columns..

I had to use one that returns a single column but the ARS somehow thinks its
more than a column.. fortunately for me using $1$ works as it returns the
value I want.. why does my dev studio client see 4 columns returned by:

select
'$ztmpRequestID$'||substr(lpad(nextid,$ztmpRequestIDLength$,'0'),length('$zt
mpRequestID$')+1) from arschema where schemaid in (select schemaid from
arschema where name = '$SCHEMA$')

It looks like everytime it sees a comma, it assumes that it is another
column queries whereas that comma could be used in a function like lpad or
length like I did above..

The above is a simple select statement where $ztmpRequestID$ holds the
default value (prefix) of a Request ID returned from:

select defaultvalue from field where schemaid in (select schemaid from
arschema where name = '$SCHEMA$') and fieldid = 1

It uses that prefix and concatinates it to the left padded value of nextid
after removing the first 3 characters so as to construct the Request ID as
it may appear after the submit transaction. Setting my field to $1$ on that
set field operation gives me the correct value - but why do I see $2$, $3$
and $4$ as possible values I can set to my result?

I haven't really checked to see what values these hold but I'm willing to
bet they hold nothing (NULL).

Joe

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor:[email protected] ARSlist: "Where the Answers Are"

Reply via email to