syntax-error

(Oracle SQL) Catching a unique constraint error

心已入冬 提交于 2019-12-25 01:55:40
问题 This is my code: Declare violation_of_constraint EXCEPTION; BEGIN -- (A FEW INSERTS HERE: A, B, C) SAVEPOINT X; -- (ANOTHER INSERT HERE: D) IF DUP_VAL_ON_INDEX THEN ROLLBACK TO X; COMMIT; RAISE violation_of_constraint; END IF; EXCEPTION WHEN violation_of_constraint THEN DBMS_OUTPUT.PUT_LINE('Value already exists'); COMMIT; END; / When I run it (from the sql command line) I get this error at line 11: expression is of wrong type (line 11 is "IF DUP_VAL_ON_INDEX THEN") What could it be wrong?

Testing Catch Statements of a NFE

天大地大妈咪最大 提交于 2019-12-25 01:13:44
问题 Alright so I am an intro student in a programming class and I am trying to test a catch statement of a NFE. I don't know how to format the code properly, but here it is. import java.util.Scanner; public class Geo { public static void main(String[] args) { try { Scanner inp = new Scanner(System.in); System.out.print("Name?"); String name = inp.nextLine(); System.out.print("Number?"); double num = inp.nextDouble(); System.out.print("Integer?"); int num2 = inp.nextInt(); } catch

syntax error unexpected T_BOOLEAN_OR

岁酱吖の 提交于 2019-12-25 00:40:25
问题 I'm pretty sure its probably ( or ) that is causing it maybe one too many of them. $filechk1 = "/temp/files/" . $data[0] . ".doc"; $filechk2 = "/temp/files/" . $data[1] . ".doc"; $dirchk1 = "/temp/files/" . $batchid . "/" .$data[0] . ".doc"; $dirchk2 = "/temp/files/" . $batchid . "/" . $data[1] . ".doc"; if(is_file($filechk1) && (is_file($filechk2))) || (is_file($dirchk1) && (is_file($dirchk2))){ ... } 回答1: Incorrectly placed parentheses. Needs to be this. if ((is_file($filechk1) && is_file(

Python Google API writing to Google Sheet

穿精又带淫゛_ 提交于 2019-12-25 00:24:33
问题 I'm having trouble writing to Google Sheets using python and the Google API. Here is the code: import httplib2 import os from apiclient import discovery from oauth2client import client from oauth2client import tools from oauth2client.file import Storage try: import argparse flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args() except ImportError: flags = None # If modifying these scopes, delete your previously saved credentials # at ~/.credentials/sheets.googleapis.com

if in mysql insert statement

喜欢而已 提交于 2019-12-25 00:16:17
问题 I would like to do this kind of thing: IF ((19, 13) NOT IN (select idUtente, IdLezione from partecipa)) THEN insert into partecipa (IdUtente, IdLezione, IdAbbonamento, utente, prova, riserva) values( 19, 13, (select idAbbonamento from abbonamento where attivo=1 and idUtente=19), (select concat(u.nome," ",u.cognome) from abbonamento as a, utente as u where a.attivo=1 and a.idUtente=u.idUtente and u.idUtente=19), 0, 0) end if; but there is an error in the syntax Error Code: 1064. You have an

Efficiently find duplicate data property in object literal?

倖福魔咒の 提交于 2019-12-24 23:57:43
问题 After creating our new system in Vue with babel, I have started testing compatibility towards older devices. Our babel is transpiling the source down to es2015 together with webpack. I have now tested with browserstack against both Ios & android. Newer OS works on both platforms. However on android phones that use the default browser, I get an error in sentry stating; Duplicate data property in object literal not allowed in strict mode It does not give me any hints on where this might be thus

Non-Fatal Javascript Error?

南笙酒味 提交于 2019-12-24 20:25:15
问题 I think there's some kind of non-fatal bug in my script that's not allowing me to a/ debug the script with Firebug and b/ causes Firefox to constantly display a Connecting... (with the swirly) while I'm on the page. The script seems to run fine though. Any ideas what could cause that? <script type="text/javascript"> var xmlHttp; var xmlDoc; loadXMLFile(); function loadXMLFile() { xmlHttp = new window.XMLHttpRequest(); xmlHttp.open("GET", "myFile.xml", true); xmlHttp.onreadystatechange =

As3 flash error “Cannot access a property or method of a null object reference”

杀马特。学长 韩版系。学妹 提交于 2019-12-24 17:43:10
问题 im trying to do a couple of basic games on flash that consist in random numbers but im receiving this error every time i run my scene: TypeError: Error #1009: Cannot access a property or method of a null object reference. at capacitacion_fla::MainTimeline/frame1() TypeError: Error #1009: Cannot access a property or method of a null object reference. at capacitacion_fla::MainTimeline/frame1() at flash.display::MovieClip/gotoAndStop() at capacitacion_fla::MainTimeline/fl

As3 flash error “Cannot access a property or method of a null object reference”

断了今生、忘了曾经 提交于 2019-12-24 17:41:48
问题 im trying to do a couple of basic games on flash that consist in random numbers but im receiving this error every time i run my scene: TypeError: Error #1009: Cannot access a property or method of a null object reference. at capacitacion_fla::MainTimeline/frame1() TypeError: Error #1009: Cannot access a property or method of a null object reference. at capacitacion_fla::MainTimeline/frame1() at flash.display::MovieClip/gotoAndStop() at capacitacion_fla::MainTimeline/fl

Scheme Function (DrRacket)

喜夏-厌秋 提交于 2019-12-24 15:53:31
问题 So, i'm trying to write the following function in scheme, and to be able to run it on DrRacket. The problem is as follows, make5 - takes two integers, and returns a 5-digit integer constructed of the rightmost 3 digits of the first input, and the leftmost 2 digits of the second input. For example, (make5 561432 254) would return 43225. Negative signs on either input number should be ignored - that is, (make5 561432 -254) would also return 43225. If the first number has less than three digits