Skip to main content
Solved

query of invoice_attachment table

  • Aug 10, 2023 1:34 PM UTC
  • 9 replies
  • 615 views

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

9 replies

NiyomalN
Hero (Partner)
Forum|alt.badge.img+11
  • Hero (Partner)
  • Aug 10, 2023 2:33 PM UTC

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)
  • Aug 10, 2023 2:38 PM UTC

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


Forum|alt.badge.img+7
  • Author
  • Do Gooder (Customer)
  • Aug 10, 2023 2:40 PM UTC

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


Forum|alt.badge.img+7
  • Author
  • Do Gooder (Customer)
  • Aug 10, 2023 2:41 PM UTC

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+11
  • Hero (Partner)
  • Aug 10, 2023 2:48 PM UTC

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+11
  • Hero (Partner)
  • Aug 10, 2023 2:49 PM UTC

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)
  • Aug 10, 2023 3:07 PM UTC

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+11
  • Hero (Partner)
  • Answer
  • Aug 10, 2023 6:51 PM UTC

@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)
  • Aug 10, 2023 7:23 PM UTC

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

 

Sincerely, 

Deb Jensen