I have a table, with autoincremented id

CREATE TABLE users (
    id SERIAL NOT NULL,
    name VARCHAR(30) NOT NULL,
    PRIMARY KEY (id)
)

I can add a new item there with an explicit id

INSERT INTO users (id, name) VALUES (2, 'fred')

And while my id is autoincremented, I can omit it

INSERT INTO users (name) VALUES ('ed')

So, this time, I don't know the id, and I want to somehow get it.

I could do it with LAST_IDENTITY() function, but it just uses %RowID, and have no relation to the primary id

0 11
0 710

Hi Developers,

This November, you posted 68 new questions on the Developer Community:

Questions

1 0
0 155

This is not an issue in ObjectScript, due to its typeless nature. But it's essential for external programming languages that care a bit more about types of variables.

And in any case, it's still reproducible in ObjectScript. I have table

CREATE TABLE some_table (
        id INTEGER NOT NULL, 
        x INTEGER, 
        y INTEGER, 
        z VARCHAR(50), 
        PRIMARY KEY (id)
)

And data

INSERT INTO some_table (id, x, y, z) VALUES (1, 1, 2, 'z1');
INSERT INTO some_table (id, x, y, z) VALUES (2, 2, 3, 'z2');
INSERT INTO some_table (id, x, y, z) VALUES (3, 3, 4, 'z3');
INSERT INTO some_table (id, x, y, z) VALUES (4, 4, 5, 'z4');

1 11
0 750

Hi Developers,

This October, you posted 80 new questions on the Developer Community:

Questions

How to Use Open-Ended Survey Questions +25 Examples | SurveyLegend

Here are the Key Questions of October chosen by InterSystems Experts:

0 0
0 250

Hi DC Members,

This September, you posted 79 new questions on Developer Community:

Questions

What children can teach us about asking questions - HatRabbits

Here are the Key Questions of September chosen by InterSystems Experts:

2 0
0 241

Hi Developers!

In August, you posted 77 new questions on Developer Community:

Questions

20 Questions to Make Meaningful Connections | Inc.com

And now it's time to announce the Key Questions of August chosen by InterSystems Experts!

1 0
0 232

Hello,

I'm using CircleCI to spin up the image `store/intersystems/irishealth-community:2021.2.0.649.0`.

When building the application we are getting messages that say:

ERROR #5373: Class 'EnsLib.HL7.Message', used by 'Package.Class', does not exist
Skip class Package.Class

Other missing classes seem to include, but not limited to:

Ens.BusinessProcessBPL
Ens.BusinessService
EnsLib.RecordMap.ComplexChild
EnsLib.EDI.XML.Document
Ens.Request

0 19
0 435

I am doing a HL7 data transformation with object script but need to only write a substring from the first "(" of the NTE-3 field to the end.

example

Input: NTE|1|||Some text (HI) (321)|ABC

Desired Output: NTE|1|||(HI) (321)|ABC

Basically I'd like to delete "Some text ".

If I were writing a shell script I would use sed 's/^.*(/(/' with perhaps a modification to get only the first.

I use the function wizard but can't seem to get the right code.

0 9
0 586

Hey Developers,

In July, you posted 83 questions on Developer Community:

Spoiler

How to Answer an Unanswerable Question

And now it's time to announce the Key Questions of July, chosen by InterSystems Experts!

1 0
0 248