Skip to main content
Participant
October 7, 2010
Question

executing a oracle function with parameters ...

  • October 7, 2010
  • 3 replies
  • 805 views

Hi All,

I'm trying to execute this part of the code:

<cfdirectory action="list"

directory="#getDirectoryFromPath(sharedPath)#"

name="currentDir">

<cfoutput query="currentDir">

<cfset filename = sharedPath & name>

<cfif find(".csv",name)>

<cfexecute name = "#Application.c_script_dropfileupload_path#main_dropfileupload.sh"

arguments = """#name#"" ""#sharedPath#"""

variable = "Variables.upload_progress"

timeout = "500">

</cfexecute>

<tr>

<td colspan="3" class="text">

<cfquery name="getvalcount"

datasource="#Application.c_dsn#"

dbtype="ODBC"

password="#Session.Password#"

username="#Session.UserID#">

SELECT pk_cpv_drop_file_upload.sf_drop_validate_and_count(replace(#name#,".csv","")) FROM dual

</cfquery>

<cfoutput> #getvalcount.sf_drop_validate_and_count# </cfoutput>

</td>

</tr>


but I'm receiving the error from oracle telling: illegal zero-length identifier

My question is...
IS there a way to pass the parameter #name# to this function sf_drop_validate_and_count ? or should I work with parameters to a stored procedure?

Thanks in advance

Regards

Alex


This topic has been closed for replies.

3 replies

Participant
October 7, 2010

Hi ALL,

Just to inform you that I've found a solution when you need to apply variables as a parameter:

preserveSingleQuotes(vFileName)

preserveSingleQuotes function will keep the string like this 'dadsadsad' and so, you can use it inside your functions, procedures, etc..

Thanks for all the reponses I've received.

Best regards

Alex

Inspiring
October 8, 2010

Using cfqueryparam would probably accomplish the same thing better.  In some dbs you can't use it inside functions, but I don't think oracle is one of those.

ecobb
Inspiring
October 7, 2010

try putting it in quotes:

sf_drop_validate_and_count(replace('#name#',".c sv",""))

Inspiring
October 7, 2010

If this was my problem, the first thing I would do is pass a hard coded value to the function.  If that actually works, read your error message again.  It's possible that you passed an empty string.

As far as cfquery vs sp goes, all else being equal, sp will be faster because it's pre-compiled.