InterBase database blob column - interbase

Could anyone please tell me how can I display the contents of an InterBase database blob column. I am trying to display the column in plain text or display its content but cast doesn't convert the data type. BLOB SUB_TYPE 0 SEGMENT SIZE 80

Related

Add a column with NULL values in Tableau Prep

I am using Tableau Prep to load PDFs to SQL server. The PDF contains several tables. All the columns except the one with NULL values is not created. If there are 12 columns in the PDF, I'm seeing only 11 in the Output. There's a column that has NULL values. Is there a way to create a column to have NULL values? The column is blank initially(eg, Jan, and values are being populated from Feb onwards) and then is being populated with float values. The PDF's need to be loaded daily. I created the column but it gives an error 'Error adding Text[columnname]. Expected different text.' Prep Version is 20.3.3.
Do I continue loading the Jan files and then is it possible to add the column and map it Feb onwards?
Is there another way to accomplish this?
Thank you in advance.
A little late answering but, you can add a null column as follows:
After connecting to your pdf table, add a Clean activity
Select data grid view and right click on a column
Select Create Calculated Field then Custom Calculation
Name your calculation and set the calculation value as NULL
Reset the data type as Number (decimal)
Add an output activity, saving output to Database table

Extract varbinary column data in its original format

I am using Microsoft SQL Server 2008 R2. I have a varbinary column RelatedData_img in the table Reminderimage. In that column I store Word, Excel files, images (png, bmp or jpg format) or text files etc. Now I want to store data from that column to a disk using command.
I got this command,
"bcp "SELECT RelatedData_img FROM Reminderimage.dbo.Reminderimage" queryout reminder.dat -T -c"
This command creates a "reminder.dat" file which contains all the data of RelatedData_img column. Now I want to extract all the files from that file in its original format (excel, word, jpg etc).
How to extract the reminder.dat file ?
Please help me with this.

How to load file with time (Date) type into Hive table?

I'm using hive to create and try to load file content into the table.
There's a column type "Date" and the date format in the file is dd/mm/yy, for example: 01/12/2013
But when I trie to load the data into table from the file, the column values corresponding to the "Date" is always NULL, as if failed to load the date content.
I put the column content into a txt file and upload to the hdfs, so, the column may be:
id, name, birthdate
and corresponding value are:
1, "Joan", 04/05/1989
But the "04/05/1989" seems can't be read into the table, always null.
Please tell me if the format in my txt file is wrong or I need some specific grammar when loading date type data into Hive table.
Thanks!
Date data type format is YYYY-MM-DD. You need to format field accordingly.
More details on
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-date

how to store text and image in the same column?

I have a table in SQL server 2008 R2 where I am storing values of translations.
The translated values can be a text or it can be an image also. We want to use same column for storing the image and text so when we do a search we don't have to give 2 queries based on type of data.
my question:-
1. Can I store image and text in the same column?
2. should I do that? or should i have 2 different columns? (one with varbinary and other simple nvarchar)?
As to 1 - you can... just use a varbinary and handle everything else on the client side...
As to 2 - you SHOULD NOT use 1 column for both... but 2 columns (one varchar, one varbinary) !

How can I truncate data to fit into a field using SQL*Loader? (ORA-12899)

Using Oracle SQL*Loader, I am trying to load a column that was a variable length string (lob) in another database into a varchar2(4000) column in Oracle. We have strings much longer than 4000 characters, but everyone has agreed that these strings can and should be truncated in the migration (we've looked at the data that goes beyond 4000 characters, it's not meaningful). To do so, I specified the column this way in the control file:
COMMENTS CHAR(65535) "SUBSTR(:COMMENTS, 1, 4000)",
However, SQL*Loader still rejects any row where this record is longer than 4000 characters in the data file:
Record 6484: Rejected - Error on table LOG_COMMENT, column COMMENTS.
ORA-12899: value too large for column COMMENTS (actual: 11477, maximum: 4000)
Record 31994: Rejected - Error on table LOG_COMMENT, column COMMENTS.
ORA-12899: value too large for column COMMENTS (actual: 16212, maximum: 4000)
Record 44063: Rejected - Error on table LOG_COMMENT, column COMMENTS.
ORA-12899: value too large for column COMMENTS (actual: 62433, maximum: 4000)
I tried taking a much smaller substring and still got the same error. How can I change my control file to truncate string data longer than 4000 characters into a varchar2(4000) column?
Check to make sure your data ENCODING and Oracle ENCODING are not conflict.
In this case, use CHARACTERSET option when loading.
by all accounts
COMMENTS CHAR(65535) "SUBSTR(:COMMENTS, 1, 4000)",
is the correct syntax.
using sqlldr 11.2.0.1 it works successfully for me up until the point where the input record column is > 4000 where i get a
ORA-01461: can bind a LONG value only for insert into a LONG column
if i switch to a directpath load then i get the smae error as you.
ORA-12899: value too large for column COMMENTS (actual: 4005, maximum: 4000)
in the end i have split it into a 2 stage load.. i now have a staging table with a column of type CLOB which i load with
COMMENTS CHAR(2000000000)
which then gets inserted to eth main table with a
insert into propertable
select dbms_lob.substr(comments,1,4000)
from staging_table;
hope thats helpful