Can I have NULL field as result of Database Query?

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)

1 Like

Hi @jchamel

This is my query in Database plugin.

Try to give a name toyour FROM subquery:

…from dual) as test

Hi @jchamel

I am encountering an ORA-00933 error. What should I do?
test_sql.pdf (23.7 KB)

At this point, I suggest you open a technical support ticket through our website.

Hi @jchamel

I’ll do that. Thank you for your help.

Kiyomi

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?

Hi @jchamel , @Marten

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?

Please follow the suggestion made by jchamel.