INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Dynamic Datawindows based on a stored procedure

Dynamic Datawindows based on a stored procedure

(OP)
Hello All,

I am using PB 11.5 and Oracle 11g, my requirement is to create dynamic datawindows based on a oracle stored procedure ( i know it can be created by using syntaxfromsql by passing sql select statement, but to make it SQl injection proof I have to use SP).

If any one has any ideas will be greatly appreciated.

RE: Dynamic Datawindows based on a stored procedure

You can build the DataWindow syntax in a string and use the Create function of the DataWindow or DataStore objects. To get an example of what the string would look like, create a DataWindow in the painter and then delete all visual controls. After saving, open it in source mode. The second line that starts with "datawindow(" only needs the value "processing", all the others have defaults.

RE: Dynamic Datawindows based on a stored procedure

(OP)
Thanks for your solution, but I figured it how to build a dw based on SP.

One more question for you? :)

What would be the limit on length of a string ( it can be a string or comma separated values) we can pass from PB to Oracle Stored Procedure. I know from PL/SQL it is 32K, but would want to know from PB side.

I appreciate your suggestions.

RE: Dynamic Datawindows based on a stored procedure

I don't use Oracle so can't help with that question.

RE: Dynamic Datawindows based on a stored procedure

(OP)
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

RE: Dynamic Datawindows based on a stored procedure

Have you created a dw with the stored proc and then looked at the export for the SQL part?

Matt

"Nature forges everything on the anvil of time"
www.anvil-of-time.com

RE: Dynamic Datawindows based on a stored procedure

(OP)
I figured it out.

Thanks for your suggestions though.

RE: Dynamic Datawindows based on a stored procedure

Care to share your solution?

Matt

"Nature forges everything on the anvil of time"
www.anvil-of-time.com

RE: Dynamic Datawindows based on a stored procedure

(OP)
Here it is:

string ls_sql = "'From Users'" /* String should be passed in a quote */ This was the key and the rest was same.


sql_syntax = "execute starsdba.SP_PROVIDER_LIST; as_Sql=" + ls_sql


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


HTH.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close