Multidimensional Array

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
ckhokie
Newbie
Posts: 6
Joined: Fri May 23, 2008 4:28 pm
Location: USA

Multidimensional Array

Post by ckhokie » Thu Jul 31, 2008 4:21 pm

I am looking at a database to get info for my process.

Let>SQL= SELECT Query_Id, Short_Name, Reg_Name, File_Format, Save_Path, Timeframe, Active, Program_Cd FROM Passport_Queries
DBQuery>dbH,SQL,Query,NumRecs,NumFields

I have a loop for the Record, but I am using a static number for the field.

Let>QueryId=Query_%k%_1
Let>QueryShort=Query_%k%_2
Let>QueryReg=Query_%k%_3
Let>FileFormat=Query_%k%_4
Let>SavePath=Query_%k%_5
Let>Timeframe=Query_%k%_6
Let>Active=Query_%k%_7
Let>ProgCd=Query_%k%_8

In debug mode my variables are getting
QueryId=Query_1_1
QueryShort=Query_1_2
and so on.

How do I reference the array to get the field I want and why doesn't this work?

I found the problem it had to do with the sql query.

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Jul 31, 2008 5:00 pm

The way you are referencing it is correct. So the reason you're not seeing any data and seeing the literal value must be that no data has been returned. Look at the value of NumRecs - it will be zero.

Reasons could be - your connection string is invalid or you have not connected (DBConnect) or your SQL is invalid or there just isn't any data returned by that SQL ....
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts