Using Global variable on grid sql statement

I have the following sql statement using the global variable [gvloc]
SELECT
ic.INVID,
ic.ICPRTFormat,
ic.ICVendorNum,
ic.ICPartNum,
inventory.PartNum,
inventory.description,
inventory.price1,
inventory.avgcost,
inventory.ptnum,
inventory.subptnum,
inventory.pcdesc,
inventory.subpcdesc,
qoh.qqoh,
vendor.name
FROM
ic LEFT OUTER JOIN vendor ON ic.ICVendorNum = vendor.vendornum
LEFT OUTER JOIN inventory ON ic.INVID = inventory.INVID
LEFT OUTER JOIN qoh ON (ic.INVID = qoh.qINVID and qoh.qlocnum = [gvloc]) order by ic.icprtformat

I get the following error
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\Program Files\NetMake\v7\wwwroot\scriptcase\app\rc_menu\ic_inq_grid\ic_inq_grid.php on line 503

Any help will be appreciated…

Try putting quotes around the global variable
I.E.
‘[gvloc]’

Kevin

I have same issue with SLADS, and I tried to put quotes around the global var, but it still does not works. Can anybody help ?

[QUOTE=Kdriscoll;15915]Try putting quotes around the global variable
I.E.
‘[gvloc]’

Kevin[/QUOTE]

Still get same results…

I’ve just had a solution and it let my code run :
In SQL Select Statement :
SELECT
ic.INVID,
ic.ICPRTFormat,
ic.ICVendorNum,
ic.ICPartNum,
inventory.PartNum,
inventory.description,
inventory.price1,
inventory.avgcost,
inventory.ptnum,
inventory.subptnum,
inventory.pcdesc,
inventory.subpcdesc,
my_view.qqoh
vendor.name
FROM
ic LEFT OUTER JOIN vendor ON ic.ICVendorNum = vendor.vendornum
LEFT OUTER JOIN inventory ON ic.INVID = inventory.INVID
LEFT OUTER JOIN my_view ON ic.INVID = my_view.qINVID order by ic.icprtformat

In SQL Preparation :

CREATE OR REPLACE VIEW my_view
AS
(
SELECT * FROM qoh WHERE qoh.qlocnum = [gvloc]
)

[QUOTE=thuann89;15918]I’ve just had a solution and it let my code run :
In SQL Select Statement :
SELECT
ic.INVID,
ic.ICPRTFormat,
ic.ICVendorNum,
ic.ICPartNum,
inventory.PartNum,
inventory.description,
inventory.price1,
inventory.avgcost,
inventory.ptnum,
inventory.subptnum,
inventory.pcdesc,
inventory.subpcdesc,
my_view.qqoh
vendor.name
FROM
ic LEFT OUTER JOIN vendor ON ic.ICVendorNum = vendor.vendornum
LEFT OUTER JOIN inventory ON ic.INVID = inventory.INVID
LEFT OUTER JOIN my_view ON ic.INVID = my_view.qINVID order by ic.icprtformat

In SQL Preparation :

CREATE OR REPLACE VIEW my_view
AS
(
SELECT * FROM qoh WHERE qoh.qlocnum = [gvloc]
)[/QUOTE]

I can’t seem to get this to work…

Hello,

Please contact our support regarding this issue. Our chat is active on workdays from 8:00am to 6:00pm (GMT -3), and our ticket system is always available.

regards,
Bernhard Bernsmann