BusinessObjects Board

Edit a freehand SQL data provider

Hi,

I need to programatically build up a query, and then use it in my existing freehand SQL data provider.

I can build the query no problem, but when I try to do:

activeDocument.dataproviders("Freehand").SQL = mySQL

I get “Cannot find the ‘’ universe. (DA0011)” followed by an unhandled exception, and BO bombs out completely.

Is there anything I have to do before I can update the SQL? I have one report in my document that uses the data from this freehand SQL.

Any suggestions much appreciated as usual.

Thanks all.
Jonathan.


jjc99 (BOB member since 2003-10-09)

I tried do do this too but also got an error. So it seems than this is a BO Bug !


jp.golay :switzerland: (BOB member since 2002-06-17)

For what it’s worth, I don’t believe that you are supposed to be able to edit non-universe related data providers with the SDK.


Dave Rathbun :us: (BOB member since 2002-06-06)

Thanks guys. My workaround was to copy the SQL to the clipboard, and have a msgbox promting the user to paste it, and then call edit to pop up the free-hand SQL editor…fine for my purposes.

If this is an intended function, and not a bug, then why does BO bomb out so dramatically, instead of just raising an error?

Cheers.
Jonathan.


jjc99 (BOB member since 2003-10-09)

Yeah, you’d think that BusObj would be able to come up with a more interesting, if not more informative error message! :roll_eyes:

Be that as it may, in the Object Model Diagram for Data Providers, it is noted that

Sadly for many of us, this translates to an inability to change the SQL in code (on the fly, as it were) for a freehand SQL data provider. :cuss:

If your situation is at all like ours, where the desire was to provide prompts to our freehand SQL using existing universe lists of values, etc., then you might be interested to note that you can include @variable(prompt text) in your Where clause. There is a useful note on this subject in the BusObj Knowledge Base (Resolution Entry #6457).


cre907 :us: (BOB member since 2003-07-15)

What the heck is a Query Technique data provider?


Dennis W. Disney :us: (BOB member since 2003-09-17)

[quote:acd9031233=“Dennis W. Disney”]What the heck is a Query Technique data provider?
[/quote]

Query Technique means a data provider based on a universe (as opposed to Freehand, SQL, Personal data source, and so forth).


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

Does that mean that you can overwrite the SQL of a data provider based on a universe?


Dennis W. Disney :us: (BOB member since 2003-09-17)

[quote:38610993d4=“Dennis W. Disney”]Does that mean that you can overwrite the SQL of a data provider based on a universe?
[/quote]

I haven’t actually tried it myself (we do our best to not do any kind of SQL overrides of any kind), but according to the above, the answer should be yes. Maybe someone else can chime in with their experience.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)

If I remember you can edit the query technique SQL, but only for a mono query dataprovider (else you get a GPF). Also after editing the SQL you will get the option “do not generate the SQL…” activated, and you can’t desactivate it easilly !!!


jp.golay :switzerland: (BOB member since 2002-06-17)