Pitre,

I would suggest this simple variation...


***************************
$ProdlistFileLocation$ = $536880933$
'ProdlistFileLocation_PATH' = $ ???  $
'ProdlistFileLocation_FILENAME' = $ ???  $


Active Link:
Action#1
Run Process
PERFORM-ACTION-ADD-ATTACHMENT 536880933

Action#2
Set Field
 'ProdlistFileLocation_PATH' = $ProdlistFileLocation$

Action#3
Set Field
'ProdlistFileLocation_FILENAME' =
SELECT SUBSTR ('$ProdlistFileLocation_PATH$',(INSTR
('$ProdlistFileLocation_PATH$','\',-1))+1) FROM DUAL

Action#4
Set Field
'ProdlistFileLocation_PATH' = REPLACE($ProdlistFileLocation_PATH$,
$ProdlistFileLocation_FILENAME$, $NULL$)

***************************


My action 2 above was inserted to "get a sting value" for the path and
file name. This will do two things to allow the map of the data type
into the SQL string to be "more straight forward" and to get a start
on the value for the "PATH". At this point it has path and file name.
Which is what action #4 is to "fix" by replacing the file name that
was found with a null value. You may or may not want to leave the last
character of the PATH value as a "/" or "\", so you could do other
things there too.


--
Carey Matthew Black
Remedy Skilled Professional (RSP)
ARS = Action Request System(Remedy)

Solution = People + Process + Tools
Fast, Accurate, Cheap.... Pick two.
Never ascribe to malice, that which can be explained by incompetence.



On 7/28/06, Mathieu Pitre <[EMAIL PROTECTED]> wrote:
Hi all,

ARS 6.3

I am trying to separate the file name out of the path by using an active
link to add an attachment in a Display-only attachement field. The first
action works properly because I can use another action to set the field in
a character field and then I see the path and the file name. However, I
would like to have the path in one charater field and the file name in
another character field. To achieve this(I started with the file name)
someone recommended me to use a Set Field SQL as shown below. However, it
does not work when I use the variable($ProdlistFileLocation$) which is my
attachement field. I receive a memory error and my client crashes. If I
manually add the string in the SQL function is works: SELECT SUBSTR
('\\path\path\path\path\FileName.ext',(INSTR
('\\path\path\path\path\FileName.ext','\',-1))+1) FROM DUAL
There is something I dont get. Also if I set a character field containing
the string mentioned above (\\path\path\path\path\FileName.ext) it works.
Is this a bug?


***************************
$ProdlistFileLocation$ = $536880933$


Active Link:
Action#1
Run Process
PERFORM-ACTION-ADD-ATTACHMENT 536880933

Action#2
Set Field
SELECT SUBSTR ('$ProdlistFileLocation$',(INSTR
('$ProdlistFileLocation$','\',-1))+1) FROM DUAL

***************************

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at http://www.wwrug.org

Reply via email to