Updating a view column in Postgresql - postgresql

So, I have a database of customers information ranging from phone numbers to names and even location.
I created a view of only the active customers and included an extra blank column where we can indicate if the customer has made purchase or not.
The issue now is, i keep getting an error: cannot update column "buy" of view
I tried entering a value in the blank column created.
Please how can I update a blank column in view

If you have a view column defined like
NULL::text AS viewvol
or
''::text AS viewcol
you cannot insert values into that column, nor can you update it. Data modifications on a view are translated to data modifications on the base table, and that only works for view columns that are defined using table columns.
What you can and should do is to create an INSTEAD OF UPDATE trigger for the view that performs the desired operation on the base table.

Related

FileMaker: Allow the user to filter the table and then revert back to showing all records

I've just started using FileMaker Pro. I have created a spreadsheet in Excel which I'm basically trying to recreate in FileMaker.
I have my table (or, Portal) set up with data. Above the table I have 3 drop down fields, which pull their values from the table below. Based off of the value of the drop down fields, I want a GO button that will filer all of the table items to match what is in the 3 drop downs.
Image the table contains Car, Colour, Year. If the user selects Mercedes, Red, 1980 from the 3 drop down fields, I want the table to only show results that match those fields.
Ideally I'd like a button to trigger this action, and another button that resets it so it shows all results.
I can see that you can filter the table when you double click it, but this seems to set it to permanently filter. I want a button to do it basically.
Would appreciate the help! Thanks

Libreoffice base report's total

I've found a lot of info about how to add "total" row to report, but none of them worked as needed. As for the moment I have a report, made of query and additional query, calculating only totals.
the report shows the first query's values as a table. I have added new form, linked to second query, added formatted text box, showing the totals. I want the total field right under the last line in the table, so I added new row to report's table and added field there. When generated, the data from the first query overwrites that column (and messing the formatting). If I add it just right under the table (not inside it) - the field hasn't been shown (I presume it's area 've been overwritten by table - Doesn't matter is I anchor it as character or by paragraph).
If I add the field somewhere far under the table - that works, but it's very unhandy to have report's table and far under it - totals.
How can I put the field under the table? When I tried to put the table in another two-rows table (one is for first query, one is for totals) - Base crashes.

SSRS cannot linked text box with field

I group my table by 3 attributes, and set page break on every group, and now i want to display that three attribute outside the table. I want to place them on the top of the report, and when i type the expression and i go in run view it's display only the first value, when i go to the next page nothing change
I tried to drag field from table, from data set, and nothing working.
In expression i type
=Fields!My_Field.Value.
Also if some of that three attributes i placed in table it normally displays values, but when i try to move it somewhere it stops displaying.
The issue is that a table is associated with a dataset but a text box is not.
You can reference a field from a text box using the Dataset field ( =Sum(Fields!AMOUNT.Value, "Dataset1") ) but you need to use an aggregate function like First, Last, or SUM.
It sounds like you don't want to use an aggregate since you are grouping by these fields, though.
display the three attribute outside the table
If your trying to display the current grouping in the table at the top of each page, add a new Row in your matrix above your header row and add your group fields there.

apex tabular form icon link column

I am working with a wizard-generated Tabular Form column that needs to display an icon which launches a Javascript function and pass the row value into the function when clicked. The function launches a popUp2 window which sets the values of other fields on that row. So the row number is crucial, but it is always 0 for newly-created rows (in APEX 4.0.0.00.46). I managed to solve that problem by storing the rowNum of new rows into my Updated By column during AddRow.
What I have now is an Updated By column ("Lookup" Heading) which stores the row number of new rows, has onClick="javascript:usePopup(this);" in the Element Attributes which launches the popUp window function, and then gets any values under 2 digits wiped before submit. This fills the correct fields and submits to the table with no problem.
I can't keep using the Updated By column for this function, though. There are currently reports running on this table, so I can't add a new column to the table. I need a dummy column to display the icon, temporarily store the Row Number of newly created rows, and not mess up the MRU. It is f08, so the value of f08_0005 needs to be 0005. I tried making a null column with
select
"FUEL_USAGE_DETAIL_ID", ...
"EXPENSE_TO_PROJECT",
"EXPENSE_TO_TASK",
NULL Lookup,
"UPDATED_BY",
"PROVIDER"
from "#OWNER#"."FUEL_USAGE_DETAIL"
but that can't submit. I get the Error in mru internal routine: ORA-20001: Error in MRU: row= 1, ORA-20001: ORA-20001: Current version of data in database has changed since user initiated update process. current checksum = "01A949FAF0B3A91914ECACCDC9BBA9E6", item checksum = "B6ADF86455B14EF691B2AFB314926A0D".
Please help me create a null column to display this icon, store the row number of all the rows (including the brand new rows), and not mess up the MRU. If you need pictures of what I have and what I need, see my other thread: https://community.oracle.com/thread/3649771 Thank you!
Fractal65,
Do not add any null column in tabular form.
just go to>>Edit tabular form attribute make following change
you will get it position as f02_000X (x-rownum)
now uou can use this rownum value in javascript or anything.
Hope this helps.
I had a similar error with my last project. Do you have a none displayed row selector? Please try to delete it to see if it will work.

Erroneous duplicate rows in BIRT report

I have a problem with a BIRT report I'm working on where I have a nested table in the report. The outer table contains data to do with an item on an invoice, while the inner table contains stuff to do with price banding for labor charges. I've written a separate DataSet which gets the inner data, bound by parameters to data in the outer table. Now, when I preview the inner DataSet in BIRT using the defaults I've given it, it returns two rows of data for that bill number & item number - a normal rate & an overtime rate if you like. When I run the report in full over the same data, the outer table stuff is fine, but the inner table just repeats the same row over twice - it's just the first row repeating.
This is sorta what the table looks like in layout view:
Item Description Rate Quantity Item total
[item] [desc] [rate] [quantity] [total]
...where the price & quantity are in the inner table.
I'd have expected to see something like:
Item Description Rate Quantity Item Total
1 Callout $40 1 $40
2 Labor $30 4.5 $185
$50 1
but instead I get more like:
Item Description Rate Quantity Item Total
1 Callout $40 1 $40
2 Labor $30 4.5 $185
$30 4.5
...even though querying the database & previewing the inner data set based on the same input criteria show the expected result.
Has anyone else had experience like this? I have a hunch it's to do with bindings, but not sure what.
One way to get this behavior is by accidentally replacing a table-level binding with a column-level binding.
For example, define a table by dragging a data set into the report. Select the entire table (use the outline view, or select something in the table and then click on the "Table" button that pops up just below the grid.) Then go to the Binding tab. Note that the data set and column bindings are all filled in.
Now select just one field in the Detail row. On the Binding tab, note that the Data Set is blank, and no column binding is shown. Someone who is confused by this (as I was) might then edit the column's binding and specify the same Data Set that was used to create the table. If you do this you will only see a single value repeated in that column when you run the report. (I believe the overridden column is binding to a second instance of the data set, not the one the table is iterating over.)
Not sure your question can be answered withou looking at the data and the design. But it is important to note that the results you see in the dataset preview, and not neccisarly what you would see if the query was run fully. I have seen difference with 7 records returned. I thought as it was only 7 it would be the same on full run, but it's not. The preview is not just a top 500 query, it has some other (not sure what) filters also.
To problem solve if it is your query or your binding.
If you are using a SQL database. Run the SQL in a SSMS query and see if you get the same results you do when run in the innner table.
Altentively, create a new test report, copy over your dataset and use with a stand alone table.
I think I sorted it, & this is the most bizarre thing: On the child table I'd been deleting the header & footer row & just leaving the detail row in, in the layout view. Last thing today, just before I was going to go home, I tried again - deleted the table for about the 70th time that day, replaced it, re-did the parameter bindings all exactly as before, but this time I left the header row & footer intact. Clicked the preview tab, voila, all shows up correctly. So, since I didn't need the header or footer on the child table, I went into properties, clicked Hide this element, preview again - all good. No difference to the data bindings, no difference to mappings or anything else, no change to the data sets - the only difference was leaving the header & footer in place but hidden.
Contemplating making a bug report, tbh.