Mathieu,
I do not know. I am (not yet) using Oracle so it is hard for me to
even test it out.
Personally I would not use RDBMS specific solutions unless there
was no other way to achieve the business needs.
I would do as Joe DeSouza (and others if memory serves) has suggested
and using STRSTR repeatedly to find the position of the last "\", "/"
character. So let me outline what I would do...
***************************
'ProdlistFileLocation' = $536880933$
'ProdlistFileLocation_PATH' = $ ??? $
'ProdlistFileLocation_FILENAME' = $ ??? $
'zint_position' = $ ??? $
Active Link:
Action#1
Run Process
PERFORM-ACTION-ADD-ATTACHMENT 536880933
Action#2
Set Field
'ProdlistFileLocation_PATH' = $ProdlistFileLocation$
'ProdlistFileLocation_FILENAME' = $ProdlistFileLocation$
Active link #2:
// assuming your only care about \ as a file separator
Run If : ('ProdlistFileLocation_FILENAME' LIKE "%"+"\"+"%")
Action #1:
zint_position = STRSTR($ProdlistFileLocation_FILENAME$, "\")
Active link #3:
Run If: 'zint_position' > 0
Action #1:
'ProdlistFileLocation_FILENAME' =
SUBSTR($ProdlistFileLocation_FILENAME$, $zint_position$+1)
// The +1 is to also strip the separator that was found
Action #2:
GOTO: <execution order for Active Link #2>
// note this could also have be done inside an Active Link guide
with a GOTO Guide LABEL action too.
// When the active links are done looping you should end up with a
'ProdlistFileLocation_FILENAME' value of just the file name.
// Lastly... you need more more active link to "strip" the file name
from the path part.
Active link #4:
No run if is really needed. It should be safe to do this action at any
point. (unless your path has the exact file name (with extension) as
part of the path. :)
Action#1
Set Field
'ProdlistFileLocation_PATH' = REPLACE($ProdlistFileLocation_PATH$,
$ProdlistFileLocation_FILENAME$, $NULL$)
***************************
HTH.
--
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:
Carey,
I already tried your suggestion (Transferring the Attachment value to a
character field first...) but I am still getting the memory error. There is
something wrong with the variable : $ProdlistFileLocation_PATH$ and the SELECT
command.
SELECT SUBSTR ('$ProdlistFileLocation_PATH$',(INSTR
('$ProdlistFileLocation_PATH$','\',-1))+1) FROM DUAL
Mathieu Pitre
IT Business Systems Analyst
Production Operation
Computer Sciences Corporation
Pratt & Whitney Canada, Plant 1
Sametime: Mathieu Pitre
office: 450-647-8008 x7030
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is a PRIVATE message. If you are not the intended recipient, please
delete without copying and kindly advise us by e-mail of the mistake in
delivery. NOTE: Regardless of content, this e-mail shall not operate to bind
CSC to any order or other contract unless pursuant to explicit written
agreement or government initiative expressly permitting the use of e-mail for
such purpose.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Carey Matthew Black <[EMAIL PROTECTED]>
Sent by: "Action Request System discussion list(ARSList)" <[email protected]>
28/07/2006 09:49 AM
Please respond to
[email protected]
To [email protected]
cc
Subject Re: Set path from local PC. Almost there...
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