tmtest
tmtest

Reputation: 1571

AS400 library/file (member) JDBC query

Using JDBC (with jt400 driver / connection, naming=system) I'm running these SQL statements:

"CREATE ALIAS QTEMP/SOURCETEMP FOR " + library + "/" + file + " (" + member + ")"
"SELECT SRCDTA FROM QTEMP/SOURCETEMP"
"DROP ALIAS QTEMP/SOURCETEMP"

This works. However, when the member String has a . in it this confuses everthing.

Is there any way of dealing with this?

Thanks.

Upvotes: 1

Views: 3853

Answers (2)

James Anderson
James Anderson

Reputation: 27478

Somewhere in here there are details on how library(members) are handled.

Your problem seeems to be the basic member name is leant to be up eight chars and anything after a '.' is interpreted as a type (somewaht like .html, .jpg .exe etc) however you can only store one type of data in a library object. So if your first member was premier.stuff than all the other member must have ".stuff" as a suffix if supplied.

The official 400-eze for a member is:

member

Different sets of data, each with the same format, within one database file.

You could probably get away with deleting everything after the first period from your member name.

Sorry if this isn't too clear but when the iSeries was designed they ignored every OS designed up till that point and started again from scratch. The results take some getting used too.

Upvotes: 0

nearly_lunchtime
nearly_lunchtime

Reputation: 12923

You can escape any .'s by changing eg:

member = "foo.bar"

to

member = "\"FOO.BAR\""

ie capital letters enclosed within double quotes.

Upvotes: 4

Related Questions