CLOB WRITE WITH OO4O - clob

I get the error : OIP-04908: This operation is not permitted on a Null LOB when
Set MyClOB_0 = lOraDynaset_0.Fields("FILE_BODY").Value
lOraDynaset_0.Edit
amount_written = MyClOB_0.Write(buffer, chunksize, ORALOB_FIRST_PIECE)

I've just had the same problem when trying to insert into an Oracle CLOB field.
I got around it by:
Setting the Oracle field to 'Empty' (the VB6 keyword Empty - e.g. MyClOB_0.Value = Empty)
Performing the insert (e.g. lOraDynaset_0.Update)
Editing the dynaset record (e.g. lOraDynaset_0.Edit)
Setting the Clob field value to what you want it
Performing the update (e.g. lOraDynaset_0.Update)
Hope this helps (sorry if its not clear)

Related

How to append the data in big query having a column mode as REQUIRED in python? Error I get is ABC_Col changed mode from REQUIRED to NULLABLE

value = self.bq_client.import_data_from_dataframe(table=table_id, dataframe=dataframe,
source_format=bigquery.SourceFormat.CSV,
autodetect=True,
write_disposition=operation_type,
allow_quoted_newlines=True)
The code I am using right now is the above but it throws an exception as I mentioned when I try to append data into my BQ table. There are no nulls in the data to be appended.

Google Dataflow: how to insert RECORD non-repeated type field to Big Query?

I'm new to Dataflow. I've got a predefined-schema containing a non-repeated RECORD field called "device":
device.configId: STRING
device.version: STRING
Using a ParDo transform, I tried inserting a TableRow with this kind of field, as follows:
TableRow row = new TableRow();
row.put("field1", "val1");
TableRow device = new TableRow();
device.put("configId", "conf1");
device.put("version", "1.2.3");
row.put("device", device);
out.output(row);
I logged the table row, it looks like this:
{field1=val1, device={configId=conf1, version=1.2.3}}
I output it to a standard transform: BigQueryIO.write()
But the latter issues an error:
java.lang.RuntimeException: java.io.IOException:
Insert failed: [{"errors":[{
"debugInfo":"",
"location":"device.configid",
"message":"This field is not a record.",
"reason":"invalid"
}],"index":0}]
Not sure why, but note the location spells "configid" in lowecase - not in camel case as in the original log.
Any ideas on how to insert such an object to BigQuery?
Found out the problem. Apparently, this error message was caused only when the "configId" field was set to null rather than "conf1". To be exact, it was implicitly set to JSONObject.NULL coming from some input object.

Add field/string length to logstash event

I'm trying to add a string length field to an index. Ideally, I'd like to use the kibana script feature as I can 'add' this field later but I keep getting a null_pointer_exception with the following code... I'm trying to sort in a visualization based on the fields length.
doc['field'].value ? doc['field'].length() : 0
Is this correct?
I thought it was because my field isn't always set (sparse data), but I added the ?:0 to combat that (which didn't work)
Any ideas?
You can define an scripted field in Kibana, of type int, language painless, and try this:
return (doc['field'].value != null? doc['field'].value.length(): 0);

Error when displaying XML as text, with user selected parameters

In my report (BIRT 4.2) I am getting data from a SQL 2008 R2 data base. The client has asked to add a new field to the report. The field has xml data that is formatted as text (example data below). I can display it fine, in html, or Excel; BUT if I have a user selected parameter the report crashes (error message below). Works fine in previews (report & SQL).
I don’t think there is any xml as text in the sample data base, so not seeing how I can create an example using the sample data.
Having string parameters is fine, but as soon as I put the ‘?’ it crashes on deploy via Apache. The parameter is a date.
Works ; where OCMQM1.SUBMIT_DATE >= '2013-12-01'
Fails ; where OCMQM1.SUBMIT_DATE >= ?
I have tried casting the field varchar (1), etc no matter how many characters, or what allowable format I cast to, I get the same error. Even converting the xml to a single character of varchar and then replacing the character with a blank space in at the SQL give the same crash on deploy. I have recreated the report from scratch and modified the existing working report, with identical results.
, replace (
cast (OCMQM1.SVC_OPTIONS as varchar (1) )
, '<' , ' '
) as 'Request_Details'
Error message
The following items have errors:
Table (id = 1293):
+ Cannot execute the statement.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: SQL statement does not return a ResultSet object.
SQL error #1:The value is not set for the parameter number 1.
;
com.microsoft.sqlserver.jdbc.SQLServerException: The value is not set for the parameter number 1. (Element ID:1293)
XML data example
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><form><text id="ExistingServerName" label="Server Name:" multiline="false" readonly="false">WINHPLNSPRD128</text><text id="ProjectFunding" label="How is this project funded?" button="4001" multiline="false" readonly="false">34542 - Enable HealthPlaNET Architecture to Support Multiple Customers</text><text id="ImplementationDate" label="Requested Implementation Date:" multiline="false" readonly="false">12/12/2013 00:00:00</text><text id="CPUNeeded" label="Additinal CPU Needed:" multiline="false" readonly="false">1</text><text id="MemoryNeeded" label="Additional Memory Needed (in GB):" multiline="false" readonly="false">0</text><text id="AdditionalStorage" label="How much additional disk storage is needed (in GB)?" multiline="false" readonly="false">0</text><text id="ExpandDrive" label="If this request is to expand an existing drive, what drive letter should be expanded?" multiline="false" readonly="false"></text></form>
Note The user supplied parameters work fine, when the xml is not part of the report. Adding the field to the SQL, even if not added to the report table, and regardless of placement in the SQL causes the error.

String was not recognized as a valid Boolean Error on varchar column

I am getting this error:
String was not recognized as a valid Boolean.Couldn't store <No> in meetsstd Column. Expected type is Boolean
When I am running this query:
SELECT * FROM work_nylustis_2013_q3.nylustis_details WHERE siteid = 'NYLUSTIS-155718' LIMIT 50
From this code:
Adapter.SelectCommand = New NpgsqlCommand(SQL, MLConnect)
Adapter.Fill(subDT) ' This line throws error
The meetsstd field is a varchar(3) and it does store either a 'Yes' or a 'No' value. How is this getting this confused with a boolean - a varchar should not care whether is holds 'Yes', or 'Si', or 'Oui'? And it only happens on 27 records out of the 28,000 in the table.
I usually blame npgsql for this kind of strangeness, but the last entry in the stack trace is: System.Data.DataColumn.set_Item(Int32 record, Object value)
Any clues?
Thanks!
Brad
To check if it is problem with database or with driver you can reduce problem to one row and column using your current environment:
SELECT meetsstd FROM work_nylustis_2013_q3.nylustis_details WHERE sitenum=1
(of course you must change sitenum into primary key)
Then try such query using psql, pgAdmin or some JDBC/ODBC based general editor.
If psql shows such record which raises error with your Npgsql based application then problem is with Npgsql driver or problem is with displaying query results.
If other tools shows such strange errors then problem is with your data.
Have you changed type of meetsstd field? Mayby you try to show it on some grid and this grid used Boolean field which was converted to Yes/No for displaying?