Oracle APEX - Invalid lob when calling to APEX Apex_mail.send - plsql

I have a Oracle Database 18c Standard Edition 2 Release 18.0.0.0.0 server with Oracle apex 19 running on a Linux box.
I am testing send emails with templates build on Apex. If I run the below code I get a error
begin
Apex_mail.send(p_application_id => 100,
p_to => 'demo#example.com',
p_from => 'demo_1#example.com',
p_template_static_id => 'TEST',
p_placeholders => '{"count":1}');
end;
ORA-06502: PL/SQL: error : invalid LOB locator specified: ORA-22275 numérico o de valor
ORA-06512: en "SYS.DBMS_LOB", línea 727
ORA-06512: en "APEX_190100.WWV_FLOW_MAIL", línea 776
ORA-06512: en "APEX_190100.WWV_FLOW_MAIL", línea 849
ORA-06512: en "APEX_190100.WWV_FLOW_MAIL", línea 873
ORA-06512: en "APEX_190100.WWV_FLOW_MAIL_API", línea 88
ORA-06512: en línea 3
I've tested same code in other Oracle server without problem.
If I call to the overloaded function of APEX_mai.send as bellow, it work fine.
begin
apex_mail.send(p_to => 'demo#example.com',
p_from => 'demo1#example.com,
p_body => 'Main email text goes here',
p_subj => 'APEX_MAIL - Plain Text message');
Apex_Mail.push_queue;
end;
Note:
Application 100 and template "TEST" exists in my apex workspace
My question, what is the problem in my code when I use template?
I have tried sending an empty placeholder, but I get the same result

I found the problem, For some strange reason, the "text plain" template should not be empty, I added a "."(yes, a simple dot) in the template with plain text and it started working.

Related

Woocomemrce API coupons retreive doesn't work anymore, why?

Goodmorning,
i had created a php script that retreive the lists of all coupons.
After the last Wordpress update 6.0 this doesnt works anymore.
$coupons = json_encode($woocommerce->get('coupons', array('per_page' => 50)));
this is the error i receive now
Fatal error: Uncaught Automattic\WooCommerce\HttpClient\HttpClientException: Error: <p>Si è verificato un errore critico sul tuo sito web.</p><p>Scopri di più riguardo la risoluzione dei problemi in WordPress.</p> [internal_server_error] in C:\xampp\htdocs\coupon\vendor\automattic\woocommerce\src\WooCommerce\HttpClient\HttpClient.php:350 Stack trace: #0 C:\xampp\htdocs\coupon\vendor\automattic\woocommerce\src\WooCommerce\HttpClient\HttpClient.php(386): Automattic\WooCommerce\HttpClient\HttpClient->lookForErrors(Object(stdClass)) #1 C:\xampp\htdocs\coupon\vendor\automattic\woocommerce\src\WooCommerce\HttpClient\HttpClient.php(422): Automattic\WooCommerce\HttpClient\HttpClient->processResponse() #2 C:\xampp\htdocs\coupon\vendor\automattic\woocommerce\src\WooCommerce\Client.php(82): Automattic\WooCommerce\HttpClient\HttpClient->request('coupons', 'GET', Array, Array) #3 C:\xampp\htdocs\coupon\index.php(18): Automattic\WooCommerce\Client->get('coupons', Array) #4 {main} thrown in C:\xampp\htdocs\coupon\vendor\automattic\woocommerce\src\WooCommerce\HttpClient\HttpClient.php on line 350
At the moment i have the same script to retreive the list of all orders and it works without any problems.
Can someone help me to understand what is happening?
Thank you

Fatal error within Woocommerce "wc-template-functions.php" file

