I was wondering if someone could give me some advice. I would like to get data from a database using a Database Query. During this process, I want to extract NULL as an extra field, but I encountered an error. Can I have a NULL field as a result of a Database Query? The error message was ‘W3612: Error running SQL: Invalid field size’.
Thta error is returned by the database.
Can you share your query?
Hi @jchamel
This is my query.
select *
from
(
select
‘8_024’ “REF#”,
‘INVENTORY_PART_TAB’ “Table”,
(SELECT COUNT(1) FROM IFSAPP.INVENTORY_PART_TAB) “table total count”
,NULL AS “extra field”
from dual
)
When I execute this query on another tool, I get the correct result. Please find the attached file. However, when I try to execute this query on Workflow, I encounter ‘W3612: Error running SQL: Invalid field size’.
I tried your query, with the table I had and it works in Workflow using the Database plugin. I am using Connect 2024.2.1.
See below:
SELECT * FROM
(
SELECT
'8_024' [REF#],
' INVENTORY_PART_TAB' [Table],
(SELECT COUNT(1) FROM ASSET_ITEM) [table total count],
NULL AS [Extra Field]
FROM ASSET_ITEM
) as blou
Can you share your query as written in the Database plugin?
Also, what is the returned emulation you’ve setup in the plugin? (To be found on the 1st tab of the plugin)
Try to give a name toyour FROM subquery:
…from dual) as test
Does the ORA-00933 error also occur when you replace the double quotes (" "), as applied in your SQL query, by square brackets ([ ]), as shown in this reply?
I have tried both on my machine and both works for me.
Based on the error, my guess is that @Kiyomi_Kokubun use an Oracle database. Maybe it is something specific to it?
Yes, I use Oracle Database. When I used square brackets instead of double quotes, I encountered the ORA-00923 error. Do you have any solutions?