ACUMATICA BQL QUERIES - acumatica

I need to return records from the database using BQL. I have tried writing the BQL query like this
TaxZone zone = PXSelectJoin<TaxZone, InnerJoin<LocationExtAddress, On<TaxZone.taxZoneID, Equal<LocationExtAddress.cTaxZoneID>>, InnerJoin<Customer, On<Customer.bAccountID, Equal<LocationExtAddress.bAccountID>>, Where<Customer.bAccountID, Equal<Current<Customer.BAccountID>>>;
and I get errors
\App_RuntimeCode\SOOrderEntry.cs(387): error CS1002: ; expected
\App_RuntimeCode\SOOrderEntry.cs(387): error CS1525: Invalid expression term '<'
\App_RuntimeCode\SOOrderEntry.cs(387): error CS1002: ; expected
\App_RuntimeCode\SOOrderEntry.cs(387): error CS1002: ; expected
\App_RuntimeCode\SOOrderEntry.cs(387): error CS1525: Invalid expression term ','
\App_RuntimeCode\SOOrderEntry.cs(387): error CS1002: ; expected
\App_RuntimeCode\SOOrderEntry.cs(387): error CS1002: ; expected
\App_RuntimeCode\SOOrderEntry.cs(387): error CS1525: Invalid expression term ','
\App_RuntimeCode\SOOrderEntry.cs(387): error CS1002: ; expected
\App_RuntimeCode\SOOrderEntry.cs(387): error CS1002: ; expected
\App_RuntimeCode\SOOrderEntry.cs(387): error CS1525: Invalid expression term ','
\App_RuntimeCode\SOOrderEntry.cs(387): error CS1002: ; expected
\App_RuntimeCode\SOOrderEntry.cs(387): error CS1002: ; expected
\App_RuntimeCode\SOOrderEntry.cs(387): error CS1525: Invalid expression term ','
\App_RuntimeCode\SOOrderEntry.cs(387): error CS1002: ; expected
\App_RuntimeCode\SOOrderEntry.cs(387): error CS1002: ; expected
I have also tried using one DAC like this
Customer cust = PXSelect<Customer, Where<Customer.bAccountID, Equal<Current<Customer.bAccountID>>>;
I am still getting the error
\App_RuntimeCode\SOOrderEntry.cs(383): error CS1002: ; expected
\App_RuntimeCode\SOOrderEntry.cs(383): error CS1525: Invalid expression term '<'
\App_RuntimeCode\SOOrderEntry.cs(383): error CS1002: ; expected
\App_RuntimeCode\SOOrderEntry.cs(383): error CS1002: ; expected
\App_RuntimeCode\SOOrderEntry.cs(383): error CS1525: Invalid expression term ','
\App_RuntimeCode\SOOrderEntry.cs(383): error CS1002: ; expected
\App_RuntimeCode\SOOrderEntry.cs(383): error CS1525: Invalid expression term '>'
\App_RuntimeCode\SOOrderEntry.cs(383): error CS1002: ; expected
Compiler time, in seconds: 21.1134712
Any help on the issue would be really appreciated because I have gone through the documentation, that is the format that is supporsed to be written

TaxZone zone = PXSelectJoin<TaxZone, InnerJoin<LocationExtAddress, On<TaxZone.taxZoneID, Equal<LocationExtAddress.cTaxZoneID>>, InnerJoin<Customer, On<Customer.bAccountID, Equal<LocationExtAddress.bAccountID>>>>, Where<Customer.bAccountID, Equal<Current<Customer.bAccountID>>>>.Select(graph);
To Construct BQL Statements

Related

syntax error: unexpected end of file in for loop

I have a very large script, and I'm trying to introduce a for loop.
To test that I have the right syntax, at line 120 say, I have:
for M in "1 2 3 4"; do
echo $M
end
However I get the error:
./script.sh: line 120: syntax error: unexpected end of file
Even more worryingly, I get the same if I run:
for M in $( ls ); do
echo $M
end
What am I doing wrong here?
You need to use done not end to finish a for loop

Error while viewing a pdf file using latex-suite in macVim

I get this error after typing lv for viewing the pdf file in macVim.
Note: after compiling it (with ll) without any problem:
Error detected while processing function Tex_ViewLaTeX:
line 34:
E121: Undefined variable: s:viewer
E116: Invalid arguments for function strlen(s:viewer)
E15: Invalid expression: strlen(s:viewer)
line 39:
E121: Undefined variable: appOpt
E15: Invalid expression: 'open '.appOpt.s:viewer.' $.'.s:target
line 79:
E121: Undefined variable: execString
E116: Invalid arguments for function substitute(execString, '\V$', mainfname, 'g
')
E15: Invalid expression: substitute(execString, '\V$*', mainfname, 'g')
line 80:
E121: Undefined variable: execString
E116: Invalid arguments for function Tex_Debug
line 82:
E121: Undefined variable: execString
E15: Invalid expression: 'silent! !'.execString
I already defined the pdf viewer in the .vimrc file with
let g:Tex_ViewRule_pdf = 'open -a Preview'
Also tried treating macUnix as Unix with
let g:Tex_TreatMacViewerAsUNIX = 1
Looking at the source code, it seems that the lv function launches the dvi viewer, not the pdf-viewer.
If you want to preview a dvi file, you should have XQuartz installed, and then you can define
let g:Tex_ViewRule_dvi = 'open -a xdvi'
If you want to preview a pdf file with MacVim, you should define a new viewer command altogether, which I don't think can be done without changing the source code.

Bash function call error

I need some help in Bash function while passing arguments. I need to pass arguments into SQL query in Bash but I am getting error message.
#!/bin/bash --
whw='mysql -uroot -proot -habczx.net'
function foo() {
for v in "$#"; do
eval "$v"; # line 9
echo "${v}";
done
${whw} -e"select id, idCfg, idMfg, $DATE from tblMfg"
}
foo DATE="curdate()"
Below is the error message I get:
$ sh test4.sh
test4.sh: eval: line 9: syntax error near unexpected token `('
test4.sh: eval: line 9: `DATE=curdate()'
test4.sh: line 9: warning: syntax errors in . or eval will cause future versions of the shell to abort as Posix requires
DATE=curdate()
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'from tblMfg limit 4' at line 1
==
If I change in function call to below I do not get any error message:
foo DATE="2014-12-21"
==
Any help?
Thanks!
The problem is the evaluated expression. You can see that by typing it:
$ DATE=bla()
-bash: syntax error near unexpected token `('
If you put it in quotes, it will work:
$ DATE="bla()"
In order to pass the quotes to the eval, they need to be protected from evaluation at callsite:
foo 'DATE="curdate()"'
should do the trick.
BTW: this is rather dangerous to eval a string, especially if the arguments are from untrusted users, one could use foo "rm -rf /" :)
I am not sure why you need the eval, instead of $DATE you could also use $1 and then
${whw} -e"SELECT ... $1...."
foo "curdate()"

antlr4 mismatch input error on sql parser

I am getting following error on parsing but not sure why it's happening.
line 1:24 mismatched input '1' expecting NUM
line 1:24 mismatched input '1' expecting NUM
select a from abc limit 1 ;
--
grammar SQLCmd;
parse : sql
;
sql : ('select' ((columns (',' columns))|count) 'from')
tables
('where' condition ((and|or) condition))* (limit)? ';'
;
limit : 'limit' NUM
;
num : NUM
;
count : 'count(*)'
;
columns : VAL
;
tables : VAL
;
condition : ( left '=' right )+
;
and : 'and'
;
or : 'or'
;
left : VAL
;
right : VAL
;
VAL : [*a-z0-9A-Z~?]+
;
NUM : [0-9]+
;
WS : [ \t\n\r]+ -> skip
;
It looks like you have a VAL instead of a NUM.
The "1" is both a VAL and a NUM but since VAL comes first, there will never be NUM tokens since every NUM will be a VAL.
Try putting the NUM rule before the VAL rule.
You could have found out this by yourself by looking at the token types from the lexer. This will tell you the actual type of the token that is present.
#TheAntlrGuy: Maybe one could add the actual token type to the error message?

Modifiying j2me midlet

I want to change some strings in opensource app ( testing purpose ). So I decompiled my app using jad decompiler.
Original class file http://dl.dropbox.com/u/32657135/YourTube.class
issued command Jad.exe Yourtube.jar.java
Got jad as output http://dl.dropbox.com/u/32657135/YourTube.jad.java
Compiling Code Again with no modification
command in cmd javac Yourtube.jar.java
Error
YourTube.jad.java:57: error: ';' expected
JVM INSTR monitorenter ;
^
YourTube.jad.java:57: error: not a statement
JVM INSTR monitorenter ;
^
YourTube.jad.java:59: error: not a statement
this;
^
YourTube.jad.java:66: error: ';' expected
JVM INSTR monitorenter ;
^
YourTube.jad.java:66: error: not a statement
JVM INSTR monitorenter ;
^
YourTube.jad.java:68: error: not a statement
this;
^
6 errors
I want to know, why I am getting this error on recompiling. Is there anything wrong I am doing?

Resources