I have tried to edit wc-template-functions.php in my store and did something wrong.
Now I am getting Fatal Error on 281 line.
Fatal error: Uncaught Error: Class 'Constants' not found in /home/kidsandm/oliverthedog/wp-content/plugins/woocommerce/includes/wc-template-functions.php:282 Stack trace: #0 /home/kidsandm/oliverthedog/wp-includes/class-wp-hook.php(292): wc_generator_tag('<meta name="gen...', 'xhtml') #1 /home/kidsandm/oliverthedog/wp-includes/plugin.php(212): WP_Hook->apply_filters('<meta name="gen...', Array) #2 /home/kidsandm/oliverthedog/wp-includes/general-template.php(4728): apply_filters('get_the_generat...', '<meta name="gen...', 'xhtml') #3 /home/kidsandm/oliverthedog/wp-includes/general-template.php(4650): get_the_generator('xhtml') #4 /home/kidsandm/oliverthedog/wp-includes/general-template.php(4627): the_generator('xhtml') #5 /home/kidsandm/oliverthedog/wp-includes/class-wp-hook.php(292): wp_generator('') #6 /home/kidsandm/oliverthedog/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(NULL, Array) #7 /home/kidsandm/oliverthedog/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #8 /home/kidsandm/oliverthedog/wp-includes/gen in /home/kidsandm/oliverthedog/wp-content/plugins/woocommerce/includes/wc-template-functions.php on line 282
Before that I also had warning at the top that said:
Warning: The use statement with non-compound name 'AutomatticJetpackConstants' has no effect in /home/kidsandm/hondamarine/wp-content/plugins/woocommerce/includes/wc-template-functions.php on line 11
but I have hide that line thinking it might help.
What I have change in file?
Additional information.
I was thinking it will change the name of it on front-end as well.
// Additional information tab - shows attributes.
if ( $product && ( $product->has_attributes() || apply_filters( 'wc_product_enable_dimensions_display', $product->has_weight() || $product->has_dimensions() ) ) ) {
$tabs['additional_information'] = array(
'title' => __( 'Additional information', 'woocommerce' ),
'priority' => 20,
'callback' => 'woocommerce_product_additional_information_tab',
);
}
Line 1798.
I have tried to find a code only to replace it, and I found one but did not help.
Now, that code might not be original because I could not find it on GitHub.
Thanks a lot!
It just happened to me too, I tried to edit the code for the same reason, I searched a lot about this problem and I solved it when I downloaded the plugin in zip form and manually upload it and install it, now its working fine for me and all data still in place (categories, products, etc.)!
I had the following 2 errors:
Fatal Error: Uncaught error: Class 'Constants' not found in /Users/anastasiades/Local Sites/pisinaspa/app/public/wp-content/plugins/woocommerce/includes/wc-template-functions.php on line 282
Error: Class 'Constants' not found in /Users/anastasiades/Local Sites/pisinaspa/app/public/wp-content/plugins/woocommerce/includes/wc-template-functions.php on line 282
Steps:
1. Backup data in woocommerce
2. Download plugin here
3. On WordPress go to Plugins >> Add new >> Upload plugin
4. Choose Reinstall >> Install now
5. "Replace current with uploaded"
I recommend a good backup of the products and other data before doing this.
Peace!

Bugzilla throws error when migrating from an old version

I am trying to migrate from an old bugzilla to a newer one. I installed a newer one on a new server. I run ./checksetup.pl and this is the error:
A valid TYPE was not specified for this column (got $VAR1 = {'PRIMARYKEY' => 1,'ENGINE' => 'MEDIUMSERIAL','NOTNULL' => 1};
) at Bugzilla/DB/Schema.pm line 1975.
Bugzilla::DB::Schema::get_type_ddl('Bugzilla::DB::Schema::Mysql=HASH(0x8 120cd8)', 'HASH(0x8261308)') called at Bugzilla/DB/Schema/Mysql.pm line 380
Bugzilla::DB::Schema::Mysql::get_rename_column_ddl('Bugzilla::DB::Schema ::Mysql=HASH(0x8120cd8)', 'fielddefs', 'fieldid', 'id') called at Bugzilla/DB.pm line 1026
Bugzilla::DB::bz_rename_column('Bugzilla::DB::Mysql=HASH(0x7fed8c0)', 'f ielddefs', 'fieldid', 'id') called at Bugzilla/Install/DB.pm line 69
Bugzilla::Install::DB::update_fielddefs_definition() called at ./checkse tup.pl line 164

I cant restore the dumpfile,

