Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
I need a way to run an SPT statement(AS400) and then use the result to run a second SPT.
For example: I am looking for hardware that is listed by several base numbers. Each base number has multiple lines for a description so one pass through won't get the result I need. Say my parameter is 'SCREW'. I run the first SPT to get all the base numbers that have screw in the description. Then I need to take these numbers and do a second SPT to get the multiple records that go with these numbers.
Right now I can get this second SPT to work provided it only has a few numbers to look at. This is because of the string limitation. What I do is loop through the first result creating a string "'WAXXX' Or 'WAXX1' Or 'WAXX2' Or 'WAXX3'" etc. I then use this in my SPT as this:
= SQLPREPARE(gnHandle1, "Select * From wamtxt Where &mfrt2b", 'mySeeThis1')
I need a way to break this string into smaller strings which I know how to do with separate variables but not a single string.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement