BusinessObjects Board

BODI-1110432

I have a script where I’m setting the value of a global variable which I set as as datetime field:

$start_time = to_date(‘20100101’, ‘yyyymmdd’);

When I check the syntax, I get this warning:

[Script:Script9985]
Warning: Expression <$start_time> of type will be converted to type . (BODI-1110432)

I want this to be a date field, how can I do it so it doesn’t convert it to a varchar?


dellster (BOB member since 2008-10-14)

I do get the same warning too but it does produce a valid date/datetime value which I had no problems with loading into Oracle and SQL Server date/datetime columns.


ErikR :new_zealand: (BOB member since 2007-01-10)

Hi,

Have you declared the datatype as ‘Datetime’ for the variable $start_time.

I believe you have declared it as Varchar.

Regards,
Sameer


sameer81 :new_zealand: (BOB member since 2007-09-15)

No, I have declared it as a datetime field and I get this error.


dellster (BOB member since 2008-10-14)

It’s a warning - not an error. Your job should just work fine.


ErikR :new_zealand: (BOB member since 2007-01-10)

The code you listed and the warning message do not match. I bet you use the $start_time somewhere else as well, e.g. a print and there the warning comes from.


Werner Daehn :de: (BOB member since 2004-12-17)

Thanks! I was indeed using a PRINT statement in my test job to test this specific behaviour:

$Test_Datetime = to_date( ‘2010-05-01’, ‘YYYY-MM-DD’);
Print (’$Test_Datetime: ’ || $Test_Datetime);

As soon as I commented out the Print statement (or just remove it), it no longer raises a Warning on validation:

Validate: No Errors Found (BODI-1270017)

Is it possible to extend the Warning message to include the actual statement causing the warning to be raised?

For example:

[Script:Test]
Warning: Expression <$Test_Datetime> of type will be converted to type by Function: PRINT (BODI-1110432)

Or something like that? It can be pretty confusing otherwise.


ErikR :new_zealand: (BOB member since 2007-01-10)

Yeah, yeah, yeah, I get it. First it is useful error messages, next you will be asking for debugging and at the end you will require useful documentation of the scripting language. I get it… :mrgreen:

What I would actually would love to do is changing the entire scripting language to JavaScript. Can be compiled, fast, standard, I am sure there are editors out there,… Anyway nothing we will have time for within the next 100 years.


Werner Daehn :de: (BOB member since 2004-12-17)

Hmmm we already have debugging although no in-line step debugging for functions and the Reference Guide is probably the best piece of documentation I’ve ever seen for ANY ETL tool.

I’m fine with the language as it stands now - although I would really like to have support for Array datatypes and the ability to do a REVERSE Index on a string. (e.g. Start at point 72 and then find the position of the first X character on the LEFT of that point). I’ll add these to the improvements topic.


ErikR :new_zealand: (BOB member since 2007-01-10)

to_date(to_char(datetimeValue, ‘YYYY/MM/DD’), ‘YYYY/MM/DD’)

always work for me. try it.


solo_kash (BOB member since 2010-03-30)

Hi,
I want to use date with time, how do you write this?
$TodayDate=To_date(to_char(sysdate(), ‘YYYY-MM-DD’) || ‘00:00:00’, ‘YYYY-MM-DD HH:mm:ss’);
Thank you :pray:t2: