cancel
Showing results for 
Search instead for 
Did you mean: 

@variable('DBUSER') returns a value is surrounded by single quotes

Former Member
0 Kudos

Hello experts,

I am using  @Variable('DBUSER' [DELIMITER = no_quote] ) but still the return value has single quote in generated sql statement.

SELECT DISTINCT

  'MYDB'.FXN_CUSTOM_FUNCTION('08/19/2015 16:58:18')

FROM

  MYTABLE

In above example MYDB is the output of @variable('DBUSER'), it is surrounded by single quotes and hence i am getting an error saying

[Microsoft][SQL Server Native Client 11.0][SQL Server]Cannot call methods on varchar.

Can any one tell me how to get out of single quotes here.

Thanks ,

Deepa.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member193452
Active Participant
0 Kudos

Hi Deepa, Yes,  I see that in the IDT guide chapter 18 For syntax @Variable('' [, DELIMITER=default | no_quote] ) must be in single quotes. and DBUSER Should be used as ..... @Variable('DBUSER' [,DELIMITER=no_quote]) check with the coma, Also is this a multisource unvierse? where are you using the @Variable? in the BEGIN_SQL OR END_SQL? IN JOIN? Calculated column, derived table?

amitrathi239
Active Contributor
0 Kudos

Hi,

Try with set the delimiter value to No in the PRM file and see if it will work.

Check section 3.4.15.25 DELIMIT_IDENTIFIERS page 120.

http://help.sap.com/businessobject/product_guides/boexir4/en/xi4sp11_universe_design_tool_en.pdf

Amit

Former Member
0 Kudos

Hi Amit,

Thank you for the reply.

My backend database is sql server and I included the parameter in both odbc.prm , sqlsrv.prm file. But still its not working I am getting the quotes. Any other suggestions?

I am working on SAP Business Objects 4.1SP4 Patch 9.

Thanks,

Deepa

former_member193452
Active Participant
0 Kudos

Hi Deepa,

@Variable is a string variable.  Hence in BI it passes the single quotes.

It looks like you are trying to pass a non string value? 

Former Member
0 Kudos

Hi Jacqueline,

Yes, @Variable is a string variable and BO has provided us an alternative way (like setting DELIMIT_IDENTIFIERS) to use it as non-quoted string for different purpose (as a schema name in my example above). But unfortunately these workarounds are not working for me.

Thanks,

Deepa.