Questions tagged [create-function]

114 questions
1
vote
1 answer

Can not call a user defined function with CHAR parameter on DB2 for i

I create a function in DB2 (Version 6.01) this way: CREATE FUNCTION myschema.test_c_c(param CHAR(1)) RETURNS CHAR(1) RETURN param; and get a succses message and "System i Navigator" show me that function under myschema. But when I try to call this…
Heinz Z.
  • 1,537
  • 3
  • 14
  • 29
1
vote
4 answers

Embed Array in Code of create_function() in PHP

In order to pass an array in the code of create_function(), passing it to the parameter works, $array = array('a', 'b', 'c'); $func = create_function('$arr', ' foreach($arr as $var) echo "$var
"; '); $func($array); But…
Teno
  • 2,582
  • 4
  • 35
  • 57
1
vote
1 answer

Writing Function

I'm writing a function for a data set called opps on part number sales data, and I'm trying to break the data down into smaller data sets that are specific to the part numbers. I am trying to name the data sets as the argument "modNum". Here is…
1
vote
1 answer

Create function that accept arguments of any type (like concat)

How can I create function that accepts arguments of any type. I can create function like this: CREATE FUNCTION test(anyelement,anyelement) ... But when I call it, I have to present arguments of same type: SELECT test(1,2); -- ok But: SELECT…
Yavanosta
  • 1,480
  • 3
  • 18
  • 27
0
votes
2 answers

date to day function - MySQL - help needed

I'm trying to create a MySQL function where I supply the date column and I get the day back in a new column using the below function. This is what I have. The select statement works fine outside the function - I tested it there. Can anyone help get…
Kes
  • 285
  • 2
  • 17
0
votes
1 answer

Using Formoid webform on this page www.franktribute.com/RequestForm/request-form.php and now there is a depreciated error message on the page

The form has recently stopped sending. Deprecated: Function create_function() is deprecated in /home/customer/www/franktribute.com/public_html/RequestForm/testform4_files/formoid1/handler.php on line 239 Code section is: function…
Steve
  • 1
0
votes
0 answers

WordPress plugin issue with PHP 8 | Uncaught Error: Call to undefined function create_function()

I use a Wordpress plugin by Visual Lightbox to create photo galleries on my website. Wordpress recently required that I update to PHP 8 and this caused an error with Wordpress. I have contacted the developer but it appears that they no longer…
0
votes
0 answers

create_function transformed in PHP 8.2

how can i transform the function create_function in PHP 8.2 which give a fatal error ? add_filter( 'pre_site_transient_update_themes', create_function( '$a', "return null;" ) ) Thanks a lot Regards
ASSADOUR
  • 27
  • 4
0
votes
1 answer

rpc function tell me to reload the schema cache

I am creating an rpc function to get the number of likes for each post for a user, so I have created a function that takes userId as an argument, which is the uuid of the user that is in the session. But when I call the function on the front it…
Richi
  • 438
  • 5
  • 18
0
votes
1 answer

How to insert an array of ids with create function in node

I Have defined this mongoose schema in node `const bookingSchema = new mongoose.Schema({ tour: [ { type: mongoose.Schema.ObjectId, ref: 'Tour', required: [true, 'Booking must belong to Tours!'], }, ], user: { …
0
votes
1 answer

Create a Function with 'while' loop in python and use the function to generate a new column in a data frame

I tried to create a new function with "while" in Python. def pmv_calculator(ta, tr, vel, rh, met, clo, wme): pa = rh * 10 * np.exp(16.6536 - 4030.183 / (ta + 235)) icl = 0.155 * clo m = met * 58.15 w = wme * 58.15 mw = m - w if icl <= 0.078: fcl…
0
votes
1 answer

Problem with Create Function statement in MySQL

I am attempting to create a function in MySQL that will return a value based on the presence of specific strings in a field. My select statement will ultimately need to make this evaluation many times so I wanted to create a function for efficiency…
muncieharts
  • 13
  • 1
  • 5
0
votes
1 answer

how to fix deprecated create_function error

i got this error: Function create_function() is deprecated in shipping.php private function calculate_string( $mathString ) { $mathString = trim($mathString); // trim white spaces $mathString = preg_replace ('[^0-9\+-\*\/\(\) ]', '',…
Batuhan
  • 11
  • 1
0
votes
2 answers

Create a function that accepts a string and returns multiple rows

I'm being required to create a function that transforms a single column's value based on the user's input. I need some help on the syntax for doing so. Here is the query I'm currently performing to get the rows: SELECT payment_id, rental_id, amount…
0
votes
1 answer

How can I use CreateFunction to calculate age based on their birthday on mySQL?

I have a table with date of birth and I want to use a CreateFunction to calculate their age. So I was thinking along the lines of extracting year from current date - Year for their date of birth (using YEAR() function as shown below) The function…