Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Unable to perform query using Oracle iSite


Unable to perform query using Oracle iSite

Author
Message
michelle.malone
michelle.malone
Forum Newbie
Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)Forum Newbie (3 reputation)

Group: General Forum Members
Points: 3 Visits: 3
The user can put in the following parameters and I'm trying to create an sql statement that would work for the parameters specified.
The :comp is company number; user can enter one company or 'all' which is 0
:year, :fprd, tprd should be self explanatory and
:ccty is for country; the supplier country and receiver company must be the same no matter what so the user can select a certain country or the can select 'all' which is 0

When I run the statement for 'all' on country then I get the records but if I select a country, the query gets an error. What am I doing wrong with this sql statement????

I am having problems with the following sql statement:
select ledger_account, supplier_country, receiver_country, supplier_number, supplier_name, supplier_invoice_number, purchase_order_number, tran_type_po, document_number_po, invoice_amount,
currency, invoice_amount_hc, vat_account_po, vat_amount_po, tran_type_app, document_number_app, vat_account_app, vat_amount_app
from ADTRAN.ad_vat_recon
where (finance_company = :comp or :comp=0)
and fiscal_year = :year
and fiscal_period between :fprd and :tprd
and (supplier_country = receiver_country and :ccty = 0 or
trim(supplier_country) = :ccty and trim(receiver_country) = :ccty)
Jo Pattyn
Jo Pattyn
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1595 Visits: 9733
Case sensitivity? (collaction/Oracle case sensitivity)
Mix of datatypes? trim(x)=:comp -> characters? :comp=0 -> number?

Why is the trim added in the last line?
You have supplier_country = receiver_country and :ccty = 0 (without trim)
and then suddenly trim(supplier_country) = :ccty and trim(receiver_country) = :ccty
-> supplier_country = receiver_country and supplier_country=trim(:ccty) ?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search