cancel
Showing results for 
Search instead for 
Did you mean: 

Using Stored Procedure via datawindow

Former Member
0 Kudos

I am trying to retrieve data (through a parameter) from sql server based Stored Procedure via a datawindow but running into an error. The error is "invalid character value for cast specification".  Below is part of the edit source of the datawindow

/////

  procedure="1 execute dbo.usp_select_auditexport;1 @export = :export" arguments=(("export", string)) )

/////

When I try to retrieve data in test by running the datawindow in PB and get the pop up of export and whether I put in a string value with or without quotes I get the error.

During runtime too I get a similar error of "invalid argument value". example dw_auditexport.retrieve(ls_export) . The ls_export is set 'M'.   Please help.


KB

Accepted Solutions (1)

Accepted Solutions (1)

CobyKako
Advisor
Advisor
0 Kudos

Hello Kwadwo,

Which PB version?

Are you connecting through ODBC?

If yes, please take a look at the PBNewsSPInvocation DBParm to see if it improves the situation (value should be set to 'Yes'):

SyBooks Online

I think it must be correlated with other DBParm StripParmNames (value should also be set to 'Yes'):

SyBooks Online

HTH,

Jacob

Former Member
0 Kudos

Jacob,

          I am using 12.1 and yes, ODBC.  Through a little research I took out CallEscape='No'

and maintained StripParmNames='Yes' in my DBParm and it worked.

So I changed from

SQLSVR2.DBParm = "Connectstring='DSN="+ls_dsn4+";UID="+db_Login4+";PWD="+db_Password4+"',StripParmNames='Yes' and CallEscape='No'"

to

SQLSVR2.DBParm = "Connectstring='DSN="+ls_dsn4+";UID="+db_Login4+";PWD="+db_Password4+"',StripParmNames='Yes'"

Thanks,

KB

CobyKako
Advisor
Advisor
0 Kudos

Kwadwo,

Do not forget to mark this thread as answered

Answers (0)