i am useing Oracle 11g Express and i used this command to restore a dumpfile
impdp SCHEMAS=datamining DIRECTORY=data_pump_dir DUMPFILE=dm.dmp remap_tablespace=system:users
then it gave me the below error:
.
.
.
x number;
y varchar2(200);
l_input utl_file.file_type;
begin
dbms_output.enable;
dbms_output.put_line(year_);
dbms_output.put_line(cycle);
select count(0) into x f
Processing object type SCHEMA_EXPORT/FUNCTION/ALTER_FUNCTION
ORA-39083: Object type ALTER_FUNCTION failed to create with error:
ORA-31625: Schema DATAMINING is needed to import this object, but is unaccessible
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.KUPW$WORKER", line 6720
ORA-01435: user does not exist
Failing sql is:
ALTER FUNCTION "DATAMINING"."AUTO_CORR" COMPILE PLSQL_OPTIMIZE_LEVEL= 2
PLSQL_CODE_TYPE= INTERPRETED PLSQL_DEBUG= FALSE PLSCOPE_SETTINGS= 'ID
ENTIFIERS:NONE' REUSE SETTINGS TIMESTAMP '2015-10-02 10:04:21'
ORA-39083: Object type ALTER_FUNCTION failed to create with error:
ORA-31625: Schema DATAMINING is needed to import this object, but is unaccessible
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.KUPW$WORKER", line 6720
ORA-01435: user does not exist
Failing sql is:
.
.
.
.
CREATE FORCE VIEW "DATAMINING"."B_CLEANING_1" ("FILE_", "CUSTOMER_ID", "PRE_DEB
T", "PRICE", "DATE_", "CYCLE_", "YEAR_") AS select b."FILE_",b."CUSTOMER_ID",b."
PRE_DEBT",b."PRICE",b."DATE_",b."CYCLE_",b."YEAR_"
from bills b
where b.c
ORA-39083: Object type VIEW failed to create with error:
ORA-31625: Schema DATAMINING is needed to import this object, but is unaccessible
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.KUPW$WORKER", line 6720
ORA-01435: user does not exist
Failing sql is:
CREATE FORCE VIEW "DATAMINING"."MT" ("FILE_", "CUSTOMER_ID", "SPECIAL_TYPE", "U
SAGE1", "USAGE2", "USAGE3", "CYCLE_", "YEAR_", "END_", "LENGTH_DAY", "CONTRACT_P
OWER", "PRE_DEBT", "PRICE", "C_CYCLE", "B_DATE", "B_CYCLLE") AS select m.file
Processing object type SCHEMA_EXPORT/TYPE/TYPE_BODY
ORA-39083: Object type TYPE_BODY failed to create with error:
ORA-01435: user does not exist
Failing sql is:
CREATE TYPE BODY "DATAMINING"."AUTO_CORRIMPL" IS
STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT auto_corrImpl)
RETURN NUMBER IS
-- initialize the variables
BEGIN
sctx := auto_corrImpl(0, sys.odcinumberlist());
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateIterate(self IN OUT auto_corrImpl,
VALUE IN NUMBER) RETURN NU
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "SYS"."SYS_IMPORT_SCHEMA_01" completed with 69 error(s) at 06:29:50
comment 1:we did remap_tablespace because we wrongly put the schema on system tablespace,
comment 2:we run this code on one computer and it worked but it is not working on other computer
Please guide me...
It seems the datamining user does not exist. Please create it and retry the import.
Thanks
Sabiha

ORA-01830 Error for 11.2.0 client but not for 10.2 client

I have this piece of code:
BEGIN
DBMS_SCHEDULER.DROP_JOB (
job_name => 'LOANSBUILD.LOANSNEWYORKCLOSE');
END;
/
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => '***.LOANSNEWYORKCLOSE',
job_type => 'PLSQL_BLOCK',
job_action => 'begin loans_schedule_job.loans_close(TRUNC(SYSDATE), ''N''); end;',
start_date => '15-NOV-08 12.00.00.000000000 AM AMERICA/NEW_YORK',
repeat_interval => 'FREQ=WEEKLY;BYDAY=MON,TUE,WED,THU,FRI;BYHOUR=16;BYMINUTE=0;BYSECOND=0',
auto_drop => FALSE,
job_class => 'DEFAULT_JOB_CLASS',
enabled => TRUE,
comments => 'Test.'
);
END;
/
exit;
When the above is executed from an environment which has oracle sql client 10.2 installed , this goes fine but when the same is executed fron an environment that has 11.2 client installed, this fails as below:
BEGIN
*
ERROR at line 1:
ORA-01830: date format picture ends before converting entire input string
ORA-06512: at line 2
The variable nls_date_format is set to 'DD-MON-RR' in the 10.2 environment and set to 'YYYY-MM-DD HH24:MI:SS' in the 11.2 env.
As this was getting compiled for 10.2 env, I updated nls_lang_date in the 11.2 env as well to make it 'DD-MON-RR' but even after that I get the same error. Is there anything else I should be setting.
Please note that I am sysadmin and as this code is getting compiled on of the server, my job is to ensure that it does on others as well. Which also means that I do not have permissions to update code.
According to the CREATE_JOB Procedure documentation, the parameter start_date must be of type TIMESTAMP WITH TIME ZONE.
In your PL/SQL code you are instead passing a string thus relying on implicit conversion.
You could instead use an explicit conversion to the TIMESTAMP WITH TIME ZONE data type such as:
TO_TIMESTAMP_TZ('15-NOV-08 12.00.00.000000000 AM AMERICA/NEW_YORK', 'DD-MON-RR HH:MI:SS.FF AM TZR')

Resources