This is my code:
select max(vhis_data.C0432_SAMPL_VALUE1_R), vhis_data.C0401_aid
from vhis_data, T0401_accounts
where vhis_data.C0401_aid = T0401_accounts.C0401_aid
and (
vhis_data.c0401_aid between 1179 and 1291 or
vhis_data.c0401_aid between 1382 and 1402 or
vhis_data.c0401_aid between 1462 and 1620 or
# and so on until...
vhis_data.c0401_aid between 5450 and 5485 or
vhis_data.c0401_aid between 5503 and 5495 or
)
(these numbers represent various points in the system)
The program displayed an error:
vhis_data.c0401_aid between 1179 and 1291 or
*
ERROR at line 5:
ORA-00936: missing expression
What I've noticed is that the first part of the error references the first line in the
and ( ... ) part of my code.
I have also noticed that there is an extra or on the last line of my code. I can take it out, but is this extra or the only reason that the whole and (...) part does not work? Or is there another reason that my code is not working?
(I guess a sub-question of mine, then, is, if there is a missing expression, where does the code stop executing properly?)
For example, here, the missing expression is potentially the last line (because it is expecting something after the "or"). However, the code does not even go through the first line of the and (...) part of the code.
I have combed the net for explanations dealing with the error ORA-00936: missing expression but have not found anything relevant enough to help me in this particular situation.
I welcome any criticism or advice you may have, and thank you so much in advance for any contributions that you give me!
you should not end the whole thing with an or
5495 or
)
this makes the entire parenthetical phrase invalid - everything in the ()... so thats why the line number is flagged up top.
Could this extra or be the only reason that the whole and (...) part does not work?
It's the reason the whole query does not work.
A SQL query does not "execute" in order like a string of commands. The entire query is compiled, a plan built, and the plan executed. For that reason any syntax errors are often shown to point to lines that do not have the actual error.
So the "code" does not "execute" at all. The compilation fails, so there's nothing to execute.
Related
This is something I've wondered about for some time now, but only recently am I stuck on this. I am getting this error below when running my test in Mocha:
What does the (14:58) mean? I'm assuming it's the location of the syntax error, but how exactly do I read this in order to locate the error (for future reference)?
Thanks.
It means that node found something it couldn't handle at line 14, column 58 in core.spec.js. Note that the actual error that causes this could be located before this point if your syntax has logical errors.
Example:
if(foo === bar){
console.log('foo equals bar')}
} else { // <-- Unexpected token 'else', but error is on previous line
console.log('nope');
}
would trigger an error on line 3, column 3. But the actual error is the accidental extra ending curly bracket.
(But please, don't post images of code and terminal output. Text will do very well.)
I made a program that is similar to clearing RAM. However, it always leaves a "Done" message followed by a dotted line after being executed. In addition, if you scroll up, you can see that the program was executed. Is there a way to remove both of these things? If you can't hide the fact that a program was executed, could you suppress the 'Done' message?
I have tried adding ClearHome" and " as the last line of my program, and neither stops the Done message from displaying.
Bonus points if your solution can be contained within the original program.
In a separate program, type the following line of code:
AsmPrgmFDCB00AEC9
Then at the end of the original program, type the following line of code:
Asm(prgmPROGRAMNAME
It is recommended that you test this out first with all programs archived, just running the above line of code alone, in case it fails. Hex codes like that one have been known to fail, and sometimes clears the RAM.
You can also try these other hex codes, but always keep in mind the warning above. My RAM has been cleared by this before, so use caution:
http://tibasicdev.wikidot.com/hexcodes
This works on TI 83 and 84, may be different with other calculator types.
EDIT:
I found a way to do this without an external program, and is much simpler.
Just add the following line of code to the end of your program:
Output(1,1," //no space, just a quote
You may or may not have to add ClrHome before that line of code.
This should prevent the Done message from appearing at the end.
Hope this helps!
Put an empty string at the end of your program, so your last line looks like this:
""
Or this
"
The empty string is stored to ans and will be displayed as a blank line rather than the Done message.
There is also an assembly hexcode to do this without leaving the blank line at the top:
FDCB00AEC9
When run at the end of the program using one of the various methods of running assembly, it will leave you with a blank, fully operational homescreen.
Outputting an empty string will prevent the Done message and also preserve Ans, in case a calling program is expecting to use it.
Output(Y,X,"")
See http://tibasicdev.wikidot.com/output for more details on Output(.
In your situation, run Clear Entries (found under Mem), then scroll up so that the Done message is selected and press Clear to get rid of it.
It says there's an error operator expected. I know this syntax error is in line 5 but I can't figure it out. I have highlighted that line with ** thx.
action(X : Y,0 : Y):-X>0.
action(X : Y,X : 0):-Y>0.
action(X : Y,4:Y):-X<4.
action(X : Y,X : 3):-Y<3.
**action(X : Y,4 : Z):- X<4, Z is Y−(4−X), Z>=0.**
Path(X):-
path(0 : 0,[0 : 0],X).
Prolog predicate names must begin with a lower case letter. So as #CapelliC points out, Path(X) :0-... is going to be a problem.
But your syntax error on line 5 is because you copy/pasted this code from something online or from an eBook perhaps. In your expression, Y−(4−X) those − symbols are not minuses but something else that look like minuses (perhaps EM dashes). Try retyping line 5 manually, and the problem will go away.
This one is a problem:
Y−(4−X)
And this one is correct:
Y-(4-X)
There is actually a subtle difference in length of the dash you can see if you look closely. The second example is an actual dash or minus (ASCII code hex 2d). The first example of a dash is a special character (a hex dump shows a character code of 59 88 92). This is an issue with copy/pasting code from an eBook or other electronic document, since there are several characters used for visual convenience that aren't the specific one required by the language.
the error is the clause following
Path(X):-
...
should be
path(X):-
...
I am a bit new to PsychoPy and Python coding, so please excuse my question if it is basic. In my task, I have a number of files that dictate the position of stimuli. My outer loop has a variable, ExcelList, which has the previously mentioned file names listed under it. The inner loop, which dictates each trial, attempts to call these files at random by entering $ExcelList into the space asking for a conditions file. As I understand it, the command for $ExcelList should access the conditions file in the outer loop and pull one of the files containing stimuli positions for that trial. However, I am instead presented with the following error:
File "/Users/bencline/Desktop/Psychexp/NegPriming2080_lastrun.py",
line 247, in module>
trialList=data.importConditions(ExcelList), File "/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/data.py",
line 1366, in importConditions
raise ImportError('Conditions file not found: %s' %os.path.abspath(fileName)) ImportError: Conditions file not found:
/Users/bencline/Desktop/Psychexp/Trials_20_95.xlsx
It would appear that the inner loop is not finding the condition in the outer loop (or not reading the outer loop altogether). If I try instead writing $eval(ExcelList) I am presented with the following error:
File "/Users/bencline/Desktop/Psychexp/NegPriming2080_lastrun.py",
line 247, in
trialList=data.importConditions(eval(ExcelList)), File "", line 1, in NameError: name 'Trials_20_95' is not
defined
This seems more indicative of the underlying problem, but I'm still not sure how to proceed from here. Do you have any suggestions for why this is happening and how I could potentially fix it?
Thank you,
-Ben
Your strategy is right. It reads your ExcelList in the outer loop but fails to find the filenames in ExcelList on your filesystem. In particular, in your first error message, it fails to find /Users/bencline/Desktop/Psychexp/Trials_20_95.xlsx. So check whether it actually exists. I strongly suspect that it does not because of one or both of these:
It is in a different folder, e.g. a subfolder. The solution is to write out the path (relative or absolute) in the ExcelList file.
It is spelled differently, e.g. with a small T or capital postfix (XLSX), a spacebar or the like. The solution is of course to make the filenames in the ExcelList and the actual filenames match.
Recently I had to write an oracle function, and the error ora-06575 popped up awfully a lot.
Usually it was because of missing colon from assignment, such as: z = 5 (vs. z := 5)
Or a missed ';' at the end of a statement.
Anyway, I was able to create the function, but it failed during execution with that error, and gave no hint as to where the problem was (except that it was in the function).
I wrote same function in MSSQL and Sybase, and both of those actually tried to point me to the place of any errors. So I figure I'm doing something wrong in Oracle - it can't just tell me 'there's an error'.
In oracle I have a statement like this:
CREATE OR REPLACE
FUNCTION...
I'm compiling the function from SQL developer by selecting the function, and pressing F9.
When I select a statement which executes the function, and press F9, I get the ora-06575 error.
If I press F5 to compile the function, it tells me:
ORA-24344: success with compilation error
Compiled.
So I found this website: http://www.dba-oracle.com/t_ora_24344_success_with_compilation_error.htm
But I can't seem to run 'show errors'. When I run it, I get no output that I can see.
Can that only work from sqlplus? I'm using SQL developer, I'd prefer to stick to SQL developer.
Is there something I'm missing? I want it to tell me where the error is.
SHOW ERRORS is a sql*plus command
You can also query the USER_ERRORS view
SELECT line, position, text
FROM user_errors
WHERE name = '<<your_object_name>>'
SHOW ERRORS works in SQL*Developer too (at least in the versions I've used recently, certainly 3.1). You mentioned in a comment that you're connected as SYS, so I really hope you're creating your function explicitly in another schema - I'd avoid this anyway just in case you forget one day, and modifying any of the pre-built schemas (SYS, SYSTEM etc.) is a bad idea. If so you need to prefix the errored object with the schema too:
create or replace function my_schema.x return number is
begin
return sysdate;
end;
/
show errors my_schema.x
When run as a script (F5) this says:
FUNCTION X compiled
Warning: execution completed with warning
3/8 PLS-00382: expression is of wrong type
3/1 PL/SQL: Statement ignored
The first two lines of the output come from the function compilation, the last two from show errors. You can also run the two statements separately with F9 to see the same results.
But I'm not sure how you're getting the ORA-24344, so maybe you're on an earlier version; and it's possible that won't work. A.B.Cade's solution will work whatever your client though.