Inserting to a table
Forum » Forum / Help » Inserting to a table
Started by: Belinda (guest)
On: 1274386344|%e %b %Y, %H:%M %Z|agohover
Number of posts: 5
rss icon RSS: New posts
Summary:
Need to insert information to a logging table when customer views a view-only page.
Inserting to a table
Belinda (guest) 1274386344|%e %b %Y, %H:%M %Z|agohover

We need to insert a row into a custom table each time our customer views a view-only page. In which event should this occur? I've tried several and have gotten errors. We are running PeopleSoft 8.9, PeopleTools 8.49, Oracle DB.

Reply  |  Options
Unfold Inserting to a table by Belinda (guest), 1274386344|%e %b %Y, %H:%M %Z|agohover
Re: Inserting to a table
melbanmelban 1274387275|%e %b %Y, %H:%M %Z|agohover

How are you doing the insert? A couple potabilities come to mind.

1. Component peoplecode: You can set to PreBuild or PostBuild and should only get fired once each time you load the component.
2. Page peoplecode: Fires every time the page is shown so if this is a tab on a component it could get fired often.

Reply  |  Options
Unfold Re: Inserting to a table by melbanmelban, 1274387275|%e %b %Y, %H:%M %Z|agohover
Re: Inserting to a table
Belinda (guest) 1274445107|%e %b %Y, %H:%M %Z|agohover

We're attempting the insert with an SQLExec. In Production, the statement works fine in the PostBuild component event. Then we changed to Oracle in our Pre-prod environment and now I get the "can't do this in this event" error. I get the same error on the page Activate event. Argh.

Unfold Re: Inserting to a table by Belinda (guest), 1274445107|%e %b %Y, %H:%M %Z|agohover
Re: Inserting to a table
melbanmelban 1274445907|%e %b %Y, %H:%M %Z|agohover

Are you using a different database in your production/pre-production compared to your development environment? I don't think that this should be an issue but you never know. I'd suggest clearing your app server cache after moving your project just to confirm there isn't some old code in there. I'm at a loss if the database makes a difference. The fact that it worked in your development environment means it should work. Also confirm your code looks the same in this new system where you are getting the error.

Unfold Re: Inserting to a table by melbanmelban, 1274445907|%e %b %Y, %H:%M %Z|agohover
Re: Inserting to a table
Belinda (guest) 1274446788|%e %b %Y, %H:%M %Z|agohover

Sorry; what I should have said above is that we are using Informix in Prod and the statement works fine in the PostBuild event; now in Oracle I get the "can't do it in this event" error….

Reply  |  Options
Unfold Re: Inserting to a table by Belinda (guest), 1274446788|%e %b %Y, %H:%M %Z|agohover
New Post
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License