Re: SPL and webdriver
Posted in 1998
What version of the blade are you using? Check the release notes, especially
the MIqry2pass notes. I encluded the part of the release notes you need to
know about below. It's illegal to issue a DDL statement inside a user-defined
routine I don't specifically see you using a DDL but try MIqry2pass. I've got
the 3.32 blade
Tony
In article <72hluj$b04$1@nnrp1.dejanews.com>,
balb@myself.com wrote:
> hi there,
>
> I've got this strange behavior: I created a procedure: CREATE PROCEDURE
> pr_add_prod_ref (prod INT,comp INT,grp INT,lang INT,refer CHAR(20), size
> VARCHAR(30), weight FLOAT(1), cont FLOAT(1), color NVARCHAR(30)) DEFINE
> maxi INT; insert into pr_prod_item
> (prop_reference,prop_size,prop_weight,prop_cont,id_product,id_company,id_grp)
> values (refer,size,weight,cont,prod,comp,grp); IF color IS NOT NULL
THEN
> select max(id_prod_item) INTO maxi from pr_prod_item;
> insert into pr_color
> (id_prod_item,id_product,id_language,id_company,id_grp,color_name)
> values(maxi,prod,lang,comp,grp,color); END IF END PROCEDURE;>
> within SQL editor I execute:
> execute procedure pr_add_prod_ref(1,1,1,'33','4444','','','',null);>
> and it works fine
>
> BUT, in a HTML page (using webdriver) the same SQL statement :
> <?MIVAR NAME=SQLCMD>
> execute procedure pr_add_prod_ref(1,1,1,'33','4444','','','',null);> <?/MIVAR>
> <?MISQL SQL=$SQLCMD><?/MISQL>
>
> gives an 'Illegal SQL statement in stored procedure.' ??? how come?
>
> any idea?
>
> Olivier
XI. TWO-PASS QUERY PROCESSING
===============================
Webdriver generates an SQL statement to retrieve an AppPage by
building a call to WebExplode (described in Chapter 2 of the user's
guide):
select WebExplode(object,'name=value&name2=value2')
from webPages where ID='mypage';
The preceding query successfully retrieves the requested AppPage
in all but two cases:
o The AppPage contains an MISQL tag that attempts to update the table
from which the AppPage is selected (the webPages table in the
preceding call to WebExplode). In this case, the following error is
returned: Exception from Informix: XIX000:-7435:This statement
references a table that is used in the parent queries.
o The AppPage contains an MISQL tag that issues a DDL statement, for
example, a DROP TABLE command. It is illegal to issue a DDL
statement inside a user-defined routine (in this case, WebExplode)
because the user-defined routine is executed as part of a DML
statement. In this case, the following error is generated:
Exception from Informix: XIX000:-7502:Illegal SQL statement in
user-defined routine: 'drop table mytable;'
The workaround for the preceding situations is to inform Webdriver
that it must use a two-pass method to execute the query. First,
Webdriver retrieves the AppPage:
select object from webpages where ID='mypage';
Then Webdriver executes WebExplode:
execute function
WebExplode('<?MISQL>...','name=value&name2=value2');
Set the MIqry2pass variable to "on" within the URL to indicate to
Webdriver that the AppPage should be retrieved using the two-pass
method. A sample URL is:
/cgi-bin/webdriver?MIval=special_page&MIqry2pass=on
AppPage Builder uses this technique to allow inserts
into the table from which it selects AppPages.
Since the two-pass method has a performance penalty, only set
the MIqry2pass variable to "on" when necessary.
--
asalerno@monmouth.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own