Please help me formulate this in PL/SQL - Thanks.
Hi ALL,
Please help me formulate this in PL/SQL. I really appreciate your help in advance. Below is the Specification.
Read Previous records
Check if this is a New Customer.
If New
Than check for New site
If New Site than Insert Site
End If
Insert Practice
Insert Customer
Check for Previous Months Balance for that Customer.
If there than (formula)
Else
set balance = 0
End if
Insert balance.
Thanks Much in adavance.
Hi ALL,
Please help me formulate this in PL/SQL. I really appreciate your help in advance. Below is the Specification.
Read Previous records
Check if this is a New Customer.
If New
Than check for New site
If New Site than Insert Site
End If
Insert Practice
Insert Customer
Check for Previous Months Balance for that Customer.
If there than (formula)
Else
set balance = 0
End if
Insert balance.
Thanks Much in adavance.
Similar Messages
-
PLEASE help me with this error java.sql.SQLException
The code
public void getInitialQuery() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con = DriverManager.getConnection("jdbc:odbc:PDefApp1"); sta = con.createStatement(); System.out.println(SQLQuery); res = setupSQLConnection(SQLQuery); getRecordSet(res);
private void getRecordSet(ResultSet r) { try { jTextRecordNumberField.setText(String.valueOf(r.getInt("id"))); jTextFirstNameField.setText(r.getString(2)); jTextMiddleNameField.setText(r.getString(3)); jTextLastNameField.setText(r.getString(4)); jTextDateOfBirthField.setText(r.getString(5)); jTextAKAField.setText(r.getString(6)); jComboBoxChargingDocument.setSelectedItem(r.getString(7)); jTextAreaChargingNumber.setText(r.getString(8)); jComboBoxDecision.setSelectedItem(r.getString(9)); jComboBoxDefendentStatus.setSelectedItem(r.getString(10)); jComboBoxOriginatingUnit.setSelectedItem(r.getString(11)); jTextFieldApplicationDate.setText(r.getString(12)); jTextFieldDecisionDate.setText(r.getString(13)); jTextFieldDeliveryDate.setText(r.getString(14)); jTextAreaComments.setText(r.getString(15)); } catch (Exception e) { System.err.println("getRecordSet Exception: " + e.getMessage()); e.printStackTrace(); } }
The crash occurs in getRecordSet(ResultSet r) method and it occurs on ANY line. I've commented each line to see where it occurs.
The crash says the following
run: SELECT * FROM Table1 ORDER BY id ASC setupSQLQuery: SELECT * FROM Table1 ORDER BY id ASC getRecordSet Exception: [Microsoft][ODBC Driver Manager] Invalid cursor state java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957) at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114) at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3907) at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:5698) at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:354) at publicdesktopapplication.PublicDesktopView.getRecordSet(PublicDesktopView.java:1411) at publicdesktopapplication.PublicDesktopView.getInitialQuery(PublicDesktopView.java:1377) at publicdesktopapplication.PublicDesktopView.<init>(PublicDefenderView.java:89) at publicdesktopapplication.PublicDesktopApplication.startup(PublicDesktopApplication.java:19) at org.jdesktop.application.Application$1.run(Application.java:171) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:597) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160) at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
I am very confused why this is crashing on me. It didnt crash in the older version of this application.
Please help!Don't do this either
SELECT * FROM Table1 Explictly name the columns in the order that you are going to fetch them. This makes your code easier to follow later and as side benefit prevents any changes in the column ordering from blowing your code to smitheens.
And I do hope your table is not in fact called Table1. -
Please help me with this calculation script
Hello everyone.
I have 2 fields named A and B. FieldA is user-enter value and FieldB is calculated. I want to write a script that do the following:
If FieldA is more than or equal to $10000, then FieldB always is $1000, Else FieldB = FieldA * 10%.
I don't know about scripting; however, after hour of search through google, I wrote this one:
var tvar
If (tvar >= 10000)then deposit.value = 1000
else deposit.value = total.rawValue*0.01
endif
And when I try to run, it say "Invalid Property Set Operation, value doesn't have a default property."
I know my script is bad and over the place. Can anyone please help me with this problem ASAP. Thank you so much, I'm in your debt.
I used Adobe LiveCycle Designer to create a PDF file.Thank you for your response.
tvar = total
At first I wrote it like this:
If (total.rawValue >= 10000)then deposit.rawvalue = 1000
else deposit.rawvalue = total.rawValue*0.01
endif
then I get an error message "accessor 'Total.rawValue' is unknown"
Hic, I think my script is screwed. Can you help me start fresh :)
Thank again. -
Please help me with this SQL query
I am practicing SQL queries and have come across one involving fetching data from 3 different tables.
The three tables are as below
<pre>
Country
location_id country
loc1 Spain
loc2 England
loc3 Spain
loc4 USA
loc5 Italy
loc6 USA
loc7 USA
</pre>
<pre>
User
user_id location_id
u1 loc1
u2 loc1
u3 loc2
u4 loc2
u5 loc1
u6 loc3
</pre>
<pre>
Post
post_id user_id
p1 u1
p2 u1
p3 u2
p4 u3
p5 u1
p6 u2
</pre>
I am trying to write an SQL query - for each country of users, display the average number of posts
I understand the logic behind this that we first need to group together all the locations and then the users belonging to one country and then find the average of their posts.
But, i'm having a difficulty in putting this in SQL form. Could someone please help me with this query.
Thanks.select
country.country,
count(*) Totalpostspercountry,
count(distinct post.user_id) Totaldistincuserspercountry,
count(*)/count(distinct post.user_id) Avgpostsperuserbycountry
from
country, muser, post
where country.location_id = muser.location_id
and muser.user_id = post.user_id
group by country.country
The output is like this for your sample data - hope this is what you were looking for :)
COUNTRY,TOTALPOSTSPERCOUNTRY,TOTALDISTINCUSERSPERCOUNTRY,AVGPOSTSPERUSERBYCOUNTRY
England,1,1,1,
Spain,5,2,2.5, -
In my A/P credit memo screen i have incorporated a column for adding reference to closed A/P Invoices. upon filling this field with DocNum of APInvoice certain other fields also get filled from an SQL query. One among them is the TaxCode. My problem is that the TaxAmount(LC) field at the last row of the matrix is not filled with the appropriate value, it remains 0. On trying to add the document or pressing the link button on the TaxAmount field a status bar error message pops up showing, 'Tax data is missing ArrayOffset 12, srcLineNum 0, srcGroupNum -1'.
Please Help me solve this issue.
Thanks in Advance
RajeevHi,
Please check SAP note:
1860926 - When updating a Purchase Order via DI API "-12109 Tax data
is missing..." Error occurs
Thanks & Regards,
Nagarajan -
Urgent, Please help me in this problem.I am getting problem while installation
I am using Windows 8 in my system. I am trying to install Sql Server in system . Everything is fine, but finally when i click on install button i am getting the following error .
please help me quickly. I well be thankful to you.Triple post meanwhile:
http://social.msdn.microsoft.com/Forums/en-US/7fafa499-ca1e-42f7-a117-73df924d9847/urgent-please-help-me-in-this-problemi-am-getting-problem-while-installation?forum=sqlsetupandupgrade
http://social.msdn.microsoft.com/Forums/en-US/a1c7978c-2f84-495f-a8b6-9e9fe46654d7/getting-problem-while-installing-sql-server-2012?forum=sqlsetupandupgrade
Olaf Helper
[ Blog] [ Xing] [ MVP] -
Please help me with this statement
Hi gurus, glad to be back!
Please help me with this XML processing statement. The XMl I get is like this,
<EnumerationValue description="Motor Carriers-Operate w/o Certificate or Permit"
effectiveDate="1859-01-01">
<Text>26</Text>
<AssociatedValue type="SeverityLevelText" code="MSD">
<Text>Misdemeanor</Text>
</AssociatedValue>
<AssociatedValue type="SeverityLevelText" code="PMD">
<Text>Petty Misdemeanor</Text>
</AssociatedValue>
<AssociatedValue type="StatuteOrdinanceRuleCite">
<Text>221.291.4</Text>
</AssociatedValue>
I need to get the number value from <Text>26</Text>, the attribute description and the text value of <Text>221.291.4</Text> inside one of those AssociatedValue node. The following is what I have, though I get the 26, I do not get the description and I get the Misdemeanor, Petty Misdemeanor concatenated with the text value of <Text>221.291.4</Text>. The output I get is this,
26
MisdemeanorPetty Misdemeanor221.291.4MisdemeanorPe
4
MisdemeanorPetty Misdemeanor221.291.4MisdemeanorPe
My Code:
declare
v_xml sys.xmltype;
v_sid number;
v_SText varchar2(50);
begin
v_xml := sys.xmltype('<SimpleTypeCompanion>
<EnumerationValue description="Motor Carriers-Operate w/o Certificate or Permit" effectiveDate="1859-01-01">
<Text>26</Text>
<AssociatedValue type="SeverityLevelText" code="MSD">
<Text>Misdemeanor</Text>
</AssociatedValue>
<AssociatedValue type="SeverityLevelText" code="PMD">
<Text>Petty Misdemeanor</Text>
</AssociatedValue>
<AssociatedValue type="StatuteOrdinanceRuleCite">
<Text>221.291.4</Text>
</AssociatedValue>
</EnumerationValue>
<EnumerationValue description="Police Communication Equipment-Possession, Use-First Offense-M" effectiveDate="1859-01-01">
<Text>4</Text>
<AssociatedValue type="SeverityLevelText" code="MSD">
<Text>Misdemeanor</Text>
</AssociatedValue>
<AssociatedValue type="SeverityLevelText" code="PMD">
<Text>Petty Misdemeanor</Text>
</AssociatedValue>
<AssociatedValue type="StatuteOrdinanceRuleCite">
<Text>299C.37.1(b)</Text>
</AssociatedValue>
</EnumerationValue>
</SimpleTypeCompanion>');
---dbms_output.put_line(v_xml.getStringVal());
declare
cursor c_statutes is
select ms.* from
xmltable('for $s in /SimpleTypeCompanion/EnumerationValue/Text
let $sa := /SimpleTypeCompanion/EnumerationValue/AssociatedValue
let $sd := /SimpleTypeCompanion/EnumerationValue/@description
where $sa/@type = "StatuteOrdinanceRuleCite"
return
<MyStatutes>
<TextID>{$s}</TextID>
<SDesc>{$sd/@description}</SDesc>
<StatuteNumber>{$sa/Text}</StatuteNumber>
</MyStatutes>'
passing v_xml
columns
myTextID number path '/MyStatutes/TextID',
mySDesc varchar2(150) path '/MyStatutes/SDesc',
myStatute varchar2(50) path '/MyStatutes/StatuteNumber'
) ms;
begin
for v_s in c_statutes loop
dbms_output.put_line(v_s.myTextID);
dbms_output.put_line(v_s.MySDesc);
dbms_output.put_line(v_s.myStatute);
end loop;
end;
end;
Please show me the correct way to get the result I want.
Thanks a lot!
BenSQL> var xmltext varchar2(4000)
SQL> --
SQL> begin
2 :xmltext :=
3 '<SimpleTypeCompanion>
4 <EnumerationValue description="Motor Carriers-Operate w/o Certificate or Permit" effectiveDate="1859-01-01">
5 <Text>26</Text>
6 <AssociatedValue type="SeverityLevelText" code="MSD">
7 <Text>Misdemeanor</Text>
8 </AssociatedValue>
9 <AssociatedValue type="SeverityLevelText" code="PMD">
10 <Text>Petty Misdemeanor</Text>
11 </AssociatedValue>
12 <AssociatedValue type="StatuteOrdinanceRuleCite">
13 <Text>221.291.4</Text>
14 </AssociatedValue>
15 </EnumerationValue>
16 <EnumerationValue description="Police Communication Equipment-Possession, Use-First Offense-M" effectiveDate="1859-01-01">
17 <Text>4</Text>
18 <AssociatedValue type="SeverityLevelText" code="MSD">
19 <Text>Misdemeanor</Text>
20 </AssociatedValue>
21 <AssociatedValue type="SeverityLevelText" code="PMD">
22 <Text>Petty Misdemeanor</Text>
23 </AssociatedValue>
24 <AssociatedValue type="StatuteOrdinanceRuleCite">
25 <Text>299C.37.1(b)</Text>
26 </AssociatedValue>
27 </EnumerationValue>
28 </SimpleTypeCompanion>';
29 end;
30 /
PL/SQL procedure successfully completed.
SQL> set lines 150
SQL> --
SQL> select ms.*
2 from xmltable
3 (
4 '/SimpleTypeCompanion/EnumerationValue'
5 passing xmltype(:xmltext)
6 columns
7 DESCRIPTION varchar2(32) path '@description',
8 STATUTE_ID number(2) path 'Text/text()',
9 STATUTE_RULE_CITE varchar2(16) path 'AssociatedValue[@type="StatuteOrdinanceRuleCite"]/Text/text()',
10 MSD_TEXT varchar2(10) path 'AssociatedValue[@code="MSD"]/Text/text()',
11 PMD_TEXT varchar2(10) path 'AssociatedValue[@code="PMD"]/Text/text()'
12 ) ms
13 /
DESCRIPTION STATUTE_ID STATUTE_RULE_CIT MSD_TEXT PMD_TEXT
Motor Carriers-Operate w/o Certi 26 221.291.4 Misdemeano Petty Misd
Police Communication Equipment-P 4 299C.37.1(b) Misdemeano Petty Misd
SQL>
SQL> -
Please help to modifiy this query for better performance
Please help to rewrite this query for better performance. This is taking long time to execute.
Table t_t_bil_bil_cycle_change contains 1200000 rows and table t_acctnumberTab countains 200000 rows.
I have created index on ACCOUNT_ID
Query is shown below
update rbabu.t_t_bil_bil_cycle_change a
set account_number =
( select distinct b.account_number
from rbabu.t_acctnumberTab b
where a.account_id = b.account_id
Table structure is shown below
SQL> DESC t_acctnumberTab;
Name Type Nullable Default Comments
ACCOUNT_ID NUMBER(10)
ACCOUNT_NUMBER VARCHAR2(24)
SQL> DESC t_t_bil_bil_cycle_change;
Name Type Nullable Default Comments
ACCOUNT_ID NUMBER(10)
ACCOUNT_NUMBER VARCHAR2(24) YIshan's solution is good. I would avoid updating rows which already have the right value - it's a waste of time.
You should have a UNIQUE or PRIMARY KEY constraint on t_acctnumberTab.account_id
merge rbabu.t_t_bil_bil_cycle_change a
using
( select distinct account_number, account_id
from rbabu.t_acctnumberTab
) t
on ( a.account_id = b.account_id
and decode(a.account_number, b.account_number, 0, 1) = 1
when matched then
update set a.account_number = b.account_number -
Question
I am not able to launch FF everytime i try to open it, it says FF has to submit a crash report,and restore yr tabs. I even tried doing that and the report was submitted too, but still FF did not start, and the problem still persists, please help me solve this issue
'''(in English)'''Hi Danny,
Per my understanding that you can't get the expect result by using the expression "=Count(Fields!TICKET_STATUS.Value=4) " to count the the TICKET_STATUS which value is 4, the result will returns the count of all the TICKET_STATUS values(206)
but not 180, right?
I have tested on my local environment and can reproduce the issue, the issue caused by you are using the count() function in the incorrect way, please modify the expression as below and have a test:
=COUNT(IIF(Fields!TICKET_STATUS.Value=4 ,1,Nothing))
or
=SUM(IIF(Fields!TICKET_STATUS=4,1,0))
If you still have any problem, please feel free to ask.
Regards,
Vicky Liu
Vicky Liu
TechNet Community Support -
hello,
i restored and updated my iphone 4 to the latest version of 5.1.1 and after that when i connect my mobile to i tunes all i see is a big rectangle and a apple logo on left and a small lock on right side please help me fix this problem.I sloved this issue by resting my phone from settings>general>reset>reset all settings...the problem will be fixed
-
I just bought this movie "Godzilla 2014" but it won't show in my Movie Library. I closed my Itunes and put it back on again but still won't show up. I checked my purchased list and it shows that I recently bought the movie but when I checked the itunes store it wants to buy the movie again. Please help me with this right away Apple.
Apple Store Customer Service at 1-800-676-2775 or visit online Help for more information.
To contact product and tech support: Contacting Apple for support and service - this includes
international calling numbers..
For Mac App Store: Apple - Support - Mac App Store.
For iTunes: Apple - Support - iTunes. -
My icloud activation lock is on my iphone, which requires an activation login to access the homescreen, but when i log in with the apple ID on the phone, it says the apple ID is not meant to unclock this iphone 5 ios 8.0.2. please help me solve this.
Yes the phone belongs to me. It was purchased from United Kingdom Vodafone to West Africa, i had to factory unlock to use any sim in it. so it belongs to me. I did the activation myself, now after updating my iphone to the latest update, it required a user id and password to activate the phone, but anytime i enter the details, it tells me the user Id is not correct but the password is correct..
-
Hello Team,
I have upgraded My leopard to Mountain lion 10.7 via snow leapeard. Now My itunes is not working properly nor I able to install google chrome successfully. Please help me in this occasion.
Also, I am not being able to upgrade Mac OS X 10.7 to 10.7.4 or letest for lion.
I am facing following messages when I open itunes ( I down loaded and install new for 10.7)
Process: iTunes [463]
Path: /Applications/iTunes.app/Contents/MacOS/iTunes
Identifier: com.apple.iTunes
Version: 10.7 (10.7)
Build Info: iTunes-10702101~1
Code Type: X86-64 (Native)
Parent Process: launchd [273]
Date/Time: 2012-10-22 23:33:07.226 +0200
OS Version: Mac OS X 10.7 (11A390)
Report Version: 8
Interval Since Last Report: 4918 sec
Crashes Since Last Report: 2
Per-App Crashes Since Last Report: 2
Anonymous UUID: 3DE933E2-7A48-4840-91F4-7DC466ED9C26
Crashed Thread: 0
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Application Specific Information:
dyld: launch, loading dependent libraries
@executable_path/../Frameworks/iPodUpdater.framework/Versions/A/iPodUpdater
Dyld Error Message:
Library not loaded: @executable_path/../Frameworks/iPodUpdater.framework/Versions/A/iPodUpdater
Referenced from: /Applications/iTunes.app/Contents/MacOS/iTunes
Reason: unsafe use of @executable_path in /Applications/iTunes.app/Contents/MacOS/iTunes with restricted binary
Binary Images:
0x102a96000 - 0x103c36fff com.apple.iTunes (10.7 - 10.7) <0CC47E12-134F-A9E1-7E4F-3EAC797C3050> /Applications/iTunes.app/Contents/MacOS/iTunes
0x7fff62696000 - 0x7fff626cb1ff dyld (195 - ???) <71093406-21CF-3DBE-A001-802259ED5300> /usr/lib/dyld
Model: MacBook4,1, BootROM MB41.00C1.B00, 2 processors, Intel Core 2 Duo, 2.4 GHz, 2 GB, SMC 1.31f1
Graphics: Intel GMA X3100, GMA X3100, Built-In, 144 MB
Memory Module: BANK 0/DIMM0, 1 GB, DDR2 SDRAM, 667 MHz, 0xAD00000000000000, 0x48594D503131325336344350362D59352020
Memory Module: BANK 1/DIMM1, 1 GB, DDR2 SDRAM, 667 MHz, 0xAD00000000000000, 0x48594D503131325336344350362D59352020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x88), Broadcom BCM43xx 1.0 (5.10.131.36.5)
Bluetooth: Version 2.5.0b13, 2 service, 12 devices, 2 incoming serial ports
Network Service: AirPort, AirPort, en1
Serial ATA Device: FUJITSU MHY2160BH, 160.04 GB
Parallel ATA Device: MATSHITADVD-R UJ-867
USB Device: Built-in iSight, apple_vendor_id, 0x8501, 0xfd400000 / 2
USB Device: USB Receiver, 0x046d (Logitech Inc.), 0xc52f, 0x1d100000 / 2
USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x8205, 0x1a100000 / 2
USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x022a, 0x5d200000 / 3
USB Device: IR Receiver, apple_vendor_id, 0x8242, 0x5d100000 / 2
And Google chrome just keep loading the page for hours and nothing is appear on its browser. But safari and firefox working absolutly fine.
In addition, I have reboot computer as well but it never worked. Please help me in this occasion.
Eagerly waiting for your response on this issue.
Best Regards,You need to upgrade your copy of MS Office. You're using a version that is 8 years old (at least). You can buy Office 2011, which will work. You could also get a copy of Pages from the App Store, which is cheaper and will open Word files (though not perfectly). Or you could get a free Office clone, like OpenOffice or LibreOffice.
-
My iPad 1 doesn't stay logged on. It stays @ 3 seconds.this has been happening for a week s I deleted that app, & downloaded another, same one & STILL won't stay opened on page. Please help me figure this out. Very much appreciated. Thank you, Connie Sypriano
There's a whole lot to read in your post, and frankly I have not read it all.
Having said that, this troubleshooting guide should help:
http://support.apple.com/kb/TS1538
In particular, pay attention to the mobile device support sections near the bottom, assuming you have already done the items above it. -
My safari keeps closing unexpectedly and when it does it tells me that it quite while using the .GameHouseBeachParty.so plugin. I have no idea what this means! Can someone please help me fix this?
You have the Flashback trojan.
Check out the replies in this thread for what to do;
https://discussions.apple.com/message/18114958#18114958
Maybe you are looking for
-
S.M.A.R.T and SATA?
I have just installed a new SATA HDD on a KT6 Delta-LSR. The drive is identified correctly by the VIA SATA BIOS, however there are no messages that S.M.A.R.T is enabled and working (although it is enabled in the AMI BIOS). I have read in the motherbo
-
Hi, We are using the ECC 5.0. I want to reset one cleared document. I used T.Code FBRA. Normally it will give 3 options like "Resetting & Reverse" "Resetting only" & "Cancel". But here I am not getting all the three options. Instead systems is
-
Drop Down Menu not functioning
I'm very VERY new to dreamweaver/fireworks but have been making small changes to multipul websites for a company. They have asked me to come up with a totally new design for their primary webpage and I'm having an issue with the drop-down menu. I'm c
-
Storing MS Word, MS Excel, PDF, etc in DB and retrieving through WebForms
Hi, We have an application that requires storing MS Word, MS Excel, PDF and HTML docs. We're planning on storing these documents in a table as BLOB's with a column in the table that would indicate the MIME type for the document. We need to be able to
-
Lost my iphone. I dont have mobile me and I dont have find iphone. Is there a way of finding it? Thank you.