rogerzebra
Technical User
Hi fellas,
I'm trying to grab a result from a query and insert into a table. I get this annoying little error "column not allowed here" I would greately appreciate if anyone could have a look at my code and hopefully point out what I'm doing wrong. The table which the result is supposed to insert to has the column aliases as in the select statement.
Thanks in advance
"I finally took the step out to start working from home, and I have never looked back"![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
You can do it too. It's fun and you will never regret it. Send me an email and check out how I'm doing in my new business to roger@workfromhomemarketing.com
I'm trying to grab a result from a query and insert into a table. I get this annoying little error "column not allowed here" I would greately appreciate if anyone could have a look at my code and hopefully point out what I'm doing wrong. The table which the result is supposed to insert to has the column aliases as in the select statement.
Thanks in advance
Code:
select a.344_report as BookDate
,a.23_pnum as PolicyNum
,a.d42_WRITTEN as WrittenPremium
,0 as EarnedPremium
,0 as UnearnedPremium
,d.0002_COVERAGE as Coverage
,d.a988_end_no as FormName
,'s' as SourceSystem
,decode(d.b23_USERLINE,'10',d.C07_LIMIT_1,'70',d.C07_LIMIT_1,'36',c.C07_LIMIT_1,'37',c.C07_LIMIT_1)) as Limit1
INSERT INTO table1
(
BookDate, PolicyNum, WrittenPremium, EarnedPremium, UnearnedPremium, Coverage, FormName, Limit1, SourceSystem, SecondaryClass, EarnDays
)
values
(a.BookDate, a.PolicyNum, a.WrittenPremium, 'EarnedPremium',
'UnearnedPremium', d.Coverage,
d.FormName, 'Limit1', 'SourceSystem',
e.SecondaryClass, 'EarnDays'
);
"I finally took the step out to start working from home, and I have never looked back"
You can do it too. It's fun and you will never regret it. Send me an email and check out how I'm doing in my new business to roger@workfromhomemarketing.com