Handling "NOT NULL" in forms(4.5)
Hi everbody,
I am working in forms4.5,oracle 7.3 in winNT. I had some columns
which were defined as NOT NULLs in the database. When I tried
loading data into them I got an error.I found that there were no
values for those columns in the datafile. So removed the NOT
NULLs from the columns and loaded the data. These were the old
datas. Now I should change the columns back to NOT NULLs as the
new datas has to follow them. How will I handle the old datas in
the form? I want the NOT NULL columns to be diplayed as blanks
instead of showing some error.i.e when a primary key value is
entered (if it is already present in the old data) then a blank
should be displayed in those not null columns. How will I do
this?
Any help is appreciated.
Thanks in advance,
satish
null
satish (guest) wrote:
: Hi everbody,
: I am working in forms4.5,oracle 7.3 in winNT. I had some
columns
: which were defined as NOT NULLs in the database. When I tried
: loading data into them I got an error.I found that there were
no
: values for those columns in the datafile. So removed the NOT
: NULLs from the columns and loaded the data. These were the old
: datas. Now I should change the columns back to NOT NULLs as the
: new datas has to follow them. How will I handle the old datas
in
: the form? I want the NOT NULL columns to be diplayed as blanks
: instead of showing some error.i.e when a primary key value is
: entered (if it is already present in the old data) then a blank
: should be displayed in those not null columns. How will I do
: this?
: Any help is appreciated.
: Thanks in advance,
: satish
If you genuinely have some rows for your table where there are no
values for particular columns then you should leave the columns
null-enabled. This sounds to be the case here - a column does
not have to be defined as NOT NULL in order for data to be
entered; you will be able to enter your new data for these
columns even though they are not defined as NOT NULL.
In any case, while you have existing rows in the table with null
values for these columns, the SQL engine will not allow you to
change the columns to be NOT NULL.
Hope this helps,
Stuart Housden
null
Similar Messages
-
Not null and enable or disable column in tabular form
Hi,
Using apex version 4.1 and working on tabular form.
ACT_COA_SEGMENT_MAS is Master table
and
ACT_SEGMENT_VALUES_MAS is detail table
I have entered 8 rows in master table and PARENT_SEGMENT_ID is column in master table which is null able. If i specified PARENT_SEGMENT_ID with value in master table then in detail table there is column PARENT_ID that should not be null and enable.
How i can enable or disable column when in master table PARENT_SEGMENT_ID column is null then in detail table PARENT_ID column should disable and vice versa.
I have created tabular form on Detail table. before insert into the tabular form Check in master table in first entry if PARENT_SEGMENT_ID is not null in first row of master table then in tabular form PARENT_ID should enable and not null able in corresponding to this first row id's lines in tabular form.
Same should check for second row in master table if PARENT_SEGMENT_ID is not null then entered rows with PARENT_ID into tabular form corresponding to 2nd id in master table should not nullable and column should enable in tabular form.
Thanks & Regards
Vedant
Edited by: Vedant on Jan 9, 2013 9:12 PMVedant,
You need to create you own manual tabular form and not use the wizard.
Using APEX_ITEM api you should be build you own form and you will be able to control how you wan to display the rows. (See Link [Apex Item Help|http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_item.htm#CACEEEJE] )
select case when PRIMARY_TABLE_COLUMN is null then APEX_ITEM.DISPLAY_AND_SAVE(3 , DETAIL_COLUMN ) else APEX_ITEM.TEXT(2,detail_column) end "ALIAS" from detail table
Hope that help.
Vivek -
Filter by form shows only "Is Null" and "Is Not Null" value in split database
Hello,
I have a SPLIT database into FE (forms, queries...) and BE (tables with data) ready for distribution.
PROBLEM
When "Filter by Form" is chosen
only 2 values are available in combobox filter ("Is Null", "Is Not Null"). All other functionalities of the form work fine (data display), which means that tables are linked
correctly.
In the UNSPLIT database "Filter by Form" works OK (i.e. comboboxes show lists of possible values to choose from).
All the forms (and queries) behave like this.
Recordsource of all forms are queries.
Type of filtered fields => text (no memo fields, no comboboxes)
QUESTION:
What is the reason of this behavior and how can it be fixed so that "Filter by Form" works in SPLIT database (and displays available values in comboboxes)?
Thank you for help.Hi,
this is the default behaviour with linked tables. To change it:
open the form in design view
select the text box you want to use for the filter
in the properties of the text box click at the data tab and change the FilterLookUp property from "Database default" to "Always"
See also
https://msdn.microsoft.com/en-us/library/office/ff194556(v=office.15).aspx.
cu
Karl
Access FAQ (de/it): http://www.donkarl.com
Access Lobby: http://www.AccessDevelopers.org -
Hi,
we have upgraded our CQ 5.4 installation to CQ 5.5. After the upgrade, we are facing an error with the Calendar component. The following error is logged when trying to create a new calendar event:
20.11.2012 11:01:23.139 *ERROR* [10.62.45.10 [1353405682764] POST /content/hm/NewsroomSection/en/NewsRoom/test/_jcr_content/par/calendar_3dd7/calendars/def ault/2012/11/22/.form.create.html/libs/collab/calendar/content/eventform HTTP/1.1] org.apache.sling.servlets.resolver.internal.SlingServletResolver handleError: Recursive invocation. Not further handling status 404(No form found)
We will try increasing the log level to possibly get a more detailed error message, just checking if anyone has encountered this issue?
Thanks,
Joakim"No form found" means the form chooser that's used here ("form" selector) to find the form to show/edit the event did not find one under the given path /libs/collab/cale ndar/content/eventform (the suffix). It contains a space, maybe it's just a typo.
-
How to check table is NULL or not when a form load?
How to check table is NULL or not when a form load?
I want to make the form when it load it check the data in table, if there are no data in table other form will be load.
Sorry for bad English...Maybe you can do this in form1's Form_Open event:
if dcount("*", "table1") = 0 then
Cancel = True
Docmd.Openform "form2"
end if
-Tom. Microsoft Access MVP -
Insert not working in forms 6i
Hi
I have a non database block in forms 6i and have the values written into the database using insert statement.
I have a situation where only for a couple parent records, i am not able to insert child records using forms.
I am able to insert through backend.
any ideas.
thanks,
Edited by: 699704 on Sep 22, 2011 12:49 PM
Edited by: 699704 on Sep 27, 2011 7:52 AMWhat error do you get?
If you get no error, check if you have proper error handling, not something like "when others than null", or an on-error trigger that doesn't show you the error. -
Error Handling on procedure based forms
Hi all,
I have seen examples of error handling on table based forms like
the following:
begin
doInsert;
exception
when others then
--redirect to some error page
I have tried the same with a procedure based form by wrapping
the doSubmit procedure, but when the procedure returns an
exception, it doesn't execute my exception handling code.
Any ideas on why this is happening or at least how I can catch
these exceptions with my own exception handler?
Thanks,
CurtChetan, Antonio,
I opened a TAR on this issue with Oravle and they got the same
results. Thay suggested a work around of creating an error table
that gets written to and then dispaly and new page to retrieve
the error from the table.
What I ended up doing is creating a dummy procedure that does
nothing (NULL). The form based on the dummy procedure allows me
to get the values I need from the user.
The procedure always returns succesful since it doesn't do
anything. So in the form success code area I call the real
procedure, check the return value, and now I can redirect back
to the orignal form on error, or direct to another paqe on
success.
Not the most elegant solution, but it is working for now.
Curt -
Error management in an event handler in a powershell form
Hi guys
I wrote a powershell form using event handler. It ask for a name and a IP adress and other things
In the event handler,
- if the user leave the name blank, I open a message box saying it should not be empty
- if the user enter a wrong ip adress, I open a message box saying it should be like x.x.x.x
If both occurs, it displays 2 message box.
But I would like to display only the first message box of the first error and then exit the handler, to avoid displaying many messages.
How to exit from a handler and stay in the form (not like the cancel button handler which close the form with a form.close() statement)
I tried break statement or exit without success
thanks
MLHi guys
This is the code I wrote today. I may give also the full code of the interface, but it reach 1300 lines.
$Retry variable lets me control the first error in the interface to display the message box.
It's not finished yet, I need to add something like "formclose" if $Retry is false.
I use semicolons because for me, it's easier to read :-).
I'm sorry I don't understand the explanation in your link.
http://msdn.microsoft.com/en-us/library/system.componentmodel.canceleventargs%28v=vs.110%29.aspx
What would happen if I type
$_.Cancel = $true
instead of $Retry = 1, it will exit immediately from the handler ? I can't try now, I'm came back home
Thanks
ML
function IsIP($value) {
$match = "\b(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}\b"
return $value -match $match
function IsURL([string]$Url)
if($Url -eq $null) {return $false}
else {return $Url -match "^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*"+`
"(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?$"}
function toBinary ($dottedDecimal){
$dottedDecimal.split(".") | %{$binary=$binary + $([convert]::toString($_,2).padleft(8,"0"))}
return $binary
#Provide Custom Code for events specified in PrimalForms.
$handler_WinFactoryGUI_Load=
#TODO: Place custom script here
$HardwareCombo.SelectedIndex = 0 # Default values of Combo boxes
$WindowsEditionCombo.SelectedIndex = 0
$ServerName.Select()
$handler_cancel_Click=
#TODO: Place custom script here
$WinFactoryGUI.Close()
$Handler_Server_Info_Leave=
#TODO: Place custom script here
$Handler_DNS_Config_Leave=
#TODO: Place custom script here
$Handler_GenerateIso_Click=
#TODO: Place custom script here
$Retry = $false
# ServerName
$ServerName2Install = $ServerName.Text
if ($ServerName2Install -eq "") {$MSg = "Server name is missing"; $Retry = $true}
# Windows Version
$TabWindowsVersion = @("2008R2STD","2008R2ENT","2008R2DTC","2012R2STD","2012R2DTC")
$i = $WindowsEditionCombo.SelectedIndex
$WindowsVersion = $TabWindowsVersion[$i]
if (! $Retry) {
# OperIP : mandatory
$OperIP = $OperIP1.Text + "." + $OperIP2.Text + "." + $OperIP3.Text + "." + $OperIP4.Text
$OperMask = $OperMask1.Text + "." + $OperMask2.Text + "." + $OperMask3.Text + "." + $OperMask4.Text
$DefaultGateway = $Gateway1.Text + "." + $Gateway2.Text + "." + $Gateway3.Text + "." + $Gateway4.Text
$Msg = ""
$OperIPOK = IsIP($OperIP); if (! $OperIPOK) { $Msg = $Msg + "OperIP is invalid`n";$Retry = $true }
$OperMaskOK = IsIP($OperMask); if (! $OperMaskOK) { $Msg = $Msg + "OperMask is invalid`n";$Retry = $true }
$DefaultGatewayOK = IsIP($DefaultGateway); if (! $DefaultGatewayOK) { $Msg = $Msg + "DefaultGateway is invalid`n";$Retry = $true}
$ipBinary = toBinary $OperIP
$smBinary = toBinary $OperMask
#how many bits are the network ID
$netBits=$smBinary.indexOf("0")
#validate the subnet mask
if(($smBinary.length -ne 32) -or ($smBinary.substring($netBits).contains("1") -eq $true)) {$Msg = "Subnet Mask is invalid!";$Retry = $true}
else {
#validate that the IP address
if(($ipBinary.length -ne 32) -or ($ipBinary.substring($netBits) -eq "00000000") -or ($ipBinary.substring($netBits) -eq "11111111")) {$Msg = "IP Address is invalid!";$Retry = $True}
# TechIP : optional
if (!$Retry) {
if (($TechIP1.Text -eq "") -and ($TechIP2.Text -eq "") -and ($TechIP3.Text -eq "") -and ($TechIP4.Text -eq ""))
$TechIP = "0.0.0.0"
$TechMask = "0.0.0.0"
else
$TechIP = $TechIP1.Text + "." + $TechIP2.Text + "." + $TechIP3.Text + "." + $TechIP4.Text
$TechMask = $TechMask1.Text + "." + $TechMask2.Text + "." + $TechMask3.Text + "." + $TechMask4.Text
$TechIPOK = IsIP($TechIP)
if (! $TechIPOK) { $Msg = $Msg + "TechIP is invalid`n";$Retry = $true }
$TechMaskOK = IsIP($TechMask)
if (! $TechMaskOK) { $Msg = $Msg + "TechMask is invalid`n";$Retry = $true }
# DNS domain
if (! $Retry) {
$DnsDomainSrv2Install = $DnsDomain.Text
if ($DnsDomainSrv2Install -eq "") {$Msg = $Msg + "DNS Domain is invalid`n";$Retry = $true }
# DNS Suffixes
if (! $Retry) {
$DnsSuffixes2Install = $DnsSuffixes.Text.replace("`n",":")
if ($DnsSuffixes2Install[$DnsSuffixes2Install.Length] -eq ":") {
$DnsSuffixes2Install = $DnsSuffixes2Install.Substring(0,$DnsSuffixes2Install.Length-1)
if ($DnsSuffixes2Install -eq "") {$Msg = $Msg + "DNS suffixes list is invalid`n";$Retry = $true }
# DNS adresses
if (! $Retry) {
if ($DNSIP11.Text -ne "") {
$DNSIP1 = $DNSIP11.Text + "." + $DNSIP12.Text + "." + $DNSIP13.Text + "." + $DNSIP14.Text
$DNSIP1POK = IsIP($DNSIP1) ; if (! $DNSIP1POK) { $Msg = $Msg + "DNS IP 1 is invalid`n";$Retry = $true } else { $DNSAddrList = $DNSIP1}
if ($DNSIP21.Text -ne "") {
$DNSIP2 = $DNSIP21.Text + "." + $DNSIP22.Text + "." + $DNSIP23.Text + "." + $DNSIP24.Text
$DNSIP2POK = IsIP($DNSIP2) ; if (! $DNSIP2POK) { $Msg = $Msg + "DNS IP 2 is invalid`n";$Retry = $true } else {$DNSAddrList = $DNSAddrList + ":" + $DNSIP2}
if ($DNSIP31.Text -ne "") {
$DNSIP3 = $DNSIP31.Text + "." + $DNSIP32.Text + "." + $DNSIP33.Text + "." + $DNSIP34.Text
$DNSIP3POK = IsIP($DNSIP3) ; if (! $DNSIP3POK) { $Msg = $Msg + "DNS IP 3 is invalid`n";$Retry = $true } else {$DNSAddrList = $DNSAddrList + ":" + $DNSIP3}
if ($DNSIP41.Text -ne "") {
$DNSIP4 = $DNSIP41.Text + "." + $DNSIP42.Text + "." + $DNSIP43.Text + "." + $DNSIP44.Text
$DNSIP4POK = IsIP($DNSIP4) ; if (! $DNSIP4POK) { $Msg = $Msg + "DNS IP 4 is invalid`n";$Retry = $true } else {$DNSAddrList = $DNSAddrList + ":" + $DNSIP4}
else { $Msg = $Msg + "At least, one Dns server IP must be provided`n";$Retry = $true }
# Hardware
$TabHardware = @("VM","HP","MS")
$i = $HardwareCombo.SelectedIndex
$Hardware = $TabHardware[$i]
# vCenter
$vCenterName = "parameter.not.used"
# Flags
#""_;_;_;1;_;http://m011ML-SCCM.pocx86.tstwinx.net:8530;1"""
if (! $Retry) {
$Flag = ""
if ($CheckBoxPED.Checked -eq $true) {$Flag = $Flag + "1;"} else {$Flag = $Flag + "_;"}
if ($CheckBoxOmnivision.Checked -eq $true) {$Flag = $Flag + "1;"} else {$Flag = $Flag + "_;"}
if ($CheckBoxBackup.Checked -eq $true) {$Flag = $Flag + "1;"} else {$Flag = $Flag + "_;"}
if ($CheckBoxNagiosInstall.Checked -eq $true) {$Flag = $Flag + "1;"} else {$Flag = $Flag + "_;"}
if ($CheckBoxInstallSRM.Checked -eq $true) {$Flag = $Flag + "1;"} else {$Flag = $Flag + "_;"}
$WsusUrl2Configure = $WsusUrl.Text;
if ($WsusUrl2Configure -eq "") {$WsusUrl2Configure = "_"}
else {
$WsusURLOK = IsUrl($WsusUrl2Configure)
if (! $WsusURLOK) {$Msg = $Msg + "WSUS Url is Invalid`n";$Retry = $true }
$Flag = $Flag + $WsusUrl2Configure
if ($CheckBoxHPSA.Checked -eq $true) {$Flag = $Flag + ";1"} else {$Flag = $Flag + ";_"}
$Flag = """""$Flag"""""""
if ($Retry) {[System.Windows.Forms.MessageBox]::Show($Msg,"Status",0);$Msg = ""}
else { $WinFactoryCall = "start-process ""cmd.exe"" ""/c .\GenBootImage.cmd "
$WinFactoryCall = $WinFactoryCall + $ServerName2Install + " " + $WindowsVersion + " " + $OperIP + " " + $OperMask + " " + $DefaultGateway + " " + $TechIP + " " + $TechMask
$WinFactoryCall = $WinFactoryCall + " " + $DNSAddrList + " " + $DnsDomainSrv2Install + " " + $DnsSuffixes2Install + " " + $Hardware + " " + $vCenterName + " " + $Flag + " -wait"
write-host $WinFactoryCall
$OnLoadForm_StateCorrection=
{#Correct the initial state of the form to prevent the .Net maximized form issue
$WinFactoryGUI.WindowState = $InitialFormWindowState
ML -
ORA-01400 - not null column with default value and item with authorization
I've searched - I would think someone has run into this. APEX 3.0.0.00.20 - I've created a simple form on a table. One of the column is a not null column with a default value. I have a select list on that item, but it has security on it - authorization scheme. So, it checks the user and if that user isn't of the right role, it will not even display that item. However, APEX appears to still send in the column in its sql! So, the default value is useless, it sends in null each time. Even if I set the default at the Item level, I get null. Argg. That's got to be a bug...
In debug, I do not see the item listed at all. It's not used. That's fine - but why is it trying to insert the value? I would think it would leave it off??? I think because the item is associated with a database column. But, getting around this is ugly. Having to create a hidden item for each one, and then check to see if I need to take the list value... horrible. Any way to get around this???I should add - I guess I can always put my own custom process in to replace the DML. Just seems like a simple thing - if the value doesn't appear on the debug, isn't set with any default value... don't include it in the DML.
-
Hi -
It is not allowed to have IS NOT NULL in order by clause, isn't it? When order by clause is being formed dynamically, is there anyway to check for not nulls in any column to be used for order by clause? Thanks,If we have order by C1, C2, C3, then .. it is not the same as just C2 and C3 - is it?No, results depend upon content of result set.
SQL> drop table nulls_ob;
Table dropped.
SQL> create table nulls_ob (id1 number, id2 number, id3 number);
Table created.
SQL> insert into nulls_ob values(null,100,null);
1 row created.
SQL> insert into nulls_ob values(null,110,null);
1 row created.
SQL> insert into nulls_ob values(null,null,100);
1 row created.
SQL> insert into nulls_ob values(null,null,120);
1 row created.
SQL> insert into nulls_ob values(null,90,100);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from nulls_ob order by 1,2,3;
ID1 ID2 ID3
90 100
100
110
100
120
SQL> insert into nulls_ob values(70,110,null);
1 row created.
SQL> insert into nulls_ob values(90,null,100);
1 row created.
SQL> insert into nulls_ob values(80,90,100);
1 row created.
SQL> commit;
Commit complete.
SQL> select * from nulls_ob order by 1,2,3;
ID1 ID2 ID3
70 110
80 90 100
90 100
90 100
100
110
100
120
8 rows selected.
SQL> select * from nulls_ob order by 2,3;
ID1 ID2 ID3
80 90 100
90 100
100
110
70 110
100
90 100
120
8 rows selected. -
I could not get my VBA to work with is not null, so I did a len statement instead (But that is also not working)
If the field is not null then...
Private Sub Form_Load()
Dim Cfilter As String
Cfilter = ""
Filter = ""
OrderBy = ""
'On Error GoTo Matzke0001
'If Forms![View].[Coordinator] = -1 Then
'Cfilter = " And [Owner]= '" & Forms![View].[LF] & "'"
'End If
If Len(Forms![View].[FC-Start]) > 0 Then
Cfilter = Cfilter & " And [Start] >= Forms![View].[FC-Start] "
Cfilter = Cfilter & " And [Start] is not null "
End If
If Len(Forms![View].[FC-End]) > 0 Then
Cfilter = Cfilter & " And [Stop] <= Forms![View].[FC-End] "
Cfilter = Cfilter & " And [Stop] is not null "
End If
If Len(Forms![View].[FC-Type]) > 0 Then
Cfilter = Cfilter & " And [Type] = Forms![View].[FC-Type] "
End If
If Len(Forms![View].[FC-Status]) > 0 Then
Cfilter = Cfilter & " And [Status] = Forms![View].[FC-Status] "
End If
If Forms![View].[Minor] = True Then
Cfilter = Cfilter & " And [Cost] < Forms![View].[FC-Threshold] "
End If
If Forms![View].[Major] = True Then
Cfilter = Cfilter & " And [Cost] >= Forms![View].[FC-Threshold] "
End If
'Me.Filter = Mid(Cfilter, 6)
'FilterOn = True
'Exit Sub
'Matzke0001:
'MsgBox "Error in programming: Please inform the administrator of this program"
End SubNever mind, I corrected it. (Disabled my filter line)
-
Javascript embedded in button pl/sql event handler not being executed
Javascript calls not working from pl/sql button event handler. What am I missing? Are specific settings needed to execute javascript from pl/sql proceedures?
Example: Want to toggle target='_blank' off and on in a button pl/sql event handler to open url call in new window & then reset when processing submit is done & the app returns to the form.
portal form button's pl/sql submit handler:
begin
htp.p('<script language=JavaScript>') ;
htp.p('this.form.target="_blank"') ;
htp.p('</script>') ;
PORTAL.wwa_app_module.set_target('http://www.oracle.com') ;
htp.p('<script language=JavaScript>') ;
htp.p('this.form.target="_blank"') ;
htp.p('</script>') ;
end ;
Putting the following in the button's javascript on_click event handler works great:
this.form.target='_blank'
to force opening new window with a call in the button's submit pl/sql code via:
PORTAL.wwa_app_module.set_target('http://www.oracle.com') ;
but then the target='_blank' is left on when the submit is done & we return to the form.
putting the above javascript as a function (called fcn_newpage) elsewhere (e.g., after form opens) & calling in the submit pl/sql with
htp.p('fcn_newpage') ;
also doesn't work.
Metalink thought this was an application issue instead of a bug, so thought I'd see if anyone knows what's going wrong here. (Portal 9.0.4.1)thanks for your discussion of my post.
Please clarify:
"htp.p('fcn_newwindow') sends a string":
What would you suggest the proper syntax for a function fcn_newwindow() call from a pl/sql javascript block that differs from
htp.p('<script language="Javascript">') ;
htp.p('fcn_newwindow');
htp.p('</script>');
or more simply
htp.p('fcn_newwindow') ;
More generally, what I'm trying to figure out is under what conditions javascript is executed, if ever, in the pl/sql of a button (either the submit or custom event handler, depending on the button).
I've seen lots of posts asking how to do a simple htp.p('alert("THIS IS TROUBLE")') ; in a pl/sql event handler for a button on a form, but no description of how this can be done successfully.
In addition to alerts, in my case, I'd like to call a javascript fcn from a pl/sql event handle that would pass a URL (e.g., http://www.oracle.com) where the javascript fcn executed
window.open(URL). The API call to set_target(URL) in pl/sql has no ability to open in a new window, so calling that is inadequate to my needs and I must resort to javascript.
Its clear in the PL/SQL of a button, you can effect form components since p_session..set_target & p_session.get_target set or get the contents of form components.
So to see if javascript ever works, I tried to focus on something simple that only had to set what amounts to an enviromental variable when we returned to the form after a post. I chose to try to change the html value of TARGET from javascript in the PL/SQL button because it doesn't need to be implemented until we finish the post and return to the form.
So I focused on a hack, setting this.form.TARGET='_blank' in the on_click event handler that forced every subsequent URL call or refresh of the form to be a new window. I then wanted to turn off opening new windows once I'd opened the URL call in a new window by setting TARGET='' in the portal form. I can achieve what I want by coding this.form.TARGET='' in the javascript (on_focus, on_change, or on_mousedown, ...) of every form component that might refresh the form. However, that is a ridiculous hack when a simple htp.p('<script>') ; htp.p('this.form.target=""') ; htp.p('</script>') ; at the end of the button's pl/sql event handle should do the same thing reliably if javascript ever works in the pl/sql event handler.
If we didn't have access to form components through p_session calls, I'd assume it was a scope issue (what is available from the pl/sql event handler). But unless my syntax is just off, when, if ever, can javascript be used in a portal form's pl/sql event handler for a button?
if I code a javascript funtion in the forms' pl/sql before displaying form:
htp.p('<script language="JavaScript">') ;
htp.p('function fcn_new_window(URL)') ;
htp.p('window.open(URL)' ) ;
htp.p('</script>') ;
the function can be called from a button's on_click javascript event handler:
fcn_new_window('http://www.oracle.com')
but from the same button's pl/sql submit event handler this call doesn't work: htp.p('fcn_new_window("http://www.oracle.com")')
So my questions remain: Is there other syntax I need, or does javascript ever work properly from the pl/sql of a form button's event handler? If it doesn't work, isn't this a bug that should be fixed by Oracle?
I can probably figure out hacks to make things work the way I need, but executing javascript from pl/sql event handlers seems to be the expected way to affect portal html pages (forms, reports, ...) and it seems not to work as expected. I don't feel I should have to implement hacks for something as simple as calling a javascript function from pl/sql when almost every example I've found in metalink or the forums or Oracle Press's "portal bible" suggests using javascript from pl/sql via the utility htp.p() to effect web page components in portal.
My TAR on the subject, while still open, returned the result basically: "We can reproduce your situation. Everything looks okay to us, but we can't explain how to use javascript where you want or point you to any documentation that would solve your problem or expain why it should not work the way you want it to. We don't feel its a technical issue. Why don't you post the problem on the portal applications forum."
I'm hoping I'm just missing something fundamental and everything will work if I implement it a little differently. So if anyone sees my error, please let me know.
by the way, not sure this is germain, but in reference to your comment:
"redirections in pl/sql procedures give a peculiar result. in a pl/sql procedure, usually, portals give the last redirection statement and ignore anything else coming after it."
if I try to raise an alert:
htp.p('alert("you screwed up")');
return;
in a pl/sql event handler, it still doesn't raise the alert, even though its the last thing implemented in the event handler. But if I set the value of a text box using p_session..set_value_as_string() at the same spot, it correctly sets the text box value when I return to the form. -
Apex 4.1. cannot see the details of not null validations generated by apex
Hi there,
I have worked with APEX 3 quite a while. Now I move to new place, and they use APEX 4.
I am currently doing the Advanced Tutorials - Issues Tracker (written for 3.2 ) on an APEX 4.1.
I am quite impressed with a lot of enhanced features of APEX 4.
However, I think I got quite confused about the NOT NULL vaildations.
In the tutorials, they said when creating a form based on a tablle of which the columns have NOT NULL constraint, it will automatically generate NOT NULL validation.
But when I extend the validation section (in both Component View and Tree View), I cannot see any vaildation there.
So I go a head and create some NOT NULL validations for all NOT NULL fields.
Guess what, when I test the form, I got duplicate error messages.
I get these
6 errors have occurred
Project Name must have some value. (Go to error)
Start Date must have some value. (Go to error)
Target End Date must have some value. (Go to error)
Please provide project name. (Go to error)
Please provide project start date. (Go to error)
Please provide target end date. (Go to error)
My validation has error message "Please provide project name" while the automatic one has "Project Name must have some value".
The issue is I cannot find where the automatic validation is.
What if I want to customise the error message rather than just "#Label# must have some value".
Do any of you have any ideas why ?
I guess I must have chosen something wrong during page generation.
It could be quite simple but I don't know where to find the place that turn on/off the automatic not null validation, or at least customize these automatic error messages.
I currenly develop the application using workspace admin account.
Thanks a lot in advance.
AnnI found it. Turn out to be the Settings, choose No for Required Value.
-
Event Handler not found -OIM 9102
Hi Experts,
I'm facing a problem while creating a user manually in OIM. Everytime I try to manually create a user, an error message is displayed on the GUI saying, "DOBJ.EVT_NOT_FOUND
Event Handler not found".
On checking the logs, this is what I get there. Since I'm a newbie, I'm not able to figure out what's happening.
Any help would be great.
java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("XELADM"."UPA_USR"."ACT_KEY")
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:85)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1030)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:947)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1222)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3381)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3462)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1349)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:365)
at com.thortech.xl.dataaccess.tcDataBase.writePreparedStatement(Unknown Source)
at com.thortech.xl.dataobj.PreparedStatementUtil.executeUpdate(Unknown Source)
at com.thortech.xl.audit.auditdataprocessors.UserProfileRDGenerator.insertUserProfile(Unknown Source)
at com.thortech.xl.audit.auditdataprocessors.UserProfileRDGenerator.processUserProfileChanges(Unknown Source)
at com.thortech.xl.audit.auditdataprocessors.UserProfileRDGenerator.processAuditData(Unknown Source)
at com.thortech.xl.audit.genericauditor.GenericAuditor.processAuditMessage(Unknown Source)
at com.thortech.xl.audit.engine.AuditEngine.processSingleAudJmsEntry(Unknown Source)
at com.thortech.xl.audit.engine.AuditEngine.processOfflineNew(Unknown Source)
at com.thortech.xl.audit.engine.jms.XLAuditMessageHandler.execute(Unknown Source)
at com.thortech.xl.schedule.jms.messagehandler.MessageProcessUtil.processMessage(Unknown Source)
at com.thortech.xl.schedule.jms.messagehandler.AuditMessageHandlerMDB.onMessage(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:495)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:116)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:402)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:1092)
at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1392)
at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266)
at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:906)
at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
at org.jboss.mq.SpySession.run(SpySession.java:323)
at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:761)
at java.lang.Thread.run(Thread.java:619)
2011-03-18 15:55:01,283 ERROR [XELLERATE.AUDITOR] Class/Method: UserProfileRDGenerator/insertUserProfile encounter some problems: Failed to insert user profile record in table UPA_USR for auditee 5943
2011-03-18 15:55:01,283 ERROR [XELLERATE.AUDITOR] Class/Method: UserProfileRDGenerator/insertUserProfile encounter some problems: {1}
com.thortech.xl.orb.dataaccess.tcDataAccessException
at com.thortech.xl.dataaccess.tcDataAccessExceptionUtil.createException(Unknown Source)
at com.thortech.xl.dataaccess.tcDataBase.createException(Unknown Source)
at com.thortech.xl.dataaccess.tcDataBase.writePreparedStatement(Unknown Source)
at com.thortech.xl.dataobj.PreparedStatementUtil.executeUpdate(Unknown Source)
at com.thortech.xl.audit.auditdataprocessors.UserProfileRDGenerator.insertUserProfile(Unknown Source)
at com.thortech.xl.audit.auditdataprocessors.UserProfileRDGenerator.processUserProfileChanges(Unknown Source)
at com.thortech.xl.audit.auditdataprocessors.UserProfileRDGenerator.processAuditData(Unknown Source)
at com.thortech.xl.audit.genericauditor.GenericAuditor.processAuditMessage(Unknown Source)
at com.thortech.xl.audit.engine.AuditEngine.processSingleAudJmsEntry(Unknown Source)
at com.thortech.xl.audit.engine.AuditEngine.processOfflineNew(Unknown Source)
at com.thortech.xl.audit.engine.jms.XLAuditMessageHandler.execute(Unknown Source)
at com.thortech.xl.schedule.jms.messagehandler.MessageProcessUtil.processMessage(Unknown Source)
at com.thortech.xl.schedule.jms.messagehandler.AuditMessageHandlerMDB.onMessage(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:495)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:116)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)
at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:402)
at org.jboss.ejb.Container.invoke(Container.java:960)
at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:1092)
at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1392)
at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266)
at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:906)
at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
at org.jboss.mq.SpySession.run(SpySession.java:323)
at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:761)
at java.lang.Thread.run(Thread.java:619)
Thanks,
NikhilCheck for the ACT_KEY in the USR table in the database for User with the key 5943. It should not be null. Just a hunch by looking at the error and of course as Kevin said, you need to truncate the jms stuff.
-Bikash -
Error handling in Portal standard forms
I have a customer who needs to validate input on a Form Based on a Table (standard component). They have tried code, as shown below, as a PLSQL handler on a Save button. This example can obviously be solved with JavaScript validation on the client, but they have similar requirements for validation on DB level.
If procedure call 1) in the if statement is used, nothing happens. If procedure call 2) is used, it is executed in a new page as a standard error Oracle Portal error message.
declare
v_sender VARCHAR2(1000);
v_sender_id NUMBER;
begin
v_sender := p_session.get_value_as_VARCHAR2(
p_block_name => 'DEFAULT',
p_attribute_name => 'A_SENDER');
v_sender_id := p_session.get_value_as_NUMBER(
p_block_name => 'DEFAULT',
p_attribute_name => 'A_SENDER_ID');
insert into hd (number, text) values (hd_seq.nextval,
'step 3 v_sender = ' || v_sender ||
' v_sender_id = ' || v_sender_id);
if v_sender_id >= 100 then
1) Custom error handling, does not display:
show_error('Error message');
2) Error handling is displayed, but as a standard error:
raise_application_error(-20000, 'SenderID must be smaller than 100.');
else
doInsert;
end if;
end;
The customer has two questions:
Why does the custom procedure in 1) "show_error" not execute, and if it does, why does it not display? show_error works and the if statement is entered.
Is it possible to take control of Portals error handling on standard components (forms etc.), to show custom error messages with the style used on the component/page instead of the standard Error: ORA- ....etc. as Portal displays it?
Customer needs reply asap. Please reply directly. Any help will be much appreciated!
Kind regards
Jakob LundJacob,
Try following:
declare
v_sender VARCHAR2(1000);
v_sender_id NUMBER;
begin
v_sender := p_session.get_value_as_VARCHAR2(
p_block_name => 'DEFAULT',
p_attribute_name => 'A_SENDER');
v_sender_id := p_session.get_value_as_NUMBER(
p_block_name => 'DEFAULT',
p_attribute_name => 'A_SENDER_ID');
insert into hd (number, text) values (hd_seq.nextval,
'step 3 v_sender = ' || v_sender ||
' v_sender_id = ' || v_sender_id);
if v_sender_id >= 100 then
p_session.set_value(
p_block_name => "_block",
p_attribute_name => '_STATUS',
p_value => 'Sender ID must be less than 100!');
-- return to your form with status message set
-- and all fields filled with recent values
return;
end if;
end;
-- This point is reached only if validation is OK
doInsert;
Regards,
Henn
Maybe you are looking for
-
I am currently able to stream movies (not purchased from iTunes but mp4 format) to my Apple TV (3rd Gen) while iTunes is running on my computer. Is it possible to stream movies to my Apple TV with my computer off? Maybe if there was a cloud drive tha
-
I would like to purchase an i-book as a gift, can I purchase and send to a different e-mail for her to download?
-
Does anyone else find it funny that Apple's home page does not work on their own iPhone?
-
User login on which server?
Hi SDN Where we have 2 or more servers, how can I, in my javacode find out which server the user has logged on to? request.getServletRequest().getServerName() just gives me the name but not the "instance" Thanks Peter
-
Hi, I know a standard program RSTXPDFT4 which converts a single spool to PDF. Do we have any thing for multiple spools? My requirement is I will key in Spool numbers via Selection options and I want Pdf file separetly to be dumped for each file in t