Mathieu,

I don't recall anyone mentioning the Mid-Tier in all this, but if you are using it as well, be aware that adding an attachment won't store the path to the file, just the file name.  See the Web_Windows_Diff.pdf for more info.

Thad
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away."
- Antoine de Saint-Exupéry


"Thomas Bean" <[EMAIL PROTECTED]>
Sent by: "Action Request System discussion list(ARSList)" <arslist@ARSLIST.ORG>

07/28/2006 09:27 AM

Please respond to
arslist@ARSLIST.ORG

To
arslist@ARSLIST.ORG
cc
Subject
Re: Set path from local PC. Almost there...





**
I don't have an Oracle system to test this on, but I'm guessing that the issue might be resulting from the fact that the backslash ( \ ) is defined as an escape character in Oracle query expressions.  I would suggest using Remedy's REPLACE function on the character field first, to change all occurrences of the backslash to another character.  For example:
 
REPLACE($ProdlistFileLocation_PATH$, "\", "#")
 
You should then be able to use the original Oracle SELECT statement with a slight modification to the search character for the INSTR function:
 
SELECT SUBSTR ('$ProdlistFileLocation_PATH$',(INSTR('$ProdlistFileLocation_PATH$','#',-1))+1) FROM DUAL
 
Hope this helps,
 
Thomas
 
----- Original Message -----
From: Thomas Bean
Newsgroups: gmane.comp.crm.arsystem.general
Sent: Friday, July 28, 2006 09:50
Subject: Re: Set path from local PC. Almost there...

**
Mathieu,
What does the SQL log show?
 
--Thomas
 
----- Original Message -----
From: Mathieu Pitre
Newsgroups: gmane.comp.crm.arsystem.general
Sent: Friday, July 28, 2006 09:11
Subject: Re: Set path from local PC. Almost there...


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)" <arslist@ARSLIST.ORG>

28/07/2006 09:49 AM

Please respond to
arslist@ARSLIST.ORG


To
arslist@ARSLIST.ORG
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

__20060125_______________________This posting was submitted with HTML in it___
__20060125_______________________This posting was submitted with HTML in it___

==============================================================================
IMPORTANT NOTICE: This communication, including any attachment, contains information that may be confidential or privileged, and is intended solely for the entity or individual to whom it is addressed. If you are not the intended recipient, you should delete this message and are hereby notified that any disclosure, copying, or distribution of this message is strictly prohibited. Nothing in this email, including any attachment, is intended to be a legally binding signature.
==============================================================================

Reply via email to