Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL script!

Status
Not open for further replies.

Stevennn

Programmer
Apr 4, 2007
52
US
I'm trying to execute the script below and it wont do it.
Is it possible to figure out what is wrong with it!
"SQL command not properly ended"
Thank-you

SELECT
en_code,
sa_sub,
costctr_code,
acc_code,
sum(gl_amt)
FROM
D_ENTITY_STG1 a,
D_SUBACCTS_STG1 b,
D_COSTCTR_STG1 c,
D_ACCTS_STG1 d,
F_ACCT_TRX_HIST_STG1 e
WHERE
a.en_code = c.gl_ent,
b.sa_sub = e.gl_sa,
c.costctr_code = e.gl_ctr,
d.acc_code = e.gl_acc
GROUP BY
a.en_code, b.sa_sub, c.costctr_code, d.acc_cod
 
{Code]

SELECT
en_code,
sa_sub,
costctr_code,
acc_code,
sum(gl_amt)
FROM
D_ENTITY_STG1 a,
D_SUBACCTS_STG1 b,
D_COSTCTR_STG1 c,
D_ACCTS_STG1 d,
F_ACCT_TRX_HIST_STG1 e
WHERE
a.en_code = c.gl_ent,
b.sa_sub = e.gl_sa,
c.costctr_code = e.gl_ctr,
d.acc_code = e.gl_acc
GROUP BY
a.en_code, b.sa_sub, c.costctr_code, d.acc_cod

[/Code}

The WHERE clause should read

Code:
WHERE a.en_code = c.gl_ent
  AND b.sa_sub = e.gl_sa
  AND c.costctr_code = e.gl_ctr
  AND d.acc_code = e.gl_acc

Regards,


William Chadbourne
Oracle DBA
 
russki,

I assume that you have a semi-colon at the end of your statement, otherwise sql plus might find it a bit awkward.

If you're running a sql plus script to create a stored procedure, then you need to finish off with a slash "/" so that sql plus knows to run the code at that point.

silly I know, but sometimes the obvious gets overlooked.

Regards


Tharg

Grinding away at things Oracular
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top