Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

return single row from SQL command

Status
Not open for further replies.

twigs1981

IS-IT--Management
May 29, 2002
52
US

I have the following code:

SQLEXEC(PSI, 'SELECT pci_seg1,pci_seg2,pci_seg3,pci_seg4,pci_seg5,';
+'pci_seg6,pci_seg7,dock_code,drop_zone,';
+'kanban_no, release_no ';
+'from v_csf_job_Packing ';
+'where docno=?OrderNum and partno=?partno' , 'Packing')

select Packing


but when I go to do:

pci_seg1=alltrim(packing.pci_seg1)
pci_seg2=alltrim(packing.pci_seg2)
pci_seg3=alltrim(packing.pci_seg3)
pci_seg4=alltrim(packing.pci_seg4)
pci_seg5=alltrim(packing.pci_seg5)
pci_seg6=alltrim(packing.pci_seg6)
pci_seg7=alltrim(packing.pci_seg7)
dock_code=alltrim(packing.dock_code)
drop_zone=alltrim(packing.drop_zone)
kanban_no=alltrim(packing.kanban_no)
releasenum=alltrim(packing.release_no)


a row doesn't appear to be returned.. however if I browse it and select the row(that matchs my query) it works fine... is there anyway I can get the same results without having to have the user select the row?

thanx!
 
I'd start by double checking to make sure your values for 'OrderNum' and 'partno' are the same length and case (upper/lower) as those in your table. The fact that 'partno' is also spelled the same as the field you are checking is troubling.

Rick
 
well they are the same length(since the field is only 1 character) and I don't need to worry about casing since it is a number... I tried changing the varible name... same results...

I can do the exact same query as shown but if I use browse I can see the row(and it is right) and when I trim them I get the correct values....but when I try to access each column in the row and trim them without using browse I get no values...

this even happens when I use a literal value in the query
 
aight I tried to recreate the browse incident... and now it doesn't do it... I'm so lost... thanx anyways
 
aight you win.. it was a different length in the database.. the admin mis informed me a simple rtrim(partno) did it... thanx for bringint it to my attention.. now I get to have a "talk" with the admin... hehe...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top