Blob column populates null - Not able to create download file link in Oracle APEX - oracle-sqldeveloper

I have been facing a issue which I am trying to resolve since 2 hours.
Not able to find perfect solution how to fix for it.
Any solution is much appreciated
I have a table with following details
create table upload
(
fileblob blob,
mimetype varchar2(4000 char),
filename varchar2(4000 char),
createddate date,
getsequence varchar2(4000 char)
AS (TO_CHAR(createddate, 'YYYYMMDD_HH24MISS'))
);
I have built application using ORACLE APEX : 20.x
It as one form and selected above table and form is created
Then mimetype , filename , createddate , getsequence is set as hidden
After that fileblob field I have set below properties
MIME Type column : MIMETYE
FILENAME column : FILE_NAME
BLOB Last updated column : CREATED_DATE
Then I have set the Storage type as : BLOB column specified in item Source attribute
When I run the application , uploaded file from local and clicked on CREATE button.
One row got inserted but the issue is in interactive report not able to use create download file link.
And when I went to table to see any record got inserted I got below details
fileblob,mimetype,filename,createddate,getsequence
null , application/vnd.openxml...,ABC.txt,13/03/2022 11:14:35 , 20220313_111435
Expected is as below in table for column : fileblob
fileblob,mimetype,filename,createddate,getsequence
(BLOB) , application/vnd.openxml...,ABC.txt,13/03/2022 11:14:35 , 20220313_111435
For download file link to be working my fileblob should be populated as (BLOB).
Because of virtual column : getsequence data populating from createddate its causing issue i believe. But not sure
Query used in my interactive report
select ROWID,FILE_NAME,MIMETYPE,CREATED_DATE,sys.dbms_lb.getlength("C_FILE_BLOB")"CONTENT", getsequence from upload

Related

Flutter error while using sqflite no such column in table

I'm trying to learn flutter by myself so i've decided to make an app.
I admit that i have difficulties to make a database correctly so i've copied the code for the database from an opensource app.
Basically the copied app creates notes object which have a title, description date, id.
Now what i want is to add another attribute to the object (dateexamen) (String)
What I have :
I've a main.dart, a database.dart, model folder within a note.dart, a Screen folder within a page with a listView and a floating button to another page for modifying/add/deleting object.
My object has :
Name
Description
Date created
Priority
Dateexamen (I make everything to add this one)
When i click on the floatingbutton an object is created and then the form page opens and updates the object just created.
So what i did ?:
I've just went into the note.dart, added my attribute dateexamen everywhere juste like everything was inside it and did this for all the file.
I don't have any crashes, but now it doesn't want to create any object, it works again when a delete my modification to all files..
There is the error in the console :
E/SQLiteLog( 4684): (1) table note_table has no column named
dateexamen E/flutter ( 4684):
[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception:
DatabaseException(table note_table has no column named dateexamen
(code 1 SQLITE_ERROR): , while compiling: INSERT INTO note_table
(title, description, priority, date, dateexamen) VALUES (?, ?, ?, ?,
?)) sql 'INSERT INTO note_table (title, description, priority, date,
dateexamen) VALUES (?, ?, ?, ?, ?)' args [a, b, 2, Jul 13, 2019,
Sunday, July 14, 2019 at 12:00PM]}
There is the link to the app repo: https://github.com/fakman99/flutter_first/
Thank's in advance for your help, i'm very excited about flutter and i need to understand how database and backend works with flutter.
Have a good day, Fatih
It is likely that anyone who tries your application will not get the error you get. My guess is that you ran the application once before adding your new columns so indeed the column does not exist yet. In sqlite, once the tables are defined, unless you drop/recreate them, columns must be added manually.
Once solution for this is to bump the version number and modify (or simply drop/create the table) during the onUpgrade callback. We can call this a schema migration process. There is an example here: https://github.com/tekartik/sqflite/blob/master/sqflite/doc/migration_example.md.
One quick test on your side is to simply uninstall your app, or delete the app data before trying you code again => magic, it works!
It seems that you just adjust the objects, but not the database itself.
Search for the openDatabase
openDatabase(join(await getDatabasesPath(), 'cache.db'),
onCreate: (db, version) {
return db.execute(
'CREATE TABLE cache(timestamp INTEGER, query TEXT PRIMARY KEY, data TEXT)');
}, version: 1)
and adjust the create table according to your needs. (change version or wipe app data.) retry....

missing data for column xxx

I've downloaded multiple metro extracts from openstreetmap as PBF files when i try to import them with osm2pgsql it works for the first and creates the tables. I then want to add a column in the planet_osm_ways with a cityID to know which "way id" belonged to which city after i then try to import another city it says 'ERROR: Missing data for column "city_id". is there a way to modify the planet_osm_ways table without breaking the script? I really need to know which id belonged to which metro extract.
You need to edit the style file (default.style, possibly in osm2pgsql-bin directory) used by osm2pgsql.
You can then add the instruction
#Add custom column
node,way citiid int4 linear
The column will be created, and - provided no tag has this name - will not be populated. You are then free to populate it as you want.

SQL Cast string as hyperlink

My source data come from Pervasive SQL and returned in Excel (as external data query). I test the code in PCC.
My tables contains a file path and file name and when concatenated together I get a sting value. I want to cast this string as a hyperlink value so that I don't have to convert it in Excel.
Select path + file as link from file_source
There is no hyperlink data type in SQL Server. You need to use a VARCHAR i.e. VARCHAR(100) to store the link and then get the application or excel to display it as a hyperlink.
See:
How to change field type to hyperlink in SQL

Input data into a table using DLookUp in Access

I am using a Data entry continuous form to input data into a table named 'Order_History'. All fields successfully input their data into that table except for one. I have a text box that uses DLookUp to get the value from a combo box on that form and use it to select data in hopes of entering it into the table. The DLookUp is getting the data from a different table named 'Postcodes'. I assume that the reason the others work is because the control source is linked to columns in the table.
Is there a way I can link this text box (Drop_Number) to the specific column in my Order_History table while still using DLookUp to get the values?
My DLookUp code:
=DLookup("Drop_Number", "Postcodes", "Postcode = [Forms]![Order_Form]![Postcode_cb]")

SugarCRM - Mass update Contacts in a Target List

I want to insert todays date in a field in all the Contacts that are in a Target List.
What would be the best way? SQL somehow/somewhere, existing plugin, other ideas?
I am often seeing the use of BeanFactory when I google Sugar Customisations, but has no clue where to insert this code in the sugar files to acomplish what I want.....
Using SugarCRM CE 6.5.8, and Kinamu Reports module to generate the Target List.
Rgds
Petter
Export the Target List so that you get a CSV file
Ensure the CSV contains the Contact records' ID and name fields
Update the CSV to include a column for whatever field you're updating, and add the value you want all records to have
Contacts -> Import Contacts and select Insert & Update to update the records with the new values.
you can add date field in mass update panel
Only fields with the types of relate, parent, enum, contact_id, assigned_user_name, account_id, account_name and date can be added to the mass update panel. Of these you can only create types date and enum with the studio editor (I think).
You would just add 'massupdate' => true to the field description in vardefs.php.
If it's a custom field than search that field file in custom/Extension folder,
and add 'massupdate' => true there do repair and rebuild !