Print Thread
TOracleScript.SQLCommand
#9594 11/09/07 01:00 AM
Joined: Nov 2006
Posts: 44
Ukraine
D
Devil Offline OP
Member
OP Offline
Member
D
Joined: Nov 2006
Posts: 44
Ukraine
I'm using DOA Version 4.0.6.1 (August 23, 2004)

In my scripts using subquery factoring clause:

WITH query_name AS ( subquery ) [, query_name AS ( subquery ) ]...

for example: OracleScript.Lines.Text :=
WITH
dept_costs AS (
SELECT department_name, SUM(salary) dept_total
FROM employees e, departments d
WHERE e.department_id = d.department_id
GROUP BY department_name),
avg_cost AS (
SELECT SUM(dept_total)/COUNT(*) avg
FROM dept_costs)
SELECT * FROM dept_costs
WHERE dept_total >
(SELECT avg FROM avg_cost)
ORDER BY department_name;


In function TOracleScript.SQLCommand for SQL command 'WITH' check condition not added into source code.

// Is it a SQL Command?
function TOracleScript.SQLCommand(const S1, S2: string): Boolean;
begin
...
Result := ...(S1 = 'CALL') or
(S1 = 'WITH'); //not added :-(
...
end;

Without this check (S1 = 'WITH') OracleScript has two command instead of only one:
first command:
WITH
dept_costs AS (

second command:
SELECT department_name, SUM(salary) dept_total
...

But should be only one command.

Tell please to what new version of DOA i must upgrated where this check is exists.

At this moment this check i add manually in to source Oracle.pas.

Thanks.

Re: TOracleScript.SQLCommand
#9595 11/09/07 04:19 PM
Joined: Nov 2006
Posts: 44
Ukraine
D
Devil Offline OP
Member
OP Offline
Member
D
Joined: Nov 2006
Posts: 44
Ukraine
And, do you have any idea when WITH feature will be included in your next release?

Re: TOracleScript.SQLCommand
#9596 11/09/07 06:10 PM
Joined: Aug 1999
Posts: 22,220
Member
Offline
Member
Joined: Aug 1999
Posts: 22,220
We'll add this in the next patch release.


Marco Kalter
Allround Automations
Re: TOracleScript.SQLCommand
#9597 11/09/07 08:28 PM
Joined: Nov 2006
Posts: 44
Ukraine
D
Devil Offline OP
Member
OP Offline
Member
D
Joined: Nov 2006
Posts: 44
Ukraine
Thanks


Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.033s Queries: 13 (0.008s) Memory: 2.5087 MB (Peak: 3.0420 MB) Data Comp: Off Server Time: 2024-05-19 11:09:55 UTC
Valid HTML 5 and Valid CSS