cancel
Showing results for 
Search instead for 
Did you mean: 

Parse failed: Exception: DBD, [Microsoft][ODBC SQL Server Driver] Syntax Er

Former Member
0 Kudos

I received the following error when I gave the following statement in select:

case when {fn_year(FINANCE_PERIOD.FP_START)} @prompt('Enter Year','N',,mono,free)

then 1 else 0

end

Parse failed: Exception: DBD, [Microsoft][ODBC SQL Server Driver] Syntax Error or access violationState: 42000

I looked at differnt forums but could not fnd the error.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You need an = sign before the @Prompt

Former Member
0 Kudos

I forgot to put = sign before @prompt in question but In universe '=' sign is there.

I have SQL SERVER 2008, BOBJ XI 3.1. When I did on the work server where the ORACLE 10g & BOBJ XI3.1, It work without any error.

This error I am getting with SQL Server 2008. Any body who can help me for it.

Former Member
0 Kudos

try this:

CASE

WHEN YEAR(FINANCE_PERIOD.FP_START) = @Prompt('Enter Year','N',,mono,free) THEN 1 ELSE 0

END

I'm Back

Merry Christmas

0 Kudos

fn_year is an oracle function. You have to use the SQL Server 2008 compatible functions and syntax.

Use the YEAR function as suggested above.

Regards,

Stratos

Former Member
0 Kudos

I tried with YEAR function but unfortunately, I am getting the same error.

Former Member
0 Kudos

Sams Latin

then try this:

CASE

WHEN YEAR(FINANCE_PERIOD.FP_START) = @Prompt('Enter Year','N',here give class/object or LOV's,mono,free) THEN 1 ELSE 0

END

Note: In case of Date , you can make it blank (3rd parameter), which gives you calendar at runtime.

I suggest you try it in step by step like:

>> @Prompt('Enter Year','N',here give class/object or LOV's,mono,free)

Parse it, succeed. Then

>> YEAR(FINANCE_PERIOD.FP_START)

Parse it, then

for each case see LOV's.

>> at last, try above CASE WHEN

Hope it solves you.

I'm Back

Merry Christmas

0 Kudos

Can you please provide some examples for the values stored in FINANCE_PERIOD.FP_START?

Does it contain any NULL values also? What is the data type of the field?

Regards,

Stratos

Answers (0)