0

My issues is I am trying to create a datawindow dynamically based on a SP with parameters. I could able to create a datawindow dynamically from a SP without parameters, but with parms I am getting this error - "Can not get parameters of procedure"

Any suggestions please?

My code:

sql_syntax = "execute starsdba.SP_PROVIDER_LIST; as_Sql= From Users"

presentation_str = "style(type=grid)"

presentation_str = &
"style( type=Grid &
Horizontal_spread = 25 &
Header_bottom_margin = 15 &
Header_top_margin = 15 ) &
datawindow( units=2 &
Color= 67108864) &
column( Font.Face='system' &
Font.Height=-10 &
Font.Weight=700) &
text( Font.Face='system' &
Font.Height=-10 &
Font.Weight=700 &
Border=6)"

dwsyntax_str = SQLCA.SyntaxFromSQL(sql_syntax, &
presentation_str, ERRORS)

IF Len(ERRORS) > 0 THEN
MessageBox("Caution", &
"SyntaxFromSQL caused these errors: " + ERRORS)
RETURN

END IF
user2379643
  • 13
  • 1
  • 5

2 Answers2

0

I do not know if your way will work to create a DW. But anyway, to use Stored Procedure in Powerbuilder, you must execute your SQL stmt First and try if it will return the select properly. I dont know if it will work that way as I have not tried doing that.

To see how to execute SQLSTMT Try this link http://powerbuilder.hyderabad-colleges.com/Advanced-PowerBuilder-2-15-50.html

to see how to exectute SP in Powerbuilder.

Sid
  • 765
  • 5
  • 29
  • 57
  • As I mentioned earlier my syntax works when I dont use any parameters for the stored procedure, but do you know the syntax in executing stored procedure with parametrs for dynamic datawindow – user2379643 May 28 '13 at 16:12
0

Your SQL Syntax has to include the reference to the parameters, indicated by a name/value pair "col_name = :parameter". I don't see any parameters in the sample code you posted...

I painted a simple dw against a SP in the SQL Anywhere sampleDB, and the SQLSyntax looks like this:
"execute dba.sp_product_info;0 prod_id = :prod_id"

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
NoazDad
  • 608
  • 3
  • 9
  • Thanks Paul for your suggestion but i have parameter passed like this sql_syntax = "execute starsdba.SP_PROVIDER_LIST; as_Sql= From Users" This is how I would pass it in a string, I can not use : as I am passing a variable. Please let me know how this can be done. Do you have a syntax for creating a datawindow based on a stored procedure which would take parameters. I tried sending parameters in different ways, but I am getting syntax error. Please Advise. – user2379643 May 28 '13 at 19:47