Oracle Form 12c field showing hash instesad of number - oracle

I am working on Oracle forms 12c and facing an issue with few fields showing as hash(####) values instead of number field on data block when saving changes by clicking on SAVE (commit) button.
Also showing below error
(FRM-40735 KEY COMMIT Trigger raised unhandled exception ORA-01483)
it seems that it is due to change of field item from number to HASH (string)
For further information:-
-Fields are database items
-Trying to insert value in database fields by entering value on field.
-Size of fields are more than entered number value.
-on re-querying data block using (f7 & f8) data is showing correctly as number.
-Not able to recreate this issue on different database(working fine on other database)
is it something related to environment issue or minor bug while coding?

If the Returning_Dml_value property on datablock is set to Yes,it sometimes causes junk values to be populated and asks a requery on block. Try setting it to No instead.I faced a similar issue once and it got resolved by setting Returning_Dml_value property to No.
The following blog explains more about this property of Oracle forms:
http://cave-geek.blogspot.co.uk/

Related

Crystal Report not filtering SQL records based on selection formula

unfortunately I'm not an expert of Crystal Report, so I'll post here my question hoping for any help about my issue.
I want to display inside my report the result of a filter on a SQL RecordSet; this RecordSet is looked up from an a single table, of which I want to show some fields of my SQL table, while the filter I want to apply is based on a field parameter (defined static) that I'm trying to set programmatically.
Here below I attached my code where I'm applying the record selection formula, I tried also hard-coding the value instead of passing it through a dropdown selection:
ReportDocument RPT_Doc = new ReportDocument();
RPT_Doc.Load(RPT_Path_Name, OpenReportMethod.OpenReportByDefault);
ApplyConnInfos(ref RPT_Doc);
RPT_Doc.SetParameterValue("data_riferimento", "20161001");
RPT_Doc.RecordSelectionFormula = "{viaggi.data_part_pre} = '20161001'";
crystalReportViewer1.ReportSource = RPT_Doc;
In the first image attached you can find the field parameter definition, while second image is the record selection formula I defined inside my report:
The report always shows all the records of my table (more than ten thousand rows), instead of displaying a filtered RecordSet. The odd thing is Preview function from Visual Studio works like a charm; it prompts the field value, once I confirm the value the viewer displays the report with the rows filtered as I expect..
What am I missing from report/C# program configuration to make the record selection work?
Thank you in advance for any suggestion you can give me :)
Leonardo
Ok, finally we got the solution to our issue.
We found the CrystalReportViewer object used to display generated reports has 2 different properties, SelectionFormula and ViewTimeSelectionFormula; both has default value set to empty string.
Below I attached the picture of .Designer.cs file with the 2 properties valued:
We commented those 2 properties and the selection formulas and field parameters applied through code / report designer worked again.

Exception handling using Oracle Forms Builder

I am making my first Oracle form in Oracle Forms Builder with the help of web material i.e. tutorials etc. I have written the following code in the WHEN-BUTTON-PRESSED trigger:
INSERT INTO PATIENT VALUES
(:CNIC_NO, :P_NAME, :CITY, :ADDRESS, :GENDER, :BLOOD_GROUP, :DISEASE, :WARD_NO);
COMMIT;
The problem here is that an unhandled exception is raised by the trigger with the following error numbers:
ORA-12899 (Reason is the Null value is inserted in non-Null column)
ORA-1400 (Reason is that the data length is too large than the allowed length)
I need to popup an informative message box for these and a default one for the others.
First of all I would avoid this errors by builtin Oracle forms validation. Set Required property to True on property panel for all items, which are based on not null database columns. Oracle forms then forces user to enter a value.
Next set Datatype and Maximum length properties to set basic data validations.
This should be enough in your case. If your still want to catch an exception, use code like this:
begin
INSERT ...
exception
when others then
message(DBMSERRTEXT);
end;
Anyway - it is not good idea to insert data using when button pressed triggers. It is not transaction safe. Use standard forms block. Oracle forms does all the data validations and manipulations for you.
You have either to guarantee there is a suitable value will be inserted in the specified column that doesn't accept null value the you have to use NVL function inside the insert statement. Well, it's quite a good idea to have a technique too.
handle Oracle Forms errors and informative messages
You have also to construct your table columns size larger enough to store the inserted as the address for example must be larger than 100 varchar2.
You can use The Default Oracle Forms Menu Tool Bar will handle the form's CRUD Operations for you. Instead of writing the insert,update,etc.
But, you have to specify using it by yourself for every form module.

How can you properly automatically set which interactive report you navigate to in oracle apex?

I am using oracle apex 4.2 and was wondering if there is a special way to link to a certain default report that I created. So for example below I have made Region Name Pie report along with the default. I changed the aliases to 1 and 2 respectively. I tried using the link example but the synatx is malformed, so I tried another option below.
Here, I tried to set the Report ID Item to a variable that I set as I move to this page. And I looked at the session and this value is being set to 1 as needed(I assumed it was the Report alias I needed to set the value to).
Are these methods viable in Oracle or am I doing anything that is noticeably wrong? Thanks.
Edit: Error for Syntax:

getUserBy() phpfox

During working I faced a very weird thing in phpfox script
I put in the table user a new field .. and this field is tinyint with default value 0 and started to work on giving the user the ability to insert the value through links and finally it's succeeded but when I tried to get this value by getUserBy('name_of_the_field') it gave me a null value although I checked it in the database table and found that field has a value ... so could you help me please ?!
The getUserBy() does not get every field in the user table, there is a predefined list of columns that it will fetch.
You will need to get this field in a different way or write a plug-in to the hook "user.service_auth___construct_query" so it loads your new field, I have not tried this but I believe it should work as a plug-in to that hook:
$this->database()->select('u.my_new_field,');

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Please help, I have been trying to fix this error for the better part of 8 hours so far. I have a report in Crystal Reports that just started throwing this error. I changed a field in the View that is attached to the report, so I opened up my XSD file in VS2010 and renamed the current DT to ViewTracker0 and then pulled in the ViewTracker view. I added my queries from the old DT, ensured that there is no primary key, double checked that each length of the fields were the same as the db, checked to make sure that each column name is named to match the DB. I can preview my data fine in the XSD, as well as in SQL I can run my queries and everything is returned correctly. When I run my report, it dies everytime with this error.
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.
What do I need to check next.
Have you tried verifying the database within the Crystal Reports designer, then running the report?
Try traversing GetErrors(), described here:
http://www.fransson.net/blog/failed-to-enable-constraints-one-or-more-rows-contain-values-violating-non-null-unique-or-foreign-key-constraints/

Resources