Skip to main content
Solved

query of invoice_attachment table


Forum|alt.badge.img+7

How do we see the records in the invoice_attachment table?  I am getting “Query returning data types BLOB/CLOB is not supported.”  I just want to see the company and invoice_id for a specific company.  

A previous post mentioned excluding the BLOB/CLOB fields, but not how do to that.  Can someone give me a specific example for excluding those types of fields?

Best answer by NiyomalN

@dkjensen , Try this query. This will return the invoices without attachments.

if you want to see the invoices with attachment then change the NOT IN to IN.


select I. company, i.INVOICE_ID
  from INVOICE_LEDGER_ITEM_SU_QRY i
 where i.LEDGER_ITEM_ID not in
       (select SUBSTR((SUBSTR(t.key_ref,
                              INSTR(t.key_ref, 'LEDGER_ITEM_ID=') + 15)),
                      1,
                      INSTR((SUBSTR(t.key_ref,
                                    INSTR(t.key_ref, 'LEDGER_ITEM_ID=') + 15)),
                            '^') - 1) as Invoice_id
          from doc_reference_object t
         where t.lu_name = 'InvoiceLedgerItem')

View original
Did this topic help you find an answer to your question?

9 replies

NiyomalN
Hero (Partner)
Forum|alt.badge.img+10
  • Hero (Partner)
  • 102 replies
  • August 10, 2023

Hi @dkjensen ,

 

if you only need to see company and invoice id, you can use the below query. to exclude any unwanted field, you just need to specify the fields that need be in the result set rather than going with select * from XXX.

 

select t.company, t.invoice_id from invoice_attachment t

 

Kind Regard!

Niyomal.


Forum|alt.badge.img+7
  • Author
  • Do Gooder (Customer)
  • 26 replies
  • August 10, 2023

I tried that select statement but am still getting an error.


Forum|alt.badge.img+7
  • Author
  • Do Gooder (Customer)
  • 26 replies
  • August 10, 2023

Also, who do I tell which fields are BLOB/CLOB?


Forum|alt.badge.img+7
  • Author
  • Do Gooder (Customer)
  • 26 replies
  • August 10, 2023

I am trying to find which supplier invoices do NOT have attachments.  IS the invoice_attachment the correct table?  

 


NiyomalN
Hero (Partner)
Forum|alt.badge.img+10
  • Hero (Partner)
  • 102 replies
  • August 10, 2023
dkjensen wrote:

I tried that select statement but am still getting an error.

By looking at the screenshot seems like it is executing something else.

can you restart the application and if the query works ?  i tried the same using one of our internal environment and it works for me.

 

 

Kind Regards!

Niyomal.

 


NiyomalN
Hero (Partner)
Forum|alt.badge.img+10
  • Hero (Partner)
  • 102 replies
  • August 10, 2023
dkjensen wrote:

Also, who do I tell which fields are BLOB/CLOB?

I don't think that we can see the data type from the sql query tool.

the easiest way  is to use the pl/sql developer in this case.

 

Kind regards!

Niyomal.


Forum|alt.badge.img+7
  • Author
  • Do Gooder (Customer)
  • 26 replies
  • August 10, 2023

Reopening the application does show me the fields, but no data.  Now I wonder if that is the right field.

We are trying to identify which invoices do not have attachments.  In the screen shot the highlighted one DOES not have anything attached.  Other then clicking the paperclip on every single one, who can get a list of those invoices without attachments?


NiyomalN
Hero (Partner)
Forum|alt.badge.img+10
  • Hero (Partner)
  • 102 replies
  • Answer
  • August 10, 2023

@dkjensen , Try this query. This will return the invoices without attachments.

if you want to see the invoices with attachment then change the NOT IN to IN.


select I. company, i.INVOICE_ID
  from INVOICE_LEDGER_ITEM_SU_QRY i
 where i.LEDGER_ITEM_ID not in
       (select SUBSTR((SUBSTR(t.key_ref,
                              INSTR(t.key_ref, 'LEDGER_ITEM_ID=') + 15)),
                      1,
                      INSTR((SUBSTR(t.key_ref,
                                    INSTR(t.key_ref, 'LEDGER_ITEM_ID=') + 15)),
                            '^') - 1) as Invoice_id
          from doc_reference_object t
         where t.lu_name = 'InvoiceLedgerItem')


Forum|alt.badge.img+7
  • Author
  • Do Gooder (Customer)
  • 26 replies
  • August 10, 2023

Thank you so much, that is exactly what I was looking for and I would not have found the correct table.

 

Sincerely, 

Deb Jensen


